You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(134) |
Sep
(52) |
Oct
(13) |
Nov
(342) |
Dec
(163) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(44) |
Feb
(62) |
Mar
(158) |
Apr
(38) |
May
(70) |
Jun
(58) |
Jul
(104) |
Aug
(207) |
Sep
(83) |
Oct
(122) |
Nov
(23) |
Dec
(49) |
| 2004 |
Jan
(119) |
Feb
(132) |
Mar
(192) |
Apr
(140) |
May
(77) |
Jun
(74) |
Jul
(201) |
Aug
(63) |
Sep
(102) |
Oct
(70) |
Nov
(173) |
Dec
(78) |
| 2005 |
Jan
(174) |
Feb
(197) |
Mar
(105) |
Apr
(59) |
May
(77) |
Jun
(43) |
Jul
(21) |
Aug
(18) |
Sep
(47) |
Oct
(37) |
Nov
(74) |
Dec
(50) |
| 2006 |
Jan
(44) |
Feb
(19) |
Mar
(32) |
Apr
(24) |
May
(31) |
Jun
(55) |
Jul
(138) |
Aug
(28) |
Sep
(12) |
Oct
(41) |
Nov
(58) |
Dec
(24) |
| 2007 |
Jan
(28) |
Feb
(14) |
Mar
(10) |
Apr
(68) |
May
(30) |
Jun
(26) |
Jul
(18) |
Aug
(63) |
Sep
(19) |
Oct
(29) |
Nov
(20) |
Dec
(10) |
| 2008 |
Jan
(38) |
Feb
(7) |
Mar
(37) |
Apr
(120) |
May
(41) |
Jun
(36) |
Jul
(39) |
Aug
(24) |
Sep
(28) |
Oct
(30) |
Nov
(36) |
Dec
(75) |
| 2009 |
Jan
(46) |
Feb
(22) |
Mar
(50) |
Apr
(70) |
May
(134) |
Jun
(105) |
Jul
(75) |
Aug
(34) |
Sep
(38) |
Oct
(34) |
Nov
(19) |
Dec
(20) |
| 2010 |
Jan
(11) |
Feb
(20) |
Mar
(65) |
Apr
(83) |
May
(104) |
Jun
(73) |
Jul
(78) |
Aug
(57) |
Sep
(43) |
Oct
(35) |
Nov
(9) |
Dec
(4) |
| 2011 |
Jan
(21) |
Feb
(11) |
Mar
(18) |
Apr
(10) |
May
(18) |
Jun
(15) |
Jul
(48) |
Aug
(25) |
Sep
(17) |
Oct
(45) |
Nov
(15) |
Dec
(12) |
| 2012 |
Jan
(21) |
Feb
(9) |
Mar
(12) |
Apr
(9) |
May
(9) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
(12) |
Oct
(1) |
Nov
(28) |
Dec
(5) |
| 2013 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
1
(1) |
2
|
3
|
|
4
(4) |
5
|
6
|
7
|
8
|
9
|
10
|
|
11
|
12
|
13
|
14
|
15
|
16
|
17
|
|
18
(1) |
19
(1) |
20
|
21
(1) |
22
|
23
|
24
(3) |
|
25
|
26
|
27
(1) |
28
|
29
|
30
|
31
|
|
From: <sp...@us...> - 2012-03-27 13:12:36
|
Revision: 3758
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3758&view=rev
Author: spasi
Date: 2012-03-27 13:12:30 +0000 (Tue, 27 Mar 2012)
Log Message:
-----------
Added support for: AMD_vertex_shader_viewport_index, AMD_vertex_shader_layer, NV_bindless_texture, NV_shader_atomic_float.
Added Paths:
-----------
trunk/LWJGL/src/templates/org/lwjgl/opengl/AMD_vertex_shader_layer.java
trunk/LWJGL/src/templates/org/lwjgl/opengl/AMD_vertex_shader_viewport_index.java
trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_bindless_texture.java
trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_shader_atomic_float.java
Added: trunk/LWJGL/src/templates/org/lwjgl/opengl/AMD_vertex_shader_layer.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/AMD_vertex_shader_layer.java (rev 0)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/AMD_vertex_shader_layer.java 2012-03-27 13:12:30 UTC (rev 3758)
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2002-2012 LWJGL Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'LWJGL' nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.lwjgl.opengl;
+
+public interface AMD_vertex_shader_layer {
+}
\ No newline at end of file
Added: trunk/LWJGL/src/templates/org/lwjgl/opengl/AMD_vertex_shader_viewport_index.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/AMD_vertex_shader_viewport_index.java (rev 0)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/AMD_vertex_shader_viewport_index.java 2012-03-27 13:12:30 UTC (rev 3758)
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2002-2012 LWJGL Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'LWJGL' nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.lwjgl.opengl;
+
+public interface AMD_vertex_shader_viewport_index {
+}
\ No newline at end of file
Added: trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_bindless_texture.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_bindless_texture.java (rev 0)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_bindless_texture.java 2012-03-27 13:12:30 UTC (rev 3758)
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2002-2012 LWJGL Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'LWJGL' nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.util.generator.AutoSize;
+import org.lwjgl.util.generator.Const;
+import org.lwjgl.util.generator.StripPostfix;
+import org.lwjgl.util.generator.opengl.GLenum;
+import org.lwjgl.util.generator.opengl.GLsizei;
+import org.lwjgl.util.generator.opengl.GLuint;
+import org.lwjgl.util.generator.opengl.GLuint64;
+
+import java.nio.LongBuffer;
+
+public interface NV_bindless_texture {
+
+ @GLuint64
+ long glGetTextureHandleNV(@GLuint int texture);
+
+ @GLuint64
+ long glGetTextureSamplerHandleNV(@GLuint int texture, @GLuint int sampler);
+
+ void glMakeTextureHandleResidentNV(@GLuint64 long handle);
+
+ void glMakeTextureHandleNonResidentNV(@GLuint64 long handle);
+
+ @GLuint64
+ long glGetImageHandleNV(@GLuint int texture, int level, boolean layered,
+ int layer, @GLenum int format);
+
+ void glMakeImageHandleResidentNV(@GLuint64 long handle, @GLenum int access);
+
+ void glMakeImageHandleNonResidentNV(@GLuint64 long handle);
+
+ void glUniformHandleui64NV(int location, @GLuint64 long value);
+
+ @StripPostfix("value")
+ void glUniformHandleui64vNV(int location, @AutoSize("value") @GLsizei int count, @Const @GLuint64 LongBuffer value);
+
+ void glProgramUniformHandleui64NV(@GLuint int program, int location,
+ @GLuint64 long value);
+
+ @StripPostfix("values")
+ void glProgramUniformHandleui64vNV(@GLuint int program, int location,
+ @AutoSize("values") @GLsizei int count, @Const @GLuint64 LongBuffer values);
+
+ boolean glIsTextureHandleResidentNV(@GLuint64 long handle);
+
+ boolean glIsImageHandleResidentNV(@GLuint64 long handle);
+
+}
\ No newline at end of file
Added: trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_shader_atomic_float.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_shader_atomic_float.java (rev 0)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_shader_atomic_float.java 2012-03-27 13:12:30 UTC (rev 3758)
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2002-2012 LWJGL Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'LWJGL' nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.lwjgl.opengl;
+
+public interface NV_shader_atomic_float {
+
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2012-03-24 00:39:12
|
Revision: 3757
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3757&view=rev
Author: kappa1
Date: 2012-03-24 00:39:05 +0000 (Sat, 24 Mar 2012)
Log Message:
-----------
remove non-existing import.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/opengl/Sync.java
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/Sync.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/Sync.java 2012-03-24 00:20:02 UTC (rev 3756)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/Sync.java 2012-03-24 00:39:05 UTC (rev 3757)
@@ -32,7 +32,6 @@
package org.lwjgl.opengl;
import org.lwjgl.Sys;
-import org.ninjacave.framework.Sync.RunningAvg;
/**
* A highly accurate sync method that continually adapts to the system
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2012-03-24 00:20:09
|
Revision: 3756
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3756&view=rev
Author: kappa1
Date: 2012-03-24 00:20:02 +0000 (Sat, 24 Mar 2012)
Log Message:
-----------
fix minor javadoc typo's
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java
trunk/LWJGL/src/java/org/lwjgl/opengl/Sync.java
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2012-03-24 00:04:52 UTC (rev 3755)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2012-03-24 00:20:02 UTC (rev 3756)
@@ -399,9 +399,7 @@
}
/**
- * An accurate sync method that will attempt to run an application loop
- * at a constant frame rate.
- *
+ * An accurate sync method that will attempt to run at a constant frame rate.
* It should be called once every frame.
*
* @param fps - the desired frame rate, in frames per second
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/Sync.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/Sync.java 2012-03-24 00:04:52 UTC (rev 3755)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/Sync.java 2012-03-24 00:20:02 UTC (rev 3756)
@@ -32,6 +32,7 @@
package org.lwjgl.opengl;
import org.lwjgl.Sys;
+import org.ninjacave.framework.Sync.RunningAvg;
/**
* A highly accurate sync method that continually adapts to the system
@@ -51,15 +52,13 @@
/** whether the initialisation code has run */
private static boolean initialised = false;
- /** stored results of how long sleep/yields took to calculate averages */
+ /** for calculating the averages the previous sleep/yield times are stored */
private static RunningAvg sleepDurations = new RunningAvg(10);
private static RunningAvg yieldDurations = new RunningAvg(10);
/**
- * An accurate sync method that will attempt to run an application loop
- * at a constant frame rate.
- *
+ * An accurate sync method that will attempt to run at a constant frame rate.
* It should be called once every frame.
*
* @param fps - the desired frame rate, in frames per second
@@ -75,7 +74,7 @@
sleepDurations.add((t1 = getTime()) - t0); // update average sleep time
}
- // slowly dampen sleep average if too high to avoid over yielding
+ // slowly dampen sleep average if too high to avoid yielding too much
sleepDurations.dampenForLowResTicker();
// yield until the average yield time is greater than the time remaining till nextFrame
@@ -93,9 +92,9 @@
/**
* This method will initialise the sync method by setting initial
- * values for sleepDurations/yieldDurations and nextFrame variables.
+ * values for sleepDurations/yieldDurations and nextFrame.
*
- * If running windows on windows it will start the sleep timer fix.
+ * If running on windows it will start the sleep timer fix.
*/
private static void initialise() {
initialised = true;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2012-03-24 00:05:05
|
Revision: 3755
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3755&view=rev
Author: kappa1
Date: 2012-03-24 00:04:52 +0000 (Sat, 24 Mar 2012)
Log Message:
-----------
Replace Display.sync(int fps) with an even better implementation, special thanks to Riven.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java
Added Paths:
-----------
trunk/LWJGL/src/java/org/lwjgl/opengl/Sync.java
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2012-03-21 19:34:51 UTC (rev 3754)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2012-03-24 00:04:52 UTC (rev 3755)
@@ -79,18 +79,6 @@
/** The current display mode, if created */
private static DisplayMode current_mode;
- /** time at last sync() */
- private static long lastTime;
-
- /** Whether the sync() method has been initiated */
- private static boolean syncInitiated;
-
- /** whether to disable adaptive yield time in sync() method */
- private static boolean adaptiveTimeDisabled;
-
- /** adaptive time to yield instead of sleeping in sync()*/
- private static long adaptiveYieldTime;
-
/** X coordinate of the window */
private static int x = -1;
@@ -411,98 +399,16 @@
}
/**
- * An accurate sync method that adapts automatically
- * to the system it runs on to provide reliable results.
+ * An accurate sync method that will attempt to run an application loop
+ * at a constant frame rate.
*
- * @param fps The desired frame rate, in frames per second
+ * It should be called once every frame.
+ *
+ * @param fps - the desired frame rate, in frames per second
*/
public static void sync(int fps) {
- if (fps <= 0) return;
- if (!syncInitiated) initiateSyncTimer();
-
- long sleepTime = 1000000000 / fps; // nanoseconds to sleep this frame
- // adaptiveYieldTime + remainder micro & nano seconds if smaller than sleepTime
- long yieldTime = adaptiveTimeDisabled ? 0 : Math.min(sleepTime, adaptiveYieldTime + sleepTime % (1000*1000));
- long overSleep = 0; // time the sync goes over by
-
- try {
- while (true) {
- long t = getTime() - lastTime;
-
- if (t < sleepTime - yieldTime) {
- Thread.sleep(1);
- }
- else if (t < sleepTime) {
- // burn the last few CPU cycles to ensure accuracy
- Thread.yield();
- }
- else {
- overSleep = t - sleepTime;
- break; // exit while loop
- }
- }
- } catch (InterruptedException e) {}
-
- lastTime = getTime() - Math.min(overSleep, sleepTime);
-
- if (!adaptiveTimeDisabled) {
- // auto tune the amount of time to yield
- if (overSleep > adaptiveYieldTime) {
- // increase by 200 microseconds (1/5 a ms)
- adaptiveYieldTime = Math.min(adaptiveYieldTime + 200*1000, sleepTime);
- }
- else if (overSleep < adaptiveYieldTime - 2*1000*1000) {
- // fast decrease by 50 microseconds for large under sleeps
- adaptiveYieldTime = Math.max(adaptiveYieldTime - 50*1000, 0);
- }
- else if (overSleep < adaptiveYieldTime - 200*1000) {
- // slower but finer decrease by 2 microseconds
- adaptiveYieldTime = Math.max(adaptiveYieldTime - 2*1000, 0);
- }
- }
+ Sync.sync(fps);
}
-
- /**
- * Get System Nano Time
- * @return will return the current time in nano's
- */
- private static long getTime() {
- return (Sys.getTime() * 1000000000) / Sys.getTimerResolution();
- }
-
- /**
- * Initialise the sync(fps) method.
- */
- private static void initiateSyncTimer() {
- syncInitiated = true;
- lastTime = getTime();
-
- String osName = System.getProperty("os.name");
-
- if (osName.startsWith("Mac") || osName.startsWith("Darwin")) {
- // disabled on mac as it uses too much cpu, besides
- // Thread.sleep is pretty accurate on mac by default
- adaptiveTimeDisabled = true;
- return;
- }
-
- if (osName.startsWith("Win")) {
- // On windows the sleep functions can be highly inaccurate by
- // over 10ms making in unusable. However it can be forced to
- // be a bit more accurate by running a separate sleeping daemon
- // thread.
- Thread timerAccuracyThread = new Thread(new Runnable() {
- public void run() {
- try {
- Thread.sleep(Long.MAX_VALUE);
- } catch (Exception e) {}
- }
- });
-
- timerAccuracyThread.setDaemon(true);
- timerAccuracyThread.start();
- }
- }
/** @return the title of the window */
public static String getTitle() {
Added: trunk/LWJGL/src/java/org/lwjgl/opengl/Sync.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/Sync.java (rev 0)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/Sync.java 2012-03-24 00:04:52 UTC (rev 3755)
@@ -0,0 +1,176 @@
+/*
+ * Copyright (c) 2002-2012 LWJGL Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'LWJGL' nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.lwjgl.opengl;
+
+import org.lwjgl.Sys;
+
+/**
+* A highly accurate sync method that continually adapts to the system
+* it runs on to provide reliable results.
+*
+* @author Riven
+* @author kappaOne
+*/
+class Sync {
+
+ /** number of nano seconds in a second */
+ private static final long NANOS_IN_SECOND = 1000L * 1000L * 1000L;
+
+ /** The time to sleep/yield until the next frame */
+ private static long nextFrame = 0;
+
+ /** whether the initialisation code has run */
+ private static boolean initialised = false;
+
+ /** stored results of how long sleep/yields took to calculate averages */
+ private static RunningAvg sleepDurations = new RunningAvg(10);
+ private static RunningAvg yieldDurations = new RunningAvg(10);
+
+
+ /**
+ * An accurate sync method that will attempt to run an application loop
+ * at a constant frame rate.
+ *
+ * It should be called once every frame.
+ *
+ * @param fps - the desired frame rate, in frames per second
+ */
+ public static void sync(int fps) {
+ if (fps <= 0) return;
+ if (!initialised) initialise();
+
+ try {
+ // sleep until the average sleep time is greater than the time remaining till nextFrame
+ for (long t0 = getTime(), t1; (nextFrame - t0) > sleepDurations.avg(); t0 = t1) {
+ Thread.sleep(1);
+ sleepDurations.add((t1 = getTime()) - t0); // update average sleep time
+ }
+
+ // slowly dampen sleep average if too high to avoid over yielding
+ sleepDurations.dampenForLowResTicker();
+
+ // yield until the average yield time is greater than the time remaining till nextFrame
+ for (long t0 = getTime(), t1; (nextFrame - t0) > yieldDurations.avg(); t0 = t1) {
+ Thread.yield();
+ yieldDurations.add((t1 = getTime()) - t0); // update average yield time
+ }
+ } catch (InterruptedException e) {
+
+ }
+
+ // schedule next frame, drop frame(s) if already too late for next frame
+ nextFrame = Math.max(nextFrame + NANOS_IN_SECOND / fps, getTime());
+ }
+
+ /**
+ * This method will initialise the sync method by setting initial
+ * values for sleepDurations/yieldDurations and nextFrame variables.
+ *
+ * If running windows on windows it will start the sleep timer fix.
+ */
+ private static void initialise() {
+ initialised = true;
+
+ sleepDurations.init(1000 * 1000);
+ yieldDurations.init((int) (-(getTime() - getTime()) * 1.333));
+
+ nextFrame = getTime();
+
+ String osName = System.getProperty("os.name");
+
+ if (osName.startsWith("Win")) {
+ // On windows the sleep functions can be highly inaccurate by
+ // over 10ms making in unusable. However it can be forced to
+ // be a bit more accurate by running a separate sleeping daemon
+ // thread.
+ Thread timerAccuracyThread = new Thread(new Runnable() {
+ public void run() {
+ try {
+ Thread.sleep(Long.MAX_VALUE);
+ } catch (Exception e) {}
+ }
+ });
+
+ timerAccuracyThread.setDaemon(true);
+ timerAccuracyThread.start();
+ }
+ }
+
+ /**
+ * Get the system time in nano seconds
+ *
+ * @return will return the current time in nano's
+ */
+ private static long getTime() {
+ return (Sys.getTime() * NANOS_IN_SECOND) / Sys.getTimerResolution();
+ }
+
+ private static class RunningAvg {
+ private final long[] slots;
+ private int offset;
+
+ private static final long DAMPEN_THRESHOLD = 10 * 1000L * 1000L; // 10ms
+ private static final float DAMPEN_FACTOR = 0.9f; // don't change: 0.9f is exactly right!
+
+ public RunningAvg(int slotCount) {
+ this.slots = new long[slotCount];
+ this.offset = 0;
+ }
+
+ public void init(long value) {
+ while (this.offset < this.slots.length) {
+ this.slots[this.offset++] = value;
+ }
+ }
+
+ public void add(long value) {
+ this.slots[this.offset++ % this.slots.length] = value;
+ this.offset %= this.slots.length;
+ }
+
+ public long avg() {
+ long sum = 0;
+ for (int i = 0; i < this.slots.length; i++) {
+ sum += this.slots[i];
+ }
+ return sum / this.slots.length;
+ }
+
+ public void dampenForLowResTicker() {
+ if (this.avg() > DAMPEN_THRESHOLD) {
+ for (int i = 0; i < this.slots.length; i++) {
+ this.slots[i] *= DAMPEN_FACTOR;
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2012-03-21 19:35:00
|
Revision: 3754
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3754&view=rev
Author: kappa1
Date: 2012-03-21 19:34:51 +0000 (Wed, 21 Mar 2012)
Log Message:
-----------
Display.sync() fix excessive CPU using on windows
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 2012-03-19 22:12:38 UTC (rev 3753)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2012-03-21 19:34:51 UTC (rev 3754)
@@ -451,8 +451,12 @@
// increase by 200 microseconds (1/5 a ms)
adaptiveYieldTime = Math.min(adaptiveYieldTime + 200*1000, sleepTime);
}
+ else if (overSleep < adaptiveYieldTime - 2*1000*1000) {
+ // fast decrease by 50 microseconds for large under sleeps
+ adaptiveYieldTime = Math.max(adaptiveYieldTime - 50*1000, 0);
+ }
else if (overSleep < adaptiveYieldTime - 200*1000) {
- // decrease by 5 microseconds
+ // slower but finer decrease by 2 microseconds
adaptiveYieldTime = Math.max(adaptiveYieldTime - 2*1000, 0);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2012-03-19 22:12:45
|
Revision: 3753
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3753&view=rev
Author: matzon
Date: 2012-03-19 22:12:38 +0000 (Mon, 19 Mar 2012)
Log Message:
-----------
applying white border fix from dr_evil
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2012-03-18 16:25:23 UTC (rev 3752)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2012-03-19 22:12:38 UTC (rev 3753)
@@ -1058,7 +1058,7 @@
long styleex = getWindowLongPtr(hwnd, GWL_EXSTYLE);
// update frame style
- if(resizable) {
+ if(resizable && !Display.isFullscreen()) {
setWindowLongPtr(hwnd, GWL_STYLE, style |= (WS_THICKFRAME | WS_MAXIMIZEBOX));
} else {
setWindowLongPtr(hwnd, GWL_STYLE, style &= ~(WS_THICKFRAME | WS_MAXIMIZEBOX));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2012-03-18 16:25:29
|
Revision: 3752
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3752&view=rev
Author: kappa1
Date: 2012-03-18 16:25:23 +0000 (Sun, 18 Mar 2012)
Log Message:
-----------
Fix the new accurate Display.sync() method to use less CPU on Mac.
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 2012-03-04 13:41:49 UTC (rev 3751)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2012-03-18 16:25:23 UTC (rev 3752)
@@ -85,6 +85,9 @@
/** Whether the sync() method has been initiated */
private static boolean syncInitiated;
+ /** whether to disable adaptive yield time in sync() method */
+ private static boolean adaptiveTimeDisabled;
+
/** adaptive time to yield instead of sleeping in sync()*/
private static long adaptiveYieldTime;
@@ -419,7 +422,7 @@
long sleepTime = 1000000000 / fps; // nanoseconds to sleep this frame
// adaptiveYieldTime + remainder micro & nano seconds if smaller than sleepTime
- long yieldTime = Math.min(sleepTime, adaptiveYieldTime + sleepTime % (1000*1000));
+ long yieldTime = adaptiveTimeDisabled ? 0 : Math.min(sleepTime, adaptiveYieldTime + sleepTime % (1000*1000));
long overSleep = 0; // time the sync goes over by
try {
@@ -442,15 +445,17 @@
lastTime = getTime() - Math.min(overSleep, sleepTime);
- // auto tune the amount of time to yield
- if (overSleep > adaptiveYieldTime) {
- // increase by 200 microseconds (1/5 a ms)
- adaptiveYieldTime = Math.min(adaptiveYieldTime + 200*1000, sleepTime);
+ if (!adaptiveTimeDisabled) {
+ // auto tune the amount of time to yield
+ if (overSleep > adaptiveYieldTime) {
+ // increase by 200 microseconds (1/5 a ms)
+ adaptiveYieldTime = Math.min(adaptiveYieldTime + 200*1000, sleepTime);
+ }
+ else if (overSleep < adaptiveYieldTime - 200*1000) {
+ // decrease by 5 microseconds
+ adaptiveYieldTime = Math.max(adaptiveYieldTime - 2*1000, 0);
+ }
}
- else if (overSleep < adaptiveYieldTime - 200*1000) {
- // decrease by 5 microseconds
- adaptiveYieldTime = Math.max(adaptiveYieldTime - 2*1000, 0);
- }
}
/**
@@ -462,28 +467,37 @@
}
/**
- * On windows the sleep functions can be highly inaccurate by
- * over 10ms making in unusable. However it can be forced to
- * be a bit more accurate by running a separate sleeping daemon
- * thread.
+ * Initialise the sync(fps) method.
*/
private static void initiateSyncTimer() {
syncInitiated = true;
+ lastTime = getTime();
- if (!System.getProperty("os.name").startsWith("Win")) {
+ String osName = System.getProperty("os.name");
+
+ if (osName.startsWith("Mac") || osName.startsWith("Darwin")) {
+ // disabled on mac as it uses too much cpu, besides
+ // Thread.sleep is pretty accurate on mac by default
+ adaptiveTimeDisabled = true;
return;
}
- Thread timerAccuracyThread = new Thread(new Runnable() {
- public void run() {
- try {
- Thread.sleep(Long.MAX_VALUE);
- } catch (Exception e) {}
- }
- });
-
- timerAccuracyThread.setDaemon(true);
- timerAccuracyThread.start();
+ if (osName.startsWith("Win")) {
+ // On windows the sleep functions can be highly inaccurate by
+ // over 10ms making in unusable. However it can be forced to
+ // be a bit more accurate by running a separate sleeping daemon
+ // thread.
+ Thread timerAccuracyThread = new Thread(new Runnable() {
+ public void run() {
+ try {
+ Thread.sleep(Long.MAX_VALUE);
+ } catch (Exception e) {}
+ }
+ });
+
+ timerAccuracyThread.setDaemon(true);
+ timerAccuracyThread.start();
+ }
}
/** @return the title of the window */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2012-03-04 13:41:55
|
Revision: 3751
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3751&view=rev
Author: kappa1
Date: 2012-03-04 13:41:49 +0000 (Sun, 04 Mar 2012)
Log Message:
-----------
Refactor so that the peer_info variable in ContextGL does not need to be static
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/opengl/ContextGL.java
trunk/LWJGL/src/java/org/lwjgl/opengl/ContextImplementation.java
trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxContextImplementation.java
trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXContextImplementation.java
trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsContextImplementation.java
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/ContextGL.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/ContextGL.java 2012-03-04 03:50:58 UTC (rev 3750)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/ContextGL.java 2012-03-04 13:41:49 UTC (rev 3751)
@@ -64,7 +64,7 @@
/** Handle to the native GL rendering context */
private final ByteBuffer handle;
- private static PeerInfo peer_info;
+ private final PeerInfo peer_info;
private final ContextAttribs contextAttribs;
private final boolean forwardCompatible;
@@ -229,7 +229,7 @@
* A video frame period is the time required to display a full frame of video data.
*/
public static void setSwapInterval(int value) {
- implementation.setSwapInterval(peer_info, value);
+ implementation.setSwapInterval(value);
}
/**
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/ContextImplementation.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/ContextImplementation.java 2012-03-04 03:50:58 UTC (rev 3750)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/ContextImplementation.java 2012-03-04 13:41:49 UTC (rev 3751)
@@ -81,7 +81,7 @@
*/
boolean isCurrent(ByteBuffer handle) throws LWJGLException;
- void setSwapInterval(PeerInfo peer_info, int value);
+ void setSwapInterval(int value);
/**
* Destroys the Context.
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxContextImplementation.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxContextImplementation.java 2012-03-04 03:50:58 UTC (rev 3750)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxContextImplementation.java 2012-03-04 13:41:49 UTC (rev 3751)
@@ -141,8 +141,10 @@
private static native boolean nIsCurrent(ByteBuffer context_handle) throws LWJGLException;
- public void setSwapInterval(PeerInfo peer_info, int value) {
+ public void setSwapInterval(int value) {
ContextGL current_context = ContextGL.getCurrentContext();
+ PeerInfo peer_info = current_context.getPeerInfo();
+
if ( current_context == null )
throw new IllegalStateException("No context is current");
synchronized ( current_context ) {
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXContextImplementation.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXContextImplementation.java 2012-03-04 03:50:58 UTC (rev 3750)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXContextImplementation.java 2012-03-04 13:41:49 UTC (rev 3751)
@@ -118,7 +118,7 @@
private static native boolean nIsCurrent(ByteBuffer context_handle) throws LWJGLException;
- public void setSwapInterval(PeerInfo peer_info, int value) {
+ public void setSwapInterval(int value) {
ContextGL current_context = ContextGL.getCurrentContext();
synchronized ( current_context ) {
nSetSwapInterval(current_context.getHandle(), value);
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsContextImplementation.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsContextImplementation.java 2012-03-04 03:50:58 UTC (rev 3750)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsContextImplementation.java 2012-03-04 13:41:49 UTC (rev 3751)
@@ -106,7 +106,7 @@
private static native boolean nIsCurrent(ByteBuffer context_handle) throws LWJGLException;
- public void setSwapInterval(PeerInfo peer_info, int value) {
+ public void setSwapInterval(int value) {
boolean success = nSetSwapInterval(value);
if ( !success )
LWJGLUtil.log("Failed to set swap interval");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2012-03-04 03:51:05
|
Revision: 3750
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3750&view=rev
Author: kappa1
Date: 2012-03-04 03:50:58 +0000 (Sun, 04 Mar 2012)
Log Message:
-----------
add missing extgl_InitGLXEXTSwapControl()
Modified Paths:
--------------
trunk/LWJGL/src/native/linux/opengl/extgl_glx.c
Modified: trunk/LWJGL/src/native/linux/opengl/extgl_glx.c
===================================================================
--- trunk/LWJGL/src/native/linux/opengl/extgl_glx.c 2012-03-04 03:45:09 UTC (rev 3749)
+++ trunk/LWJGL/src/native/linux/opengl/extgl_glx.c 2012-03-04 03:50:58 UTC (rev 3750)
@@ -238,6 +238,7 @@
extgl_InitGLX12();
extgl_InitGLX13();
extgl_InitGLXSGISwapControl();
+ extgl_InitGLXEXTSwapControl();
extgl_InitGLXARBCreateContext();
extgl_InitGLXNVPresentVideo();
extgl_InitGLXNVVideoCapture();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2012-03-04 03:45:15
|
Revision: 3749
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3749&view=rev
Author: kappa1
Date: 2012-03-04 03:45:09 +0000 (Sun, 04 Mar 2012)
Log Message:
-----------
add missing lwjgl_glXSwapIntervalEXT
Modified Paths:
--------------
trunk/LWJGL/src/native/linux/opengl/extgl_glx.h
Modified: trunk/LWJGL/src/native/linux/opengl/extgl_glx.h
===================================================================
--- trunk/LWJGL/src/native/linux/opengl/extgl_glx.h 2012-03-04 03:40:32 UTC (rev 3748)
+++ trunk/LWJGL/src/native/linux/opengl/extgl_glx.h 2012-03-04 03:45:09 UTC (rev 3749)
@@ -421,6 +421,7 @@
extern glXQueryExtensionsStringPROC lwjgl_glXQueryExtensionsString;
extern glXSwapIntervalSGIPROC lwjgl_glXSwapIntervalSGI;
+extern glXSwapIntervalEXTPROC lwjgl_glXSwapIntervalEXT;
extern glXCreateContextAttribsARBPROC lwjgl_glXCreateContextAttribsARB;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2012-03-04 03:40:39
|
Revision: 3748
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3748&view=rev
Author: kappa1
Date: 2012-03-04 03:40:32 +0000 (Sun, 04 Mar 2012)
Log Message:
-----------
Implement GLX_EXT_swap_control for Linux
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/opengl/ContextGL.java
trunk/LWJGL/src/java/org/lwjgl/opengl/ContextImplementation.java
trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxContextImplementation.java
trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXContextImplementation.java
trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsContextImplementation.java
trunk/LWJGL/src/native/linux/opengl/extgl_glx.c
trunk/LWJGL/src/native/linux/opengl/extgl_glx.h
trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_LinuxContextImplementation.c
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/ContextGL.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/ContextGL.java 2012-03-01 22:34:34 UTC (rev 3747)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/ContextGL.java 2012-03-04 03:40:32 UTC (rev 3748)
@@ -64,7 +64,7 @@
/** Handle to the native GL rendering context */
private final ByteBuffer handle;
- private final PeerInfo peer_info;
+ private static PeerInfo peer_info;
private final ContextAttribs contextAttribs;
private final boolean forwardCompatible;
@@ -229,7 +229,7 @@
* A video frame period is the time required to display a full frame of video data.
*/
public static void setSwapInterval(int value) {
- implementation.setSwapInterval(value);
+ implementation.setSwapInterval(peer_info, value);
}
/**
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/ContextImplementation.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/ContextImplementation.java 2012-03-01 22:34:34 UTC (rev 3747)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/ContextImplementation.java 2012-03-04 03:40:32 UTC (rev 3748)
@@ -81,7 +81,7 @@
*/
boolean isCurrent(ByteBuffer handle) throws LWJGLException;
- void setSwapInterval(int value);
+ void setSwapInterval(PeerInfo peer_info, int value);
/**
* Destroys the Context.
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxContextImplementation.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxContextImplementation.java 2012-03-01 22:34:34 UTC (rev 3747)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxContextImplementation.java 2012-03-04 03:40:32 UTC (rev 3748)
@@ -141,18 +141,29 @@
private static native boolean nIsCurrent(ByteBuffer context_handle) throws LWJGLException;
- public void setSwapInterval(int value) {
+ public void setSwapInterval(PeerInfo peer_info, int value) {
ContextGL current_context = ContextGL.getCurrentContext();
if ( current_context == null )
throw new IllegalStateException("No context is current");
synchronized ( current_context ) {
LinuxDisplay.lockAWT();
- nSetSwapInterval(current_context.getHandle(), value);
- LinuxDisplay.unlockAWT();
+ try {
+ ByteBuffer peer_handle = peer_info.lockAndGetHandle();
+ try {
+ nSetSwapInterval(peer_handle, current_context.getHandle(), value);
+ } finally {
+ peer_info.unlock();
+ }
+ } catch (LWJGLException e) {
+ // API CHANGE - this methods should throw LWJGLException
+ e.printStackTrace();
+ } finally {
+ LinuxDisplay.unlockAWT();
+ }
}
}
- private static native void nSetSwapInterval(ByteBuffer context_handle, int value);
+ private static native void nSetSwapInterval(ByteBuffer peer_handle, ByteBuffer context_handle, int value);
public void destroy(PeerInfo peer_info, ByteBuffer handle) throws LWJGLException {
LinuxDisplay.lockAWT();
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXContextImplementation.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXContextImplementation.java 2012-03-01 22:34:34 UTC (rev 3747)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXContextImplementation.java 2012-03-04 03:40:32 UTC (rev 3748)
@@ -118,7 +118,7 @@
private static native boolean nIsCurrent(ByteBuffer context_handle) throws LWJGLException;
- public void setSwapInterval(int value) {
+ public void setSwapInterval(PeerInfo peer_info, int value) {
ContextGL current_context = ContextGL.getCurrentContext();
synchronized ( current_context ) {
nSetSwapInterval(current_context.getHandle(), value);
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsContextImplementation.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsContextImplementation.java 2012-03-01 22:34:34 UTC (rev 3747)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsContextImplementation.java 2012-03-04 03:40:32 UTC (rev 3748)
@@ -106,7 +106,7 @@
private static native boolean nIsCurrent(ByteBuffer context_handle) throws LWJGLException;
- public void setSwapInterval(int value) {
+ public void setSwapInterval(PeerInfo peer_info, int value) {
boolean success = nSetSwapInterval(value);
if ( !success )
LWJGLUtil.log("Failed to set swap interval");
Modified: trunk/LWJGL/src/native/linux/opengl/extgl_glx.c
===================================================================
--- trunk/LWJGL/src/native/linux/opengl/extgl_glx.c 2012-03-01 22:34:34 UTC (rev 3747)
+++ trunk/LWJGL/src/native/linux/opengl/extgl_glx.c 2012-03-04 03:40:32 UTC (rev 3748)
@@ -74,6 +74,9 @@
/* GLX_SGI_swap_control */
glXSwapIntervalSGIPROC lwjgl_glXSwapIntervalSGI = NULL;
+/* GLX_EXT_swap_control */
+glXSwapIntervalEXTPROC lwjgl_glXSwapIntervalEXT = NULL;
+
/* GLX_ARB_create_context */
glXCreateContextAttribsARBPROC lwjgl_glXCreateContextAttribsARB = NULL;
@@ -155,6 +158,12 @@
symbols_flags.GLX_SGI_swap_control = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions);
}
+static void extgl_InitGLXEXTSwapControl() {
+ ExtFunction functions[] = {
+ {"glXSwapIntervalEXT", (void*)&lwjgl_glXSwapIntervalEXT}};
+ symbols_flags.GLX_EXT_swap_control = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions);
+}
+
static void extgl_InitGLXARBCreateContext() {
ExtFunction functions[] = {
{"glXCreateContextAttribsARB", (void*)&lwjgl_glXCreateContextAttribsARB}};
@@ -189,6 +198,7 @@
/* extension_flags.GLX_EXT_visual_info = GLXQueryExtension(serverExts, clientExts, "GLX_EXT_visual_info");
extension_flags.GLX_EXT_visual_rating = GLXQueryExtension(serverExts, clientExts, "GLX_EXT_visual_rating");*/
extension_flags->GLX_SGI_swap_control = symbols_flags.GLX_SGI_swap_control && GLXQueryExtension(serverExts, clientExts, "GLX_SGI_swap_control");
+ extension_flags->GLX_EXT_swap_control = symbols_flags.GLX_EXT_swap_control && GLXQueryExtension(serverExts, clientExts, "GLX_EXT_swap_control");
extension_flags->GLX_ARB_multisample = GLXQueryExtension(serverExts, clientExts, "GLX_ARB_multisample");
extension_flags->GLX_ARB_fbconfig_float = GLXQueryExtension(serverExts, clientExts, "GLX_ARB_fbconfig_float");
extension_flags->GLX_EXT_fbconfig_packed_float = GLXQueryExtension(serverExts, clientExts, "GLX_EXT_fbconfig_packed_float");
Modified: trunk/LWJGL/src/native/linux/opengl/extgl_glx.h
===================================================================
--- trunk/LWJGL/src/native/linux/opengl/extgl_glx.h 2012-03-01 22:34:34 UTC (rev 3747)
+++ trunk/LWJGL/src/native/linux/opengl/extgl_glx.h 2012-03-04 03:40:32 UTC (rev 3748)
@@ -343,6 +343,9 @@
/* GLX_SGI_swap_control */
typedef void (APIENTRY * glXSwapIntervalSGIPROC)(int interval);
+/* GLX_EXT_swap_control */
+typedef void (APIENTRY * glXSwapIntervalEXTPROC)(Display *dpy, GLXDrawable drawable, int interval);
+
/* GLX_ARB_create_context */
typedef GLXContext (APIENTRY * glXCreateContextAttribsARBPROC) (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list);
@@ -365,6 +368,7 @@
/* bool GLX_EXT_visual_info;
bool GLX_EXT_visual_rating;*/
bool GLX_SGI_swap_control;
+ bool GLX_EXT_swap_control;
bool GLX_ARB_multisample;
bool GLX_ARB_fbconfig_float;
bool GLX_EXT_fbconfig_packed_float;
Modified: trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_LinuxContextImplementation.c
===================================================================
--- trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_LinuxContextImplementation.c 2012-03-01 22:34:34 UTC (rev 3747)
+++ trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_LinuxContextImplementation.c 2012-03-04 03:40:32 UTC (rev 3748)
@@ -117,10 +117,15 @@
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxContextImplementation_nSetSwapInterval
- (JNIEnv *env, jclass clazz, jobject context_handle, jint value)
+ (JNIEnv *env, jclass clazz, jobject peer_info_handle, jobject context_handle, jint value)
{
+ X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle);
X11Context *context_info = (*env)->GetDirectBufferAddress(env, context_handle);
- if (context_info->extension_flags.GLX_SGI_swap_control) {
+
+ if (context_info->extension_flags.GLX_EXT_swap_control) {
+ lwjgl_glXSwapIntervalEXT(peer_info->display, peer_info->drawable, value);
+ }
+ else if (context_info->extension_flags.GLX_SGI_swap_control) {
lwjgl_glXSwapIntervalSGI(value);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2012-03-01 22:34:40
|
Revision: 3747
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3747&view=rev
Author: kappa1
Date: 2012-03-01 22:34:34 +0000 (Thu, 01 Mar 2012)
Log Message:
-----------
Tweak Display.sync() method a little to reduce the Thread.yield() time even further, now with a minimum of 0 yield time.
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 2012-02-29 23:18:35 UTC (rev 3746)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2012-03-01 22:34:34 UTC (rev 3747)
@@ -86,7 +86,7 @@
private static boolean syncInitiated;
/** adaptive time to yield instead of sleeping in sync()*/
- private static long adaptiveYieldTime = 1000*1000;
+ private static long adaptiveYieldTime;
/** X coordinate of the window */
private static int x = -1;
@@ -444,12 +444,12 @@
// auto tune the amount of time to yield
if (overSleep > adaptiveYieldTime) {
- // increase by 500 microseconds (half a ms)
- adaptiveYieldTime = Math.min(adaptiveYieldTime + 500*1000, sleepTime);
+ // increase by 200 microseconds (1/5 a ms)
+ adaptiveYieldTime = Math.min(adaptiveYieldTime + 200*1000, sleepTime);
}
- else if (overSleep < adaptiveYieldTime - 1000*1000) {
+ else if (overSleep < adaptiveYieldTime - 200*1000) {
// decrease by 5 microseconds
- adaptiveYieldTime = Math.max(adaptiveYieldTime - 5*1000, 1000*1000);
+ adaptiveYieldTime = Math.max(adaptiveYieldTime - 2*1000, 0);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|