Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Input and/or mainloop issue

  1. #1
    Newbie Newbie
    Join Date
    Aug 2013
    Posts
    2

    Input and/or mainloop issue

    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.

    Code :
    while(true)
    {		
    	if(application.Update() == false)
    	{
    		break;
    	}
     
    	glfwSwapBuffers(window);
     
    	if(glfwGetKey(window,GLFW_KEY_ESCAPE) == GLFW_PRESS)
    	{
    		return 0;
    	}
    }

  2. #2
    Newbie Newbie
    Join Date
    Aug 2013
    Posts
    2
    I solved the issue, forgot glfwPollEvents();

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •