SetVideoMode and Texture memory destroy

Hi again fellows,

I’m bothering you a lot this week with lots of question huhn ? =)

My app has a button to toggle to fullscreen. But in Windows we can’t use SDL
call to Toggle to Fullscreen so what I do is to call SetVideoMode again
passing the appropriate flag.

But when I call SetVideoMode again, it destroys all my textures created with
OpenGL commands. It is like if it destroys my Texture Memory…

Anyone knows anything about it ?

[]s

Bruce Christopher Barrera------------------
Moderador da lista de discuss?o OpenGL_Brasil
http://br.groups.yahoo.com/group/opengl_brasil/
Moderador da se??o OpenGL do F?rum do PDJ Brasil
http://www.pdj.com.br/forum

“Existem 10 tipos de pessoas. As que entendem binario e as que nao
entendem…”

Bruce @ OpenGL wrote:

Hi again fellows,

I’m bothering you a lot this week with lots of question huhn ? =)

My app has a button to toggle to fullscreen. But in Windows we can’t use SDL
call to Toggle to Fullscreen so what I do is to call SetVideoMode again
passing the appropriate flag.

But when I call SetVideoMode again, it destroys all my textures created with
OpenGL commands. It is like if it destroys my Texture Memory…

Anyone knows anything about it ?

This is normal : when you destroy an OpenGL context you lose all the
OpenGL state, which contains the attached textures. As far as I can
tell, there is no way to portabily toggle fullscreen without losing the
OpenGL context, so you’ll have to deal with that yourself and reload the
textures. The same is true when switching the video resolution.

Stephane

This is normal : when you destroy an OpenGL context you lose all the
OpenGL state, which contains the attached textures. As far as I can
tell, there is no way to portabily toggle fullscreen without losing the
OpenGL context, so you’ll have to deal with that yourself and reload the
textures. The same is true when switching the video resolution.

You may have noticed that even professional games such as Quake 3 have
to reload textures (they display the level loading screen) when you
change the screen size.

Chris Seaton

You don’t have to; some screen mode changes don’t require this. However,
it’s hard to keep broken drivers behaving, and always reloading textures
is one way to appease some of them (at the expense of wasting everyone
else’s time reloading).On Thu, Jan 29, 2004 at 10:44:30PM +0000, Chris Seaton wrote:

This is normal : when you destroy an OpenGL context you lose all the
OpenGL state, which contains the attached textures. As far as I can
tell, there is no way to portabily toggle fullscreen without losing the
OpenGL context, so you’ll have to deal with that yourself and reload the
textures. The same is true when switching the video resolution.

You may have noticed that even professional games such as Quake 3 have
to reload textures (they display the level loading screen) when you
change the screen size.


Glenn Maynard

Drat!

This way I can only give the option for fullscreen to my user at the
beginning of the game in some kind of setup program! Inside game I can’t
afford to have my user wait while all textures and states load again! =(

Thnxs again for the tip,
Bruce> ----- Original Message -----

From: sdl-admin@libsdl.org [mailto:sdl-admin at libsdl.org]On Behalf Of
Stephane Marchesin
Sent: quinta-feira, 29 de janeiro de 2004 20:09
To: sdl at libsdl.org
Subject: Re: [SDL] SetVideoMode and Texture memory destroy

Bruce @ OpenGL wrote:

Hi again fellows,

I’m bothering you a lot this week with lots of question huhn ? =)

My app has a button to toggle to fullscreen. But in Windows we can’t use
SDL
call to Toggle to Fullscreen so what I do is to call SetVideoMode again
passing the appropriate flag.

But when I call SetVideoMode again, it destroys all my textures created
with
OpenGL commands. It is like if it destroys my Texture Memory…

Anyone knows anything about it ?

This is normal : when you destroy an OpenGL context you lose all the
OpenGL state, which contains the attached textures. As far as I can
tell, there is no way to portabily toggle fullscreen without losing the
OpenGL context, so you’ll have to deal with that yourself and reload the
textures. The same is true when switching the video resolution.

Stephane


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Well, the same goes for Q3A, RTCW and co - if you change video mode
during a game, you’ll (at best) be disconnected for a while, while
reloading the level textures. Not much to do about that, without
risking trouble with some drivers.

However, why would you need a setup program? (Right, it’s a pretty
useful to have one, in case you manage to set a mode that the monitor
can’t handle or something.) It shouldn’t be a problem if it’s just
the menu textures you have to reload. It’s only when you have to
reload all textures for a level that it takes an annoyingly long time
to get back up.

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Thursday 29 January 2004 23.57, bruce at opengl.com.br wrote:

Drat!

This way I can only give the option for fullscreen to my user at
the beginning of the game in some kind of setup program! Inside
game I can’t afford to have my user wait while all textures and
states load again! =(