Show More
@@ -326,32 +326,33 b' class InputHookManager(object):' | |||
|
326 | 326 | the GLUT to integrate with terminal based applications like |
|
327 | 327 | IPython. |
|
328 | 328 | |
|
329 |
GLUT is |
|
|
329 | GLUT is quite an old library and it is difficult to ensure proper | |
|
330 | 330 | integration within IPython since original GLUT does not allow to handle |
|
331 | 331 | events one by one. Instead, it requires for the mainloop to be entered |
|
332 | 332 | and never returned (there is not event a function to exit he |
|
333 | 333 | mainloop). Fortunately, there are alternatives such as freeglut |
|
334 |
(avai |
|
|
334 | (available for linux and windows) and the OSX implementation gives | |
|
335 | 335 | access to a glutCheckLoop() function that blocks itself until a new |
|
336 | 336 | event is received. This means we have to setup a default timer to |
|
337 | ensure we got at least one event that will unblock the function. | |
|
337 | ensure we got at least one event that will unblock the function. We set | |
|
338 | a default timer of 60fps. | |
|
338 | 339 | |
|
339 |
Furthermore, it is not possible to install these handlers wi |
|
|
340 |
window being first created. We choose to make this window visible |
|
|
341 | the user to realize that it does not need to create a new one (or this | |
|
342 | will bring troubles). But, display mode options are then set here and | |
|
343 | it won't be possible for the user to change them without modifying the | |
|
344 | code or this has to be made availble via IPython options system. | |
|
340 | Furthermore, it is not possible to install these handlers without a | |
|
341 | window being first created. We choose to make this window invisible and | |
|
342 | the user is supposed to akeit visible when needed (see gui-glut.py in | |
|
343 | the docs/examples/lib directory). This means that display mode options | |
|
344 | are set ath this level and user won't be able to change them later | |
|
345 | without modifying the code. This should probably be made available via | |
|
346 | IPython options system. | |
|
345 | 347 | |
|
346 | 348 | Script integration |
|
347 | 349 | ------------------ |
|
348 | 350 | |
|
349 | :: | |
|
350 | ||
|
351 | interactive = False | |
|
352 | 351 | if glut.glutGetWindow() > 0: |
|
353 | 352 | interactive = True |
|
353 | glut.glutShowWindow() | |
|
354 | 354 | else: |
|
355 | interactive = False | |
|
355 | 356 | glut.glutInit(sys.argv) |
|
356 | 357 | glut.glutInitDisplayMode( glut.GLUT_DOUBLE | |
|
357 | 358 | glut.GLUT_RGBA | |
@@ -421,7 +422,7 b' class InputHookManager(object):' | |||
|
421 | 422 | # to change it later |
|
422 | 423 | glut.glutInitDisplayMode(glut.GLUT_DOUBLE | glut.GLUT_RGBA | glut.GLUT_DEPTH) |
|
423 | 424 | glut.glutCreateWindow(sys.argv[0]) |
|
424 | glut.glutReshapeWindow(1,1) | |
|
425 | # glut.glutReshapeWindow(1,1) | |
|
425 | 426 | glut.glutHideWindow() |
|
426 | 427 | glut.glutDisplayFunc(display) |
|
427 | 428 | glut.glutTimerFunc( int(1000.0/fps), timer, fps) |
General Comments 0
You need to be logged in to leave comments.
Login now