()
| 171 | buildModel() |
| 172 | |
| 173 | def main(): |
| 174 | # Activate logger to output info on the console |
| 175 | pbd.Logger.addConsoleSink(pbd.LogLevel.INFO) |
| 176 | |
| 177 | # init OpenGL |
| 178 | initGL(1280, 1024) |
| 179 | gluLookAt (0, 10, -20, 0, 0, 0, 0, 1, 0) |
| 180 | glRotatef(20.0, 0, 1, 0) |
| 181 | |
| 182 | # build simulation model |
| 183 | buildModel() |
| 184 | |
| 185 | # start event loop |
| 186 | running = True |
| 187 | while running: |
| 188 | for event in pygame.event.get(): |
| 189 | if event.type == pygame.QUIT: |
| 190 | running = False |
| 191 | if event.type == pygame.KEYDOWN: |
| 192 | if event.key == pygame.K_r: |
| 193 | reset() |
| 194 | if event.key == pygame.K_ESCAPE: |
| 195 | running = False |
| 196 | |
| 197 | glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT) |
| 198 | glClearColor(0.3, 0.3, 0.3, 1.0) |
| 199 | timeStep() |
| 200 | render() |
| 201 | pygame.display.flip() |
| 202 | |
| 203 | pygame.quit() |
| 204 | pbd.Timing.printAverageTimes() |
| 205 | |
| 206 | if __name__ == "__main__": |
| 207 | main() |
no test coverage detected