Show More
@@ -312,26 +312,28 class InputHookManager(object): | |||
|
312 | 312 | """ |
|
313 | 313 | |
|
314 | 314 | import OpenGL.GLUT as glut |
|
315 |
from IPython.lib.inputhookglut import |
|
|
315 | from IPython.lib.inputhookglut import glut_display_mode, \ | |
|
316 | glut_close, glut_display, \ | |
|
317 | glut_idle, inputhook_glut | |
|
316 | 318 | |
|
317 | if not self._apps.has_key(GUI_GLUT): | |
|
318 | glut.glutInit(sys.argv) | |
|
319 | glut.glutInitDisplayMode(glut_display_mode) | |
|
319 | if not self._apps.has_key( GUI_GLUT ): | |
|
320 | glut.glutInit( sys.argv ) | |
|
321 | glut.glutInitDisplayMode( glut_display_mode ) | |
|
320 | 322 | # This is specific to freeglut |
|
321 | 323 | if bool(glut.glutSetOption): |
|
322 | glut.glutSetOption(glut.GLUT_ACTION_ON_WINDOW_CLOSE, | |
|
323 | glut.GLUT_ACTION_GLUTMAINLOOP_RETURNS) | |
|
324 | glut.glutCreateWindow(sys.argv[0]) | |
|
324 | glut.glutSetOption( glut.GLUT_ACTION_ON_WINDOW_CLOSE, | |
|
325 | glut.GLUT_ACTION_GLUTMAINLOOP_RETURNS ) | |
|
326 | glut.glutCreateWindow( sys.argv[0] ) | |
|
325 | 327 | glut.glutReshapeWindow( 1, 1 ) |
|
326 | glut.glutHideWindow() | |
|
327 | glut.glutWMCloseFunc(glut_close) | |
|
328 | glut.glutDisplayFunc(glut_display) | |
|
329 | glut.glutIdleFunc( glut_idle) | |
|
328 | glut.glutHideWindow( ) | |
|
329 | glut.glutWMCloseFunc( glut_close ) | |
|
330 | glut.glutDisplayFunc( glut_display ) | |
|
331 | glut.glutIdleFunc( glut_idle ) | |
|
330 | 332 | else: |
|
331 | glut.glutWMCloseFunc(glut_close) | |
|
332 | glut.glutDisplayFunc(glut_display) | |
|
333 | glut.glutWMCloseFunc( glut_close ) | |
|
334 | glut.glutDisplayFunc( glut_display ) | |
|
333 | 335 | glut.glutIdleFunc( glut_idle) |
|
334 | self.set_inputhook(inputhook_glut) | |
|
336 | self.set_inputhook( inputhook_glut ) | |
|
335 | 337 | self._current_gui = GUI_GLUT |
|
336 | 338 | self._apps[GUI_GLUT] = True |
|
337 | 339 | |
@@ -343,7 +345,8 class InputHookManager(object): | |||
|
343 | 345 | dummy one and set the timer to a dummy timer that will be triggered |
|
344 | 346 | very far in the future. |
|
345 | 347 | """ |
|
346 | from glut_support import * | |
|
348 | import OpenGL.GLUT as glut | |
|
349 | from glut_support import glutMainLoopEvent | |
|
347 | 350 | |
|
348 | 351 | glut.glutHideWindow() # This is an event to be processed below |
|
349 | 352 | glutMainLoopEvent() |
General Comments 0
You need to be logged in to leave comments.
Login now