fix opengl support under win32

This commit is contained in:
Vadim Lopatin 2015-12-03 14:47:45 +03:00
parent 9fdf63963f
commit 78c5408dcf
1 changed files with 9 additions and 9 deletions

View File

@ -216,20 +216,17 @@ class Win32Window : Window {
if (!DERELICT_GL3_RELOADED) {
// run this code only once
if (!_glSupport) {
Log.v("Creating OpenGL support");
_glSupport = new GLSupport(true);
Log.v("OpenGL support created");
}
DERELICT_GL3_RELOADED = true;
try {
import derelict.opengl3.gl3;
DerelictGL3.reload();
static if (ENABLE_OPENGL) {
//_gl = new GLSupport();
if (!_glSupport) {
Log.v("Creating OpenGL support");
_glSupport = new GLSupport(true);
Log.v("OpenGL support created");
}
}
// successful
Log.v("initializing shaders");
if (glSupport.valid || glSupport.initShaders()) {
@ -309,6 +306,7 @@ class Win32Window : Window {
buf.afterDrawing();
SwapBuffers(hdc);
wglMakeCurrent(hdc, null);
destroy(buf);
}
}
@ -999,6 +997,8 @@ int myWinMain(void* hInstance, void* hPrevInstance, char* lpCmdLine, int iCmdSho
static if (ENABLE_OPENGL) {
try {
import derelict.opengl3.gl3;
import derelict.opengl3.gl;
DerelictGL.load();
DerelictGL3.load();
//
//// just to check OpenGL context