()
| 142 | buildModel() |
| 143 | |
| 144 | def main(): |
| 145 | # Activate logger to output info on the console |
| 146 | pbd.Logger.addConsoleSink(pbd.LogLevel.INFO) |
| 147 | |
| 148 | # init OpenGL |
| 149 | initGL(1280, 1024) |
| 150 | gluLookAt (0, 10, -20, 0, 0, 0, 0, 1, 0) |
| 151 | glRotatef(20.0, 0, 1, 0) |
| 152 | |
| 153 | # build simulation model |
| 154 | buildModel() |
| 155 | |
| 156 | # start event loop |
| 157 | running = True |
| 158 | while running: |
| 159 | for event in pygame.event.get(): |
| 160 | if event.type == pygame.QUIT: |
| 161 | running = False |
| 162 | if event.type == pygame.KEYDOWN: |
| 163 | if event.key == pygame.K_r: |
| 164 | reset() |
| 165 | if event.key == pygame.K_ESCAPE: |
| 166 | running = False |
| 167 | |
| 168 | glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT) |
| 169 | glClearColor(0.3, 0.3, 0.3, 1.0) |
| 170 | timeStep() |
| 171 | render() |
| 172 | pygame.display.flip() |
| 173 | |
| 174 | pygame.quit() |
| 175 | pbd.Timing.printAverageTimes() |
| 176 | |
| 177 | if __name__ == "__main__": |
| 178 | main() |
no test coverage detected