()
| 120 | buildModel() |
| 121 | |
| 122 | def main(): |
| 123 | # Activate logger to output info on the console |
| 124 | pbd.Logger.addConsoleSink(pbd.LogLevel.INFO) |
| 125 | |
| 126 | # init OpenGL |
| 127 | initGL(1280, 1024) |
| 128 | gluLookAt (5, 10, 20, 5, -5, 0, 0, 1, 0) |
| 129 | glRotatef(20.0, 0, 1, 0) |
| 130 | |
| 131 | # build simulation model |
| 132 | buildModel() |
| 133 | |
| 134 | # start event loop |
| 135 | running = True |
| 136 | while running: |
| 137 | for event in pygame.event.get(): |
| 138 | if event.type == pygame.QUIT: |
| 139 | running = False |
| 140 | if event.type == pygame.KEYDOWN: |
| 141 | if event.key == pygame.K_r: |
| 142 | reset() |
| 143 | if event.key == pygame.K_ESCAPE: |
| 144 | running = False |
| 145 | |
| 146 | glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT) |
| 147 | glClearColor(0.3, 0.3, 0.3, 1.0) |
| 148 | timeStep() |
| 149 | render() |
| 150 | pygame.display.flip() |
| 151 | |
| 152 | pygame.quit() |
| 153 | pbd.Timing.printAverageTimes() |
| 154 | |
| 155 | if __name__ == "__main__": |
| 156 | main() |
no test coverage detected