mirror of https://github.com/buggins/dlangui.git
fix opengl support under win32
This commit is contained in:
parent
9fdf63963f
commit
78c5408dcf
|
@ -216,20 +216,17 @@ class Win32Window : Window {
|
||||||
|
|
||||||
if (!DERELICT_GL3_RELOADED) {
|
if (!DERELICT_GL3_RELOADED) {
|
||||||
// run this code only once
|
// 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;
|
DERELICT_GL3_RELOADED = true;
|
||||||
try {
|
try {
|
||||||
import derelict.opengl3.gl3;
|
import derelict.opengl3.gl3;
|
||||||
DerelictGL3.reload();
|
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
|
// successful
|
||||||
Log.v("initializing shaders");
|
Log.v("initializing shaders");
|
||||||
if (glSupport.valid || glSupport.initShaders()) {
|
if (glSupport.valid || glSupport.initShaders()) {
|
||||||
|
@ -309,6 +306,7 @@ class Win32Window : Window {
|
||||||
buf.afterDrawing();
|
buf.afterDrawing();
|
||||||
SwapBuffers(hdc);
|
SwapBuffers(hdc);
|
||||||
wglMakeCurrent(hdc, null);
|
wglMakeCurrent(hdc, null);
|
||||||
|
destroy(buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -999,6 +997,8 @@ int myWinMain(void* hInstance, void* hPrevInstance, char* lpCmdLine, int iCmdSho
|
||||||
static if (ENABLE_OPENGL) {
|
static if (ENABLE_OPENGL) {
|
||||||
try {
|
try {
|
||||||
import derelict.opengl3.gl3;
|
import derelict.opengl3.gl3;
|
||||||
|
import derelict.opengl3.gl;
|
||||||
|
DerelictGL.load();
|
||||||
DerelictGL3.load();
|
DerelictGL3.load();
|
||||||
//
|
//
|
||||||
//// just to check OpenGL context
|
//// just to check OpenGL context
|
||||||
|
|
Loading…
Reference in New Issue