fix OpenGL support on Win32 backend

This commit is contained in:
Vadim Lopatin 2015-03-18 09:30:12 +03:00
parent 903fafc590
commit 2155d8418b
2 changed files with 7 additions and 4 deletions

View File

@ -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;
} }
} }

View File

@ -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);
} }
} }