mirror of
https://github.com/glfw/glfw.git
synced 2026-11-18 12:54:54 +00:00
Removed glfwIsWindow.
This commit is contained in:
+14
-2
@@ -10,6 +10,14 @@
|
||||
#define GLFW_INCLUDE_GLU
|
||||
#include <GL/glfw3.h>
|
||||
|
||||
static GLboolean running = GL_TRUE;
|
||||
|
||||
static int window_close_callback(GLFWwindow window)
|
||||
{
|
||||
running = GL_FALSE;
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int width, height, x;
|
||||
@@ -36,6 +44,8 @@ int main(void)
|
||||
// Enable vertical sync (on cards that support it)
|
||||
glfwSwapInterval(1);
|
||||
|
||||
glfwSetWindowCloseCallback(window_close_callback);
|
||||
|
||||
do
|
||||
{
|
||||
double t = glfwGetTime();
|
||||
@@ -82,9 +92,11 @@ int main(void)
|
||||
glfwSwapBuffers();
|
||||
glfwPollEvents();
|
||||
|
||||
if (glfwGetKey(window, GLFW_KEY_ESCAPE))
|
||||
running = GL_FALSE;
|
||||
|
||||
} // Check if the ESC key was pressed or the window was closed
|
||||
while (glfwIsWindow(window) &&
|
||||
glfwGetKey(window, GLFW_KEY_ESCAPE) != GLFW_PRESS);
|
||||
while (running);
|
||||
|
||||
// Close OpenGL window and terminate GLFW
|
||||
glfwTerminate();
|
||||
|
||||
Reference in New Issue
Block a user