Sdl fullscreen and opengl textures

how to get them working?
if i start my application with fullscreen it works fine, but if i change
screen mode during the game, i only get a (mostly) white screen
from various googling around i see that if you call SDL_setvideomode() again
and used opengl textures you simply lose them all and have to reload them
all
usually though you load a lot of images that become textures and when the
application is a game it not feasable to pause the game for reloading all
the textures.

is there some workaround to this or another way to implement fullscreen?
Vittorio–

Stephen Leacockhttp://www.brainyquote.com/quotes/authors/s/stephen_leacock.html

  • “I detest life-insurance agents: they always argue that I shall some
    day
    die, which is not so.”

It’s a pain, but I don’t think there’s any kind of workaround. From
what I’ve read, different platforms have different behaviors
concerning whether or not they change context, so you have to assume
its going to change.

http://lists.libsdl.org/htdig.cgi/sdl-libsdl.org/2009-October/072866.html--
Terry Welsh / mogumbo ‘at’ gmail.com
www.reallyslick.com / www.mogumbo.com

Message: 2
Date: Sun, 3 Jan 2010 23:32:48 +0100
From: “Vittorio G.” <vitto.giova at yahoo.it>
To: sdl at libsdl.org
Subject: [SDL] sdl fullscreen and opengl textures
Message-ID:
? ? ? ?<4de51c661001031432w18484531j3854aeb9df3e4adf at mail.gmail.com>
Content-Type: text/plain; charset=“iso-8859-1”

how to get them working?
if i start my application with fullscreen it works fine, but if i change
screen mode during the game, i only get a (mostly) white screen
from various googling around i see that if you call SDL_setvideomode() again
and used opengl textures you simply lose them all and have to reload them
all
usually though you load a lot of images that become textures and when the
application is a game it not feasable to pause the game for reloading all
the textures.

is there some workaround to this or another way to implement fullscreen?
Vittorio

I have a question similar to this. If the window loses focus, or is lowered, or something should happen that might cause OpenGL to lose the texture data, when you go to reload all of the textures, do you need to delete the old ones first? Or do you just assume they have been deleted anyway?

Terry Welsh wrote:> It’s a pain, but I don’t think there’s any kind of workaround. From

what I’ve read, different platforms have different behaviors
concerning whether or not they change context, so you have to assume
its going to change.

http://lists.libsdl.org/htdig.cgi/sdl-libsdl.org/2009-October/072866.html


Terry Welsh / mogumbo ‘at’ gmail.com
www.reallyslick.com / www.mogumbo.com

SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

In an OpenGL app there are often copies of data in both system RAM and
video RAM. If an OpenGL context is destroyed, your OpenGL driver
should be smart enough to clean up video RAM (after all, it’s really
just a big fancy memory manager), but it would still be up to you to
clean up system RAM.

I’ve had the same trouble. Since I’m using OpenSceneGraph for my
game, I haven’t been able to figure out how to make it thoroughly
clean up old gl objects. So that remains on my to-do list.
Fortunately, even if you don’t clean up old objects your game will
still run fine as long as you don’t run out of memory.–
Terry Welsh / mogumbo ‘at’ gmail.com
www.reallyslick.com / www.mogumbo.com

Message: 2
Date: Mon, 04 Jan 2010 13:24:58 -0800
From: “MBrening” <micah.brening at gmail.com>
To: sdl at lists.libsdl.org
Subject: Re: [SDL] sdl fullscreen and opengl textures
Message-ID: <1262640298.m2f.21425 at forums.libsdl.org>
Content-Type: text/plain; charset=“iso-8859-1”

I have a question similar to this. ?If the window loses focus, or is lowered, or something should happen that might cause OpenGL to lose the texture data, when you go to reload all of the textures, do you need to delete the old ones first? ?Or do you just assume they have been deleted anyway?

Terry Welsh wrote:

It’s a pain, but I don’t think there’s any kind of workaround. ?From
what I’ve read, different platforms have different behaviors
concerning whether or not they change context, so you have to assume
its going to change.

http://lists.libsdl.org/htdig.cgi/sdl-libsdl.org/2009-October/072866.html


Terry Welsh ?/ ?mogumbo ‘at’ gmail.com
www.reallyslick.com ?/ ?www.mogumbo.com

SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org