Answer the question
In order to leave comments, you need to log in
Why does the window immediately close?
I'm trying to program in OpenGL. got into a dead end. The window closes immediately. here is the code that at least somehow touches openGL:
void Render::RenderFrame()
{
if (!glfwWindowShouldClose(pWindow))
{
isClosed = true;
glfwTerminate();
return;
}
glClearColor(1, 1, 0, 1);
glClear(GL_COLOR_BUFFER_BIT);
glfwSwapBuffers(pWindow);
glfwPollEvents();
}
void Engine::Start()
{
Logger::GetInstance().PrintMsg("engine is started");
while (!render->WindowIsClosed())
{
render->RenderFrame();
}
}
Answer the question
In order to leave comments, you need to log in
if (!glfwWindowShouldClose(pWindow))
{
isClosed = true;
glfwTerminate();
return;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question