Quick question:
Say I create the display, and create the Mouse and Keyboard along with it. If I now go and destroy the display and recreate it, say, in windowed mode, am I obligated to also destroy and recreate the Mouse and Keyboard? That is, will they continue to work if simply ignore them?
Thanks. (Hope this isn't an obvious question answered somewhere in the docs...)
No. You have to destroy them before you destroy the window. And then re-create them again after the window has been created.
- elias
...something I think we ought to fix in 0.9. Is it possible to make them independent of the Window on Linux and MacOSX?
Cas :)
Sounds like a good feature - if there's a problem with keeping them over a window rebuild, can this be hidden in the API?
If you can recreate any created input devices transparently in Window.create() on platforms that require it, that would be great. Could lead to a particular exception only being thrown on particular platforms though...
I notice that when you reinit you have to destroy the GL context, meaning you lose texture bindings, lists, etc. Would it be possible to ever change resolutions, fullscreen without destroying GL?
We should make that possible, yes. The real issue is that we need to make Window track display mode changes when in fullscreen mode.
Cas :)
Are we sure we want to do this? I heard JOGL had a lot of problems with resizing windows. It might relate to problems of reassigning the context to a different window (with a potentially different pixel format).
- elias
And regarding the independent devices: Are they independent in win32 at all? I thought DirectInput needed a hwnd to operate.
- elias
I heard that JInput uses a simple invisible window, and runs DirectInput through that, rather than through the actual game window. Seems like a perfectly reasonable way to do it - but what about the other OS's?
Cas :)
No thanks, that sounds like too much trouble for little gain. Besides, that will probably screw native cursor mode.
Thanks for the comprehensive answer.
I'd appreciate it if the Window transparently recreates any previously created input devices - it would certainly clean up my code a bit. I'd also like to be able to resize the display/toggle fullscreen without being forced to reinitialize the GL context. (I could see this being very useful for in-game options screens.)
Well, however we implement it, it'll recreate your devices, yes.
Cas :)