DescentDevelopers / Descent3

Descent 3 by Outrage Entertainment
GNU General Public License v3.0
2.73k stars 231 forks source link

opengl: use SDL_WINDOW_FULLSCREEN_DESKTOP and an FBO. #437

Closed icculus closed 2 weeks ago

icculus commented 2 weeks ago

This now renders to an OpenGL Framebuffer Object at the game's resolution, and blits it to the window at whatever resolution it is currently using, scaling and letterboxing if necessary.

Which is to say: display resolutions are now imaginary, and we never change the physical display mode now. A smaller resolution is simply drawing less pixels and scaling them up with the GPU for display. This solves a few problems: no more resizing background windows or desktop icons shuffling around, no more being stuck in a weird resolution when debugging or if the game crashes, no more waiting on monitors to click over to a new mode, and no more weird rendering when the display didn't exactly support the requested mode.

This also means the game doesn't have to drop down to 640x480 for the config menu screen when it was otherwise using some other resolution.

Some caveats:

icculus commented 2 weeks ago

(Sorry this took so long to get around to! Also, this has only had extremely light testing here after I merged it into this codebase, so please feel free to try it out and let me know if something is hosed and I'll fix things up.)

winterheart commented 2 weeks ago

Tested on Linux, works fine.