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

MakeOpenglDrawIn2D

      
Search:  
 
 

make opengl behave like you are drawing in 2d.

def glEnable2D():
    """ make opengl behave like you are drawing in 2d.
    """
    vPort = glGetIntegerv(GL_VIEWPORT)
 
    glMatrixMode(GL_PROJECTION)
    glPushMatrix()
    glLoadIdentity()
 
    glOrtho(0, vPort[2], 0, vPort[3], -1, 1)
    glMatrixMode(GL_MODELVIEW)
    glPushMatrix()
    glLoadIdentity()
 
 
 
def glDisable2D():
   """ Use when you've finished drawing in 2D.
   """
   glMatrixMode(GL_PROJECTION)
   glPopMatrix()
   glMatrixMode(GL_MODELVIEW)
   glPopMatrix()
spotlight

 
our projects
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
 
recent releases
Oct 20, 2014

Oct 16, 2014

Oct 9, 2014

Oct 8, 2014

Oct 7, 2014

Oct 4, 2014

Oct 1, 2014

Sep 19, 2014

Sep 17, 2014

Sep 9, 2014

Sep 8, 2014

Sep 7, 2014

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