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
|
||||
@property bool openglEnabled() { return _OPENGL_ENABLED; }
|
||||
/// call on app initialization if OpenGL support is detected
|
||||
void setOpenglEnabled() {
|
||||
_OPENGL_ENABLED = true;
|
||||
glyphDestroyCallback = &onGlyphDestroyedCallback;
|
||||
void setOpenglEnabled(bool enabled = true) {
|
||||
_OPENGL_ENABLED = enabled;
|
||||
if (enabled)
|
||||
glyphDestroyCallback = &onGlyphDestroyedCallback;
|
||||
else
|
||||
glyphDestroyCallback = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1036,7 +1036,7 @@ int myWinMain(void* hInstance, void* hPrevInstance, char* lpCmdLine, int iCmdSho
|
|||
platform.enterMessageLoop();
|
||||
} catch (Exception e) {
|
||||
Log.e("Exception while trying to init OpenGL", e);
|
||||
openglEnabled = false;
|
||||
setOpenglEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue