()
| 109 | buildModel() |
| 110 | |
| 111 | def main(): |
| 112 | # Activate logger to output info on the console |
| 113 | pbd.Logger.addConsoleSink(pbd.LogLevel.INFO) |
| 114 | |
| 115 | # init OpenGL |
| 116 | initGL(1280, 1024) |
| 117 | initLights() |
| 118 | gluLookAt (1.5, -2, 20, 1.5, -2, 0, 0, 1, 0) |
| 119 | |
| 120 | # build simulation model |
| 121 | buildModel() |
| 122 | |
| 123 | # start event loop |
| 124 | running = True |
| 125 | while running: |
| 126 | for event in pygame.event.get(): |
| 127 | if event.type == pygame.QUIT: |
| 128 | running = False |
| 129 | if event.type == pygame.KEYDOWN: |
| 130 | if event.key == pygame.K_r: |
| 131 | reset() |
| 132 | if event.key == pygame.K_ESCAPE: |
| 133 | running = False |
| 134 | |
| 135 | glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT) |
| 136 | glClearColor(0.3, 0.3, 0.3, 1.0) |
| 137 | timeStep() |
| 138 | render() |
| 139 | pygame.display.flip() |
| 140 | |
| 141 | pygame.quit() |
| 142 | pbd.Timing.printAverageTimes() |
| 143 | |
| 144 | if __name__ == "__main__": |
| 145 | main() |
no test coverage detected