gameEngine/gameEngine/Scene.cpp
//event called every time a key is pressed, check for exit, update KeyHandler singleton keys.
event called every time a key is pressed, check for exit, update KeyHandler singleton keys.
event called every time a key is pressed check for exit update KeyHandler singleton keys .
void key_callback(GLFWwindow* window, int key, int scancode, int action, int mode)
{
	if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
		glfwSetWindowShouldClose(window, GL_TRUE);
	if (key >= 0 && key < 1024)
	{
		if (action == GLFW_PRESS)
			KeyHandler::getInstance()->Keys[key] = GL_TRUE;
		else if (action == GLFW_RELEASE)
			KeyHandler::getInstance()->Keys[key] = GL_FALSE;
	}
}
void key_callback ( GLFWwindow * window , int key , int scancode , int action , int mode ) { if ( key == GLFW_KEY_ESCAPE && action == GLFW_PRESS ) glfwSetWindowShouldClose ( window , GL_TRUE ) ; if ( key >= 0 && key < 1024 ) { if ( action == GLFW_PRESS ) KeyHandler :: getInstance ( ) -> Keys [ key ] = GL_TRUE ; else if ( action == GLFW_RELEASE ) KeyHandler :: getInstance ( ) -> Keys [ key ] = GL_FALSE ; } }
event called every time a key is pressed, check for exit, update KeyHandler singleton keys.
event called every time a key is pressed check for exit update KeyHandler singleton keys .
// When a user presses the escape key, we set the WindowShouldClose property to true, closing the application