diff options
author | Michael Bien <[email protected]> | 2009-08-08 21:43:30 +0200 |
---|---|---|
committer | Michael Bien <[email protected]> | 2009-08-08 21:43:30 +0200 |
commit | 8ef9d7364a942c19ec5e1f306e08193e83f4fea6 (patch) | |
tree | 6dcf95825d2933992199a7062b15e38d3f721c95 /src/jogl/classes/com/sun/opengl/impl/macosx/cgl | |
parent | 2a8e9876ca4567de3b08813c280d006f9b2c32e6 (diff) | |
parent | fb3e50b4e7e11df911a83ab7966cf8f293c20da2 (diff) |
Merge branch 'master' of ssh://[email protected]/jogl~jogl-git
Diffstat (limited to 'src/jogl/classes/com/sun/opengl/impl/macosx/cgl')
6 files changed, 20 insertions, 12 deletions
diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLContext.java index b424e9516..181efc8bb 100644 --- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLContext.java +++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLContext.java @@ -320,7 +320,6 @@ public abstract class MacOSXCGLContext extends GLContextImpl } protected void updateGLProcAddressTable() { - super.updateGLProcAddressTable(); if (DEBUG) { System.err.println("!!! Initializing CGL extension address table"); } @@ -330,6 +329,7 @@ public abstract class MacOSXCGLContext extends GLContextImpl cglExtProcAddressTable = new CGLExtProcAddressTable(); } resetProcAddressTable(getCGLExtProcAddressTable()); + super.updateGLProcAddressTable(); } public String getPlatformExtensionsString() @@ -337,11 +337,12 @@ public abstract class MacOSXCGLContext extends GLContextImpl return ""; } - public void setSwapInterval(int interval) { + protected void setSwapIntervalImpl(int interval) { if (nsContext == 0) { throw new GLException("OpenGL context not current"); } CGL.setSwapInterval(nsContext, interval); + currentSwapInterval = interval ; } public ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3) { diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLContext.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLContext.java index f87cc150b..4a3e0a8eb 100644 --- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLContext.java +++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLContext.java @@ -102,7 +102,7 @@ public class MacOSXOnscreenCGLContext extends MacOSXCGLContext { } } - public void swapBuffers() throws GLException { + protected void swapBuffers() { if (!CGL.flushBuffer(nsContext)) { throw new GLException("Error swapping buffers"); } diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLDrawable.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLDrawable.java index 98687b5ef..56951ae10 100644 --- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLDrawable.java +++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLDrawable.java @@ -78,7 +78,7 @@ public class MacOSXOnscreenCGLDrawable extends MacOSXCGLDrawable { return component.getHeight(); } - public void swapBuffers() throws GLException { + protected void swapBuffersImpl() { for (Iterator iter = createdContexts.iterator(); iter.hasNext(); ) { WeakReference ref = (WeakReference) iter.next(); MacOSXOnscreenCGLContext ctx = (MacOSXOnscreenCGLContext) ref.get(); diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java index d702150d3..0754c4b57 100644 --- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java +++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java @@ -86,7 +86,7 @@ public class MacOSXPbufferCGLContext extends MacOSXCGLContext { rect = false; } } - textureTarget = (rect ? GL2.GL_TEXTURE_RECTANGLE_EXT: GL.GL_TEXTURE_2D); + textureTarget = (rect ? GL2.GL_TEXTURE_RECTANGLE : GL.GL_TEXTURE_2D); int[] tmp = new int[1]; gl.glGenTextures(1, tmp, 0); texture = tmp[0]; @@ -121,11 +121,12 @@ public class MacOSXPbufferCGLContext extends MacOSXCGLContext { } } - public void setSwapInterval(int interval) { + protected void setSwapIntervalImpl(int interval) { if (nsContext == 0) { throw new GLException("OpenGL context not current"); } impl.setSwapInterval(nsContext, interval); + currentSwapInterval = impl.getSwapInterval() ; } public int getFloatingPointMode() { @@ -210,6 +211,7 @@ public class MacOSXPbufferCGLContext extends MacOSXCGLContext { public boolean makeCurrent(long ctx); public boolean release(long ctx); public void setSwapInterval(long ctx, int interval); + public int getSwapInterval(); } // NSOpenGLContext-based implementation @@ -241,8 +243,14 @@ public class MacOSXPbufferCGLContext extends MacOSXCGLContext { return CGL.clearCurrentContext(ctx); } + private int currentSwapInterval = 0 ; + public void setSwapInterval(long ctx, int interval) { CGL.setSwapInterval(ctx, interval); + currentSwapInterval = interval ; + } + public int getSwapInterval() { + return currentSwapInterval; } } @@ -344,5 +352,8 @@ public class MacOSXPbufferCGLContext extends MacOSXCGLContext { public void setSwapInterval(long ctx, int interval) { // For now not supported (not really relevant for off-screen contexts anyway) } + public int getSwapInterval() { + return 0; + } } } diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java index 54101331d..2d7b3ea34 100644 --- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java +++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java @@ -87,7 +87,7 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable { return pBuffer; } - public void swapBuffers() throws GLException { + protected void swapBuffersImpl() { // FIXME: do we need to do anything if the pbuffer is double-buffered? } @@ -98,7 +98,7 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable { GLProfile glProfile = capabilities.getGLProfile(); int renderTarget; if (glProfile.isGL2() && capabilities.getPbufferRenderToTextureRectangle()) { - renderTarget = GL2.GL_TEXTURE_RECTANGLE_EXT; + renderTarget = GL2.GL_TEXTURE_RECTANGLE; } else { int w = getNextPowerOf2(getWidth()); int h = getNextPowerOf2(getHeight()); diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/awt/MacOSXJava2DCGLContext.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/awt/MacOSXJava2DCGLContext.java index 4423f8da5..22b0ffe55 100644 --- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/awt/MacOSXJava2DCGLContext.java +++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/awt/MacOSXJava2DCGLContext.java @@ -144,10 +144,6 @@ public class MacOSXJava2DCGLContext extends MacOSXCGLContext implements Java2DGL } } - public void setSwapInterval(int interval) { - // Not supported in this context implementation - } - public void setOpenGLMode(int mode) { if (mode != MacOSXCGLDrawable.CGL_MODE) throw new GLException("OpenGL mode switching not supported for Java2D GLContexts"); |