mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2024-11-14 21:37:42 -07:00
fix potential crash when switching video output methods
This commit is contained in:
parent
c49dec1acd
commit
d8d7ba9251
@ -134,13 +134,15 @@ void OnRendererChanged(uiRadioButtons* rb, void* blarg)
|
|||||||
ApplyNewSettings(2);
|
ApplyNewSettings(2);
|
||||||
else
|
else
|
||||||
ApplyNewSettings(3);
|
ApplyNewSettings(3);
|
||||||
|
|
||||||
|
uiControlSetFocus(uiControl(win));
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnGLDisplayChanged(uiCheckbox* cb, void* blarg)
|
void OnGLDisplayChanged(uiCheckbox* cb, void* blarg)
|
||||||
{
|
{
|
||||||
Config::ScreenUseGL = uiCheckboxChecked(cb);
|
Config::ScreenUseGL = uiCheckboxChecked(cb);
|
||||||
ApplyNewSettings(2);
|
ApplyNewSettings(2);
|
||||||
uiControlSetFocus(uiControl(cb));
|
uiControlSetFocus(uiControl(win));
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnThreaded3DChanged(uiCheckbox* cb, void* blarg)
|
void OnThreaded3DChanged(uiCheckbox* cb, void* blarg)
|
||||||
|
@ -2043,15 +2043,14 @@ void ApplyNewSettings(int type)
|
|||||||
bool usegl = Config::ScreenUseGL || (Config::_3DRenderer != 0);
|
bool usegl = Config::ScreenUseGL || (Config::_3DRenderer != 0);
|
||||||
if (usegl != Screen_UseGL)
|
if (usegl != Screen_UseGL)
|
||||||
{
|
{
|
||||||
Screen_UseGL = usegl;
|
|
||||||
|
|
||||||
if (RunningSomething)
|
if (RunningSomething)
|
||||||
{
|
{
|
||||||
if (usegl) uiGLMakeContextCurrent(GLContext);
|
if (Screen_UseGL) uiGLMakeContextCurrent(GLContext);
|
||||||
GPU3D::DeInitRenderer();
|
GPU3D::DeInitRenderer();
|
||||||
if (usegl) uiGLMakeContextCurrent(NULL);
|
if (Screen_UseGL) uiGLMakeContextCurrent(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Screen_UseGL = usegl;
|
||||||
RecreateMainWindow(usegl);
|
RecreateMainWindow(usegl);
|
||||||
|
|
||||||
if (RunningSomething)
|
if (RunningSomething)
|
||||||
|
Loading…
Reference in New Issue
Block a user