PDA

View Full Version : Input and/or mainloop issue



FourthPlanet
08-06-2013, 05:12 AM
Hi, I've reasonably started to learn OpenGL, and I've run into some problems.
I'm using glew,glfw. And the problem is that I can't get the input to work.

glfwGetKey(window,GLFW_KEY_ESCAPE) never returns GLFW_PRESS but i think that the problem lies somewhere else in my update loop.
When running the program my cursor is a "waiting-cursor" all the time, which may explain why glfw wont take any input.



while(true)
{
if(application.Update() == false)
{
break;
}

glfwSwapBuffers(window);

if(glfwGetKey(window,GLFW_KEY_ESCAPE) == GLFW_PRESS)
{
return 0;
}
}

FourthPlanet
08-06-2013, 05:30 AM
I solved the issue, forgot glfwPollEvents();