Skip to content

Fix window_res related bugs and harden OpenGL state#6753

Merged
BMagnu merged 1 commit into
scp-fs2open:masterfrom
BMagnu:window_res_hardening
Jun 6, 2025
Merged

Fix window_res related bugs and harden OpenGL state#6753
BMagnu merged 1 commit into
scp-fs2open:masterfrom
BMagnu:window_res_hardening

Conversation

@BMagnu

@BMagnu BMagnu commented Jun 6, 2025

Copy link
Copy Markdown
Member

As it turns out, a few things were trying to read from incorrect buffers when window_res was active, causing OpenGL error messages and possibly unintended behaviour in some parts.
Fix these by reading from the correct buffer when window_res is used.
This is especially important as it appears that newer SDL versions (SDL3 through SDL2compat is definitely affected, possibly older versions as well) exhibit some sort of cleanup effect on the front buffer, which results in bad reads and incorrect rendering of pause frames and other dialogs. To fix this, a followup PR should likely enable window_res at all times (as is done for fullscreen at the momemt), and for that, window_res needs to function reliably and without OpenGL errors.

Also harden the GL state handling, by querying whether the GL state is valid for the buffer flip, as SDL will exhibit undefined behaviour if it is not set correctly.

@BMagnu BMagnu added this to the Release 25.0 milestone Jun 6, 2025
@BMagnu BMagnu added fix A fix for bugs, not-a-bugs, and/or regressions. graphics A feature or issue related to graphics (2d and 3d) labels Jun 6, 2025
@BMagnu BMagnu merged commit 0399e13 into scp-fs2open:master Jun 6, 2025
18 checks passed
@MjnMixael MjnMixael mentioned this pull request Jul 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix A fix for bugs, not-a-bugs, and/or regressions. graphics A feature or issue related to graphics (2d and 3d)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants