|
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.
|