Commit 6e42a8e1 authored by Philip Trettner's avatar Philip Trettner

made OGL context more robust

parent c9a9249b
......@@ -461,8 +461,16 @@ void GlfwApp::endRender()
{
// draw the tweak bar(s)
if (mDrawTweakbars)
{
TwDraw();
// unbind TweakBar stuff
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, 0);
glUseProgram(0);
glBindVertexArray(0);
}
// Swap front and back buffers
glfwSwapBuffers(mWindow);
}
......@@ -568,6 +576,9 @@ int GlfwApp::run(int argc, char *argv[])
TwWindowSize(mWindowWidth, mWindowHeight);
mTweakbar = TwNewBar("Tweakbar");
// unbind any ogl object (especially from AntTweakBar)
glow::unbindOpenGLObjects();
// input callbacks
{
glfwSetKeyCallback(mWindow, [](GLFWwindow *win, int key, int scancode, int action, int mods) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment