mirror of https://github.com/buggins/dlangui.git
fix OpenGL support on Win32 backend
This commit is contained in:
parent
903fafc590
commit
2155d8418b
|
@ -1341,9 +1341,12 @@ version (USE_OPENGL) {
|
||||||
/// check if hardware acceleration is enabled
|
/// check if hardware acceleration is enabled
|
||||||
@property bool openglEnabled() { return _OPENGL_ENABLED; }
|
@property bool openglEnabled() { return _OPENGL_ENABLED; }
|
||||||
/// call on app initialization if OpenGL support is detected
|
/// call on app initialization if OpenGL support is detected
|
||||||
void setOpenglEnabled() {
|
void setOpenglEnabled(bool enabled = true) {
|
||||||
_OPENGL_ENABLED = true;
|
_OPENGL_ENABLED = enabled;
|
||||||
|
if (enabled)
|
||||||
glyphDestroyCallback = &onGlyphDestroyedCallback;
|
glyphDestroyCallback = &onGlyphDestroyedCallback;
|
||||||
|
else
|
||||||
|
glyphDestroyCallback = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1036,7 +1036,7 @@ int myWinMain(void* hInstance, void* hPrevInstance, char* lpCmdLine, int iCmdSho
|
||||||
platform.enterMessageLoop();
|
platform.enterMessageLoop();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e("Exception while trying to init OpenGL", e);
|
Log.e("Exception while trying to init OpenGL", e);
|
||||||
openglEnabled = false;
|
setOpenglEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue