From 06f1ed38e696eac7985079dfd706dc3d9b09c10a Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Thu, 9 Sep 2010 01:56:05 +0200 Subject: [PATCH] Removed auto-polling. --- examples/splitview.c | 3 --- include/GL/glfw.h | 1 - lib/carbon/platform.h | 1 - lib/cocoa/platform.h | 1 - lib/enable.c | 25 ------------------------- lib/win32/platform.h | 1 - lib/window.c | 11 +++-------- lib/x11/platform.h | 1 - tests/peter.c | 1 - 9 files changed, 3 insertions(+), 42 deletions(-) diff --git a/examples/splitview.c b/examples/splitview.c index a26cd2c5..0c53672d 100644 --- a/examples/splitview.c +++ b/examples/splitview.c @@ -475,9 +475,6 @@ int main( void ) // Enable mouse cursor (only needed for fullscreen mode) glfwEnable( GLFW_MOUSE_CURSOR ); - // Disable automatic event polling - glfwDisable( GLFW_AUTO_POLL_EVENTS ); - // Set callback functions glfwSetWindowSizeCallback( windowSizeFun ); glfwSetWindowRefreshCallback( windowRefreshFun ); diff --git a/include/GL/glfw.h b/include/GL/glfw.h index 78f20386..ca72988e 100644 --- a/include/GL/glfw.h +++ b/include/GL/glfw.h @@ -345,7 +345,6 @@ extern "C" { #define GLFW_STICKY_MOUSE_BUTTONS 0x00030003 #define GLFW_SYSTEM_KEYS 0x00030004 #define GLFW_KEY_REPEAT 0x00030005 -#define GLFW_AUTO_POLL_EVENTS 0x00030006 /* glfwGetJoystickParam tokens */ #define GLFW_PRESENT 0x00050001 diff --git a/lib/carbon/platform.h b/lib/carbon/platform.h index 389c6f04..3bfe339c 100644 --- a/lib/carbon/platform.h +++ b/lib/carbon/platform.h @@ -149,7 +149,6 @@ struct _GLFWwin_struct { // User selected window settings int fullscreen; // Fullscreen flag int mouseLock; // Mouse-lock flag - int autoPollEvents; // Auto polling flag int sysKeysDisabled; // System keys disabled flag int windowNoResize; // Resize- and maximize gadgets disabled flag int refreshRate; // Vertical monitor refresh rate diff --git a/lib/cocoa/platform.h b/lib/cocoa/platform.h index b8571b7a..9b445aa4 100644 --- a/lib/cocoa/platform.h +++ b/lib/cocoa/platform.h @@ -81,7 +81,6 @@ struct _GLFWwin_struct { // User selected window settings int fullscreen; // Fullscreen flag int mouseLock; // Mouse-lock flag - int autoPollEvents; // Auto polling flag int sysKeysDisabled; // System keys disabled flag int windowNoResize; // Resize- and maximize gadgets disabled flag int refreshRate; // Vertical monitor refresh rate diff --git a/lib/enable.c b/lib/enable.c index 0f278272..f8a3d0bf 100644 --- a/lib/enable.c +++ b/lib/enable.c @@ -197,25 +197,6 @@ static void disableKeyRepeat(void) } -//======================================================================== -// Enable automatic event polling -//======================================================================== - -static void enableAutoPollEvents(void) -{ - _glfwWin.autoPollEvents = 1; -} - -//======================================================================== -// Disable automatic event polling -//======================================================================== - -static void disableAutoPollEvents(void) -{ - _glfwWin.autoPollEvents = 0; -} - - //************************************************************************ //**** GLFW user functions **** //************************************************************************ @@ -246,9 +227,6 @@ GLFWAPI void glfwEnable(int token) case GLFW_KEY_REPEAT: enableKeyRepeat(); break; - case GLFW_AUTO_POLL_EVENTS: - enableAutoPollEvents(); - break; default: break; } @@ -281,9 +259,6 @@ GLFWAPI void glfwDisable(int token) case GLFW_KEY_REPEAT: disableKeyRepeat(); break; - case GLFW_AUTO_POLL_EVENTS: - disableAutoPollEvents(); - break; default: break; } diff --git a/lib/win32/platform.h b/lib/win32/platform.h index 682de181..a1d4f940 100644 --- a/lib/win32/platform.h +++ b/lib/win32/platform.h @@ -293,7 +293,6 @@ struct _GLFWwin_struct { // User selected window settings int fullscreen; // Fullscreen flag int mouseLock; // Mouse-lock flag - int autoPollEvents; // Auto polling flag int sysKeysDisabled; // System keys disabled flag int windowNoResize; // Resize- and maximize gadgets disabled flag int refreshRate; // Vertical monitor refresh rate diff --git a/lib/window.c b/lib/window.c index cce7826c..cd0f44d6 100644 --- a/lib/window.c +++ b/lib/window.c @@ -470,10 +470,9 @@ GLFWAPI int glfwOpenWindow(int width, int height, return GL_FALSE; // Clear GLFW window state - _glfwWin.active = GL_TRUE; - _glfwWin.iconified = GL_FALSE; - _glfwWin.mouseLock = GL_FALSE; - _glfwWin.autoPollEvents = GL_TRUE; + _glfwWin.active = GL_TRUE; + _glfwWin.iconified = GL_FALSE; + _glfwWin.mouseLock = GL_FALSE; _glfwClearInput(); // Unregister all callback functions @@ -742,10 +741,6 @@ GLFWAPI void glfwSwapBuffers(void) // Update display-buffer if (_glfwWin.opened) _glfwPlatformSwapBuffers(); - - // Check for window messages - if (_glfwWin.autoPollEvents) - glfwPollEvents(); } diff --git a/lib/x11/platform.h b/lib/x11/platform.h index ac2241f8..1d82d18f 100644 --- a/lib/x11/platform.h +++ b/lib/x11/platform.h @@ -188,7 +188,6 @@ struct _GLFWwin_struct { // User selected window settings int fullscreen; // Fullscreen flag int mouseLock; // Mouse-lock flag - int autoPollEvents; // Auto polling flag int sysKeysDisabled; // System keys disabled flag int windowNoResize; // Resize- and maximize gadgets disabled flag int refreshRate; // Vertical monitor refresh rate diff --git a/tests/peter.c b/tests/peter.c index c30cf5d2..0cc34de3 100644 --- a/tests/peter.c +++ b/tests/peter.c @@ -96,7 +96,6 @@ static GLboolean open_window(void) glfwGetMousePos(&x, &y); printf("Mouse position: %i %i\n", x, y); - glfwDisable(GLFW_AUTO_POLL_EVENTS); glfwSetWindowSizeCallback(window_size_callback); glfwSetMousePosCallback(mouse_position_callback); glfwSetKeyCallback(key_callback);