Changes in / [b3b0f3f:010086b] in python-game


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • game.py

    rb3b0f3f r010086b  
    1111   #glEnable (GL_BLEND); glBlendFunc (GL_ONE, GL_ONE);
    1212
    13    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    14 
     13   # I should really figure out which attributes in the 2D rendering
     14   # break the 3d rendering and reset those back instead of resetting
     15   # all attributes
     16   glPushAttrib(GL_ALL_ATTRIB_BITS)
    1517   render3d(surface)
     18   glPopAttrib()
    1619
    1720   if showOverlay:
    1821      renderOverlay(overlay, font)
     22
     23      glPushAttrib(GL_ALL_ATTRIB_BITS)
    1924      projectOverlay(surface, overlay)
     25      glPopAttrib()
    2026
    2127
     
    2935
    3036   pygame.draw.rect(overlay, (0, 128, 255), pygame.Rect(30, 30, 60, 60))
    31    pygame.draw.rect(overlay, (128, 255, 0), pygame.Rect(300, 300, 1000, 1000))
    32    
    3337   overlay.blit(text, (500, 100))
    3438
     
    3741   glPushMatrix()
    3842
    39    glColor3f(1.0, 1.0, 1.0)
     43   glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)
    4044
    4145   glTranslatef(0.0,0.0,-zNear)
     
    7074
    7175   glEnd()
    72    
    73    glDisable(GL_TEXTURE_2D)
    7476
    7577   glPopMatrix()
     
    102104   
    103105   glPushMatrix()
    104    
    105    glColor3f(1.0, 0.0, 0.0)
     106
     107   glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)
    106108
    107109   glTranslatef(0.0,0.0,-2*zNear)
     110   glColor3f(1.0, 1.0, 1.0)
    108111
    109112   glBegin(GL_LINES)
     
    164167
    165168zNear = 1.0/math.tan(math.radians(45.0/2))
    166 
    167 # not really need here since there are no previous
    168 # matrix modifications, but keeping it for reference
    169 #glLoadIdentity()
    170169gluPerspective(45, (w/h), zNear, 500.0)
    171170
Note: See TracChangeset for help on using the changeset viewer.