|
From: <sp...@us...> - 2010-04-03 19:03:55
|
Revision: 3308
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3308&view=rev
Author: spasi
Date: 2010-04-03 19:03:49 +0000 (Sat, 03 Apr 2010)
Log Message:
-----------
Moved processMessages call after swapBuffers in Display.update.
Added option to not call processMessages during Display.update.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2010-04-03 13:32:35 UTC (rev 3307)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2010-04-03 19:03:49 UTC (rev 3308)
@@ -116,7 +116,7 @@
private static boolean window_created = false;
private static boolean parent_resized;
-
+
/** Initial Background Color of Display */
private static float r = 0, g = 0, b = 0;
@@ -648,17 +648,27 @@
}
/**
- * Update the window. This calls processMessages(), and if the window is visible
- * clears the dirty flag and calls swapBuffers() and finally polls the input devices.
+ * Update the window. If the window is visible clears
+ * the dirty flag and calls swapBuffers() and finally
+ * polls the input devices.
*
- * @throws OpenGLException if an OpenGL error has occured since the last call to GL11.glGetError()
*/
public static void update() {
+ update(true);
+ }
+
+ /**
+ * Update the window. If the window is visible clears
+ * the dirty flag and calls swapBuffers() and finally
+ * polls the input devices if processMessages is true.
+ *
+ * @param processMessages Poll input devices if true
+ */
+ public static void update(boolean processMessages) {
synchronized ( GlobalLock.lock ) {
if ( !isCreated() )
throw new IllegalStateException("Display not created");
- processMessages();
// We paint only when the window is visible or dirty
if ( display_impl.isVisible() || display_impl.isDirty() ) {
try {
@@ -667,13 +677,14 @@
throw new RuntimeException(e);
}
}
- if ( swap_interval != 0 ) // Handle events again when vsync is enabled, to reduced input lag.
- processMessages();
if ( parent_resized ) {
reshape();
parent_resized = false;
}
+
+ if ( processMessages )
+ processMessages();
}
}
@@ -866,11 +877,11 @@
}
}
}
-
+
/**
* Set the initial color of the Display. This method is called before the Display is created and will set the
* background color to the one specified in this method.
- *
+ *
* @param red - color value between 0 - 1
* @param green - color value between 0 - 1
* @param blue - color value between 0 - 1
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|