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