How to reinit fullscreen canvas?

Started by coasternuts, August 02, 2005, 02:45:24

Previous topic - Next topic

coasternuts

I have an LWJGL program that is fullscreen using the opengl.Display class.  The java program then System.exec() a 3rd party program that I believe is running OpenGL as well.   When it returns to my program all the graphics are shifted across the screen.  Now I did a glGet on the projection and modelview matrices before and after the 3rd party exec and they are the same.  So technically everything should be rendered in the same location, only they are not.  Is there a correct way to reinitialize my fullscreen canvas?  I've tried Display.makeCurrent() and Display.update() but no dice!  I suspect that this is window/Display specific.  

I am using the latest version of LWJGL  0.97.

Any help would be greatly appreciated as my game launcher is almost complete.  I got it working for other 3rd party programs with no problem, but one of them is given me the fits.  Grrrr...  Thanks.

coasternuts

ps.  It appears to not do it when not in fullscreen.  I have my display set at 1024 x 768 and it works fine.  But fullscreen 1024 x 768 exhibits the strange translation behavior.

What's the difference between fullscreen and not fullscreen other than the window border?  Now I'm suspecting the windowing code for sure.

coasternuts

I'm a bandwidth hogging #$$ho1#.  

If I call Display.setDisplayMode( mode ) again after it returns, all is good.

Sorry for the posts.

coasternuts

I'm back.

Now I have a situation where the application that I load from my LWJGL Java app is running OGL.  When the app finishes and returns to my app, the textures are corrupted/missing and it appears to be choking(not responsive to inputs).

Any ideas?  

This is equivalent to running two fullscreen OGL apps at once. How do I reinitialize my canvas?  Is there a way to suspend rendering?  I see an isActive() on the Display, but I don't see a suspend() or disable() or makeInactive() or....

Thanks.

Funkapotamus

Maybe try calling glPushmatrix() prior to executing the 3rd party app and glPopMatrix() once it's done?  I'm completely guessing here though.

coasternuts

Not missing as in transform, but missing as in the quad is all white as opposed to my texture data.  It's as if I need to reload the textures, which I verified by doing so after returning.  

But that can't be all that is needed.  I litteraly have to destroy Display and create again once another application that uses OpenGL.  I guess this makes sense since the memory would be overwritten on the GFX card.

Basically, I am writing a game front end that launches games, and when I launch any games that run OGL, if I destroy the Display before launching, then the user sees "Windows" before being sent to the app.  And once again the user sees "Windows" when exiting the game.  I am trying to expose the OS to the user.

Orangy Tang

Quote from: "coasternuts"
Now I have a situation where the application that I load from my LWJGL Java app is running OGL.  When the app finishes and returns to my app, the textures are corrupted/missing and it appears to be choking(not responsive to inputs).
Re-initing the display (with setDisplayMode) should be destroying and recreating the opengl context, taking all your textures with it. You'll have to reload them if you want to do that.

However running a seperate opengl app shouldn't mess with your own apps state. As a test, have you tried re-setting the viewport after returning to your app (even though this shouldn't be needed).

coasternuts

Wow.  I was not even setting the glViewport to begin with.  I guess I was just getting lucky to see anything in the first place.  I'm guessing there is a glViewport call somewhere in Display creation.  At any rate I delayed my focus grab as well as issued a glviewport call after reinit of the Display and everything works fine.

Thanks.

I'm curious as to why you even thought about the viewport?

Orangy Tang

Quote from: "coasternuts"Wow.  I was not even setting the glViewport to begin with.  I guess I was just getting lucky to see anything in the first place.  I'm guessing there is a glViewport call somewhere in Display creation.  At any rate I delayed my focus grab as well as issued a glviewport call after reinit of the Display and everything works fine.
LWJGL explicitly sets the viewport to the full window on display creation (or it should).

QuoteI'm curious as to why you even thought about the viewport?
Other than the matrix stacks (which you'd already checked) thats about the only thing that can cause a funny shift like that. Goat knows why the other app was messing with it though.