Changeset b3b0f3f in python-game
- Timestamp:
- Apr 5, 2017, 2:34:24 AM (8 years ago)
- Branches:
- master
- Children:
- 114fd09
- Parents:
- 010086b (diff), b2d384b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
game.py
r010086b rb3b0f3f 11 11 #glEnable (GL_BLEND); glBlendFunc (GL_ONE, GL_ONE); 12 12 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) 13 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 14 17 15 render3d(surface) 18 glPopAttrib()19 16 20 17 if showOverlay: 21 18 renderOverlay(overlay, font) 22 23 glPushAttrib(GL_ALL_ATTRIB_BITS)24 19 projectOverlay(surface, overlay) 25 glPopAttrib()26 20 27 21 … … 35 29 36 30 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 37 33 overlay.blit(text, (500, 100)) 38 34 … … 41 37 glPushMatrix() 42 38 43 glC lear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)39 glColor3f(1.0, 1.0, 1.0) 44 40 45 41 glTranslatef(0.0,0.0,-zNear) … … 74 70 75 71 glEnd() 72 73 glDisable(GL_TEXTURE_2D) 76 74 77 75 glPopMatrix() … … 104 102 105 103 glPushMatrix() 106 107 glC lear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)104 105 glColor3f(1.0, 0.0, 0.0) 108 106 109 107 glTranslatef(0.0,0.0,-2*zNear) 110 glColor3f(1.0, 1.0, 1.0)111 108 112 109 glBegin(GL_LINES) … … 167 164 168 165 zNear = 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() 169 170 gluPerspective(45, (w/h), zNear, 500.0) 170 171
Note:
See TracChangeset
for help on using the changeset viewer.