on_context.. - kytten popup example
Here is a simple pyglet app with a kytten pop up example.
As a main window uses a refactor of pyglet multiple_windows.py example, as a
popup window uses a refactor of kytten a_test.py example.
Writed against kitten svn r25, pyglet 1.1.3
Using a separate pyglet window, it should have minimal coupling with the
main window, thus allowing to hack small tools like tunners with minimal
interference with the app.
Doubts pyglet:
What is the usage for .on_context_lost() ?
dont care, pyglet handles it automatically. ?
It is an informative callback telling 'now, dont use gl calls till
you get a on_context_state_lost' ?
At entering the call we receive an empty context, we must regenerate
display list, shaders, textures for all actors in the Window? And any batch
and sprite ?
Other ?
About .switch_to(), when the app has more than one Window:
One can asume the correct gl context is active in __init__(),
.on_draw(), on_resize() and on_context_state_lost() ?
For all others Window methods .switch_to() must be called before
attemp to call any glXXX ?
Scheduled methods need to call .switch_to() before access the gl
context ?
Doubts kytten:
what gl state wants kitten ? That would be handy to fill
Window.on_context_state_lost(), also when using kyttle as an overlay in a
pyglet window.
kitten handles automatically .on_context_lost() ?
In a multiwindow situation, like the popup example, should I call
.switch_to() before dispatching the event 'on_update' in the kytten window?
How to run:
0. download the files from the pastebins:
multiple_windows.py http://codepad.org/Mu9VY33x
b_test.py http://codepad.org/x5bGEXsD
1. unpack the files in the same directory as the kitten sample a_test.py
lives.
2. run multiple_windows.py
3. use enter to pop up, esc (while focus in the popup) to destroy the popup.
--
claudio
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---