Prevent SDL from doing windows message pumping

Normally SDL doesn't do this as we don't ever call SDL_PumpEvents (or anything that calls that). However, OpenGL context creation code ends up calling WIN_PumpEvents regardless. This usually doesn't matter, however, in some cases, this can cause crashes, mainly with loading a state with Citra, as that ends up re-constructing its frame dumping OpenGL context (yeah that's dumb and useless but it's mostly harmless, outside of this message pumping). The WIN_PumpEvents calls appear to be unneeded anyways, so we can safely disable message pumping here.
This commit is contained in:
CasualPokePlayer 2023-07-31 15:55:36 -07:00
parent 7322e3b9d3
commit 1ee2ef928c
1 changed files with 3 additions and 0 deletions

View File

@ -39,6 +39,9 @@ namespace BizHawk.Bizware.Graphics
// we will be turning a foreign window into an SDL window
// we need this so it knows that it is capable of using OpenGL functions
SDL_SetHint(SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL, "1");
// don't allow windows events to be pumped
// it's not needed and can be dangerous in some rare cases
SDL_SetHint(SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP, "0");
}
private static readonly Lazy<int> _version = new(() =>