Changes in game.py [b2d384b:a7f54e3] in python-game
Legend:
- Unmodified
- Added
- Removed
-
game.py
rb2d384b ra7f54e3 11 11 #glEnable (GL_BLEND); glBlendFunc (GL_ONE, GL_ONE); 12 12 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) 15 17 render3d(surface) 18 glPopAttrib() 16 19 17 20 if showOverlay: 18 21 renderOverlay(overlay, font) 22 23 glPushAttrib(GL_ALL_ATTRIB_BITS) 19 24 projectOverlay(surface, overlay) 25 glPopAttrib() 20 26 21 27 … … 29 35 30 36 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 33 37 overlay.blit(text, (500, 100)) 34 38 … … 37 41 glPushMatrix() 38 42 39 glC olor3f(1.0, 1.0, 1.0)43 glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT) 40 44 41 45 glTranslatef(0.0,0.0,-zNear) … … 70 74 71 75 glEnd() 72 73 glDisable(GL_TEXTURE_2D)74 76 75 77 glPopMatrix() … … 102 104 103 105 glPushMatrix() 104 105 glC olor3f(1.0, 0.0, 0.0)106 107 glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT) 106 108 107 109 glTranslatef(0.0,0.0,-2*zNear) 110 glColor3f(1.0, 1.0, 1.0) 108 111 109 112 glBegin(GL_LINES) … … 164 167 165 168 zNear = 1.0/math.tan(math.radians(45.0/2)) 166 167 # not really need here since there are no previous168 # matrix modifications, but keeping it for reference169 #glLoadIdentity()170 169 gluPerspective(45, (w/h), zNear, 500.0) 171 170
Note:
See TracChangeset
for help on using the changeset viewer.