I created openGL application in Visual Studio 2017 with newest Projucer. Is similar to example JUCE/OpenGLDemo. Unfortunately when I setVisible on false and again on true there is exception in method:
static void checkGLError (const char* file, const int line)
{
for (;
{
const GLenum e = glGetError();
if (e == GL_NO_ERROR)
break;
// if the peer is not valid then ignore errors
if (! checkPeerIsValid (OpenGLContext::getCurrentContext()))
continue;
DBG ("***** " << getGLErrorMessage (e) << " at " << file << " : " << line);
jassertfalse;
}
}
Message:
***** GL_INVALID_VALUE at d:\juce\modules\juce_opengl\opengl/juce_OpenGLContext.cpp : 244
// when I want to show this window
void show()
{
setVisible(true);
filtersContentComponent.initOpenGL();
}
So at first time when I click on button and call method show() everything is great, but when I closs window and click again button to show() I have exception.