Advertisement

OpenGL+SDL under windows.

Started by June 09, 2003 03:42 AM
3 comments, last by rodzilla 21 years, 8 months ago
Hi have this strange problem under Windows : whenever I resize the window or switch resolution, the OpenGL context is lost (textures, options & flags ...). Is there a way of avoiding this problem ?
SaM3d!, a cross-platform API for 3d based on SDL and OpenGL.The trouble is that things never get better, they just stay the same, only more so. -- (Terry Pratchett, Eric)
Anybody has a solution to this problem ?
SaM3d!, a cross-platform API for 3d based on SDL and OpenGL.The trouble is that things never get better, they just stay the same, only more so. -- (Terry Pratchett, Eric)
Advertisement
I use GLFW and I can resize windows without losing. But when video mode is changed, you need to reload resources. I don''t know if there''s solution.
For window changing color depth there''s not. Windows will not allow to change the pixel format so you will have to blow up teh window (and the render context) and restart everything.

Changing resolution is probably possible without destroying the window but I am quite sure MSDN says it is bad. I actually think it should work anyway.

For window being resized, this is absolutely wrong. Check out your messageproc code. BTW, consider making the window non resizeable. This would be bad but it is not usually a problem for 3d games.

Previously "Krohm"

Using SDL+OpenGL, whenever I resize a window, the textures are lost. Maybe my window-resize-code is bad...

I started coding things to reload automatically all textures when changing video mode/resizing window. Seems to work so far...

Thanx anyway !
SaM3d!, a cross-platform API for 3d based on SDL and OpenGL.The trouble is that things never get better, they just stay the same, only more so. -- (Terry Pratchett, Eric)

This topic is closed to new replies.

Advertisement