Quoting "E. Wing" <[EMAIL PROTECTED]>:
> > So you're saying that if the scene graph hasn't changed since the program
> > started, I could just create the new surface (with SDL_SetVideoMode) and
> reload
> > the file? And if the scene graph has changed, then I would have to save the
> > scene graph, create the new surface and reload the file afterwards? It's
> messy,
> > but it might work.
>
>
> You may not have to recall SDL_SetVideoMode. SDL might already make
> sure you have a valid context if you toggle. I' don't remember that
> detail.
Well, on Windows SDL_WM_ToggleFullScreen does nothing in SDL 1.2.11 . So to
change to full screen mode, I have to call SDL_SetVideoMode with the
SDL_FULLSCREEN flag (or not, to get a windowed mode).
Same thing (even more so) for changing resolutions.
> Regardless of whether your scene graph has changed [...]
I only mentioned these two cases (scene graph has changed versus not) because
one case is easier to reload than the other. If nothing has changed since the
last load, I can just reload the same thingĀ. Otherwise, I have to see what has
changed, save it somewhere and reload it so that OSG recreates the textures and
display lists etc. I believe that's easier than your following suggestion:
> I'm thinking you might be able to hook into this infrastructure if you
> treat the SDL toggle as a new separate context.
That may be more complex than I'm willing to tackle. We'll see if I ever need
something like that. I currently don't know enough about OSG to go poking into
the internals and potentially expose something that was only used internally
before...
For now, I think I'll just leave the full screen and resolution options in a
config file (so restart to see the change) and maybe in the game's main menu
(so there is no level or anything loaded when it happens, and then the
reloading after mode change is simple).
Thanks for the discussion, it was very enlightening.
J-S
--
______________________________________________________
Jean-Sebastien Guay [EMAIL PROTECTED]
http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/