pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing
Wiki

GLLight

      
Search:  
 
 

In OpenGL, tracking what lights are available can be tricky. This class make it a little easier, by allocating lights when you create an instance, and deallocating a light when the instance is destroyed.

class GLLight(object):
    lights = [GL_LIGHT0, GL_LIGHT1, GL_LIGHT2, GL_LIGHT3, GL_LIGHT4,
        GL_LIGHT5, GL_LIGHT6, GL_LIGHT7]
    def __init__(self):
        try:
            self.id = self.lights.pop(-1)
        except IndexError:
            raise RuntimeError('Too many lights allocated.')
 
    def __del__(self):
        self.lights.append(self.id)
spotlight

 
our projects
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
 
recent releases
May 1, 2016

Apr 6, 2016


Mar 27, 2016

Mar 26, 2016

Mar 22, 2016

Mar 19, 2016

Mar 17, 2016

Mar 13, 2016

Feb 27, 2016

Feb 21, 2016

Feb 12, 2016

... more!
 
for pygame related questions, comments, and suggestions, please see help (lists, irc)