mirror of https://github.com/buggins/dlangui.git
GL_INVALID_OPERATION quickfix
This commit is contained in:
parent
b07a6d54a7
commit
3d4bf61bb8
|
@ -651,6 +651,8 @@ private __gshared GLSupport _glSupport;
|
||||||
return _glSupport;
|
return _glSupport;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__gshared bool glNoContext;
|
||||||
|
|
||||||
/// initialize OpenGL support helper (call when current OpenGL context is initialized)
|
/// initialize OpenGL support helper (call when current OpenGL context is initialized)
|
||||||
bool initGLSupport(bool legacy = false) {
|
bool initGLSupport(bool legacy = false) {
|
||||||
import dlangui.platforms.common.platform : setOpenglEnabled;
|
import dlangui.platforms.common.platform : setOpenglEnabled;
|
||||||
|
@ -1125,9 +1127,11 @@ class GLObject(GLObjectTypes type, GLuint target = 0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
~this() {
|
~this() {
|
||||||
|
if (!glNoContext) {
|
||||||
unbind();
|
unbind();
|
||||||
mixin("checkgl!glDelete" ~ to!string(type) ~ "s(1, &ID);");
|
mixin("checkgl!glDelete" ~ to!string(type) ~ "s(1, &ID);");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void bind() {
|
void bind() {
|
||||||
static if(target != 0)
|
static if(target != 0)
|
||||||
|
|
|
@ -1595,6 +1595,8 @@ int sdlmain(string[] args) {
|
||||||
|
|
||||||
Log.d("Destroying SDL platform");
|
Log.d("Destroying SDL platform");
|
||||||
Platform.setInstance(null);
|
Platform.setInstance(null);
|
||||||
|
static if (ENABLE_OPENGL)
|
||||||
|
glNoContext = true;
|
||||||
|
|
||||||
releaseResourcesOnAppExit();
|
releaseResourcesOnAppExit();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue