I just got one of my linux boxes set up with KDevelop, and took a few
minutes to port over an SDL/OpenGL app I had been working on in Win2K. My
problem, if you can call it that, is that on the Windows side, whenever I
change resolution or toggle fullscreen in my app, I lose my OpenGL
textures, which I’d read was due to losing the rendering context and
having to get a new one. Now that I’m running it in Linux, I try switching
resolutions and toggling fullscreen on the fly, and it keeps the texture.
Right now, there are only a few things I can think of to account for this:
I’m using SDL 1.2.7 on Gentoo, but 1.2.6 on Windows. I didn’t see
anything about rendering contexts or textures in the CVS logs, but was
this something changed in the newest version? I’ll install 1.2.7 on Win2k
to figure that out.
This system has on-board video, and my other win2k/gentoo box has a
GeForce card in it. I thought it could be something in the XFree
implementation. I know it can’t be the video chip because running the
same program on the windows side loses my textures all the time.
I know the obvious solution is to just program in Linux, but I want to
stay as cross-platform as possible. So, all the way down here, my question
Does anyone know of a way to keep OpenGL from losing your textures when
you change screen modes?
Whenever I change resolution, I call SDL_SetVideoMode, then do a bit of
OpenGL initialization, specifically, this:
Same thing goes for ToggleFullscreen, where I just set the flag
SDL_FULLSCREEN and call ChangeResolution(), which goes back to the code
I’ve looked through the old mailing list archives, and found something
similar from last April in the thread “[SDL] Re: SDL_VIDEORESIZE, OpenGL,
Win32” It’s basically the same problem, whenever I change resolution or
toggle fullscreen on Win32, I have to spend a few seconds reloading
textures, and I’d rather not if I didn’t have to, like on Linux.