Changing screen resolution (do I need to destroy the window?)

Started by
0 comments, last by swiftcoder 9 years, 1 month ago

I have it working with no problems, but I have a question. Do I need to SDL_DestroyWindow() each time I want to change screen resolution - fullscreen, no window resize (and therefore delete and reload all textures)? Seems like a bit rough solution for resolution change...

Note I use: SDL2+OpenGL.

Stellar Monarch (4X, turn based, released): GDN forum topic - Twitter - Facebook - YouTube

Advertisement

In earlier versions of SDL it was often necessary to perform the full teardown/recreate you describe.

With SDL2, you should be able to just call SDL_SetWindowDisplayMode() (and then update your viewport, projection matrix, etc).

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

This topic is closed to new replies.

Advertisement