From fbdf8c337805b02385bf43b65aad93c20a2e3ad2 Mon Sep 17 00:00:00 2001 From: Gerard Ziemski Date: Sun, 12 Oct 2003 06:31:59 +0000 Subject: Implemented PBuffers (available in >= Panther). Reimplemented window resizing using update listener git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@67 232f8b59-042b-4e1e-8c03-345bb8c30851 --- .../jogl/impl/macosx/MacOSXOffscreenGLContext.java | 31 +++++++++------------- 1 file changed, 13 insertions(+), 18 deletions(-) (limited to 'src/net/java/games/jogl/impl/macosx/MacOSXOffscreenGLContext.java') diff --git a/src/net/java/games/jogl/impl/macosx/MacOSXOffscreenGLContext.java b/src/net/java/games/jogl/impl/macosx/MacOSXOffscreenGLContext.java index e9f3bed24..431710a7c 100644 --- a/src/net/java/games/jogl/impl/macosx/MacOSXOffscreenGLContext.java +++ b/src/net/java/games/jogl/impl/macosx/MacOSXOffscreenGLContext.java @@ -48,12 +48,11 @@ public class MacOSXOffscreenGLContext extends MacOSXGLContext // Width and height of the underlying bitmap private int width; private int height; - + public MacOSXOffscreenGLContext(GLCapabilities capabilities, GLCapabilitiesChooser chooser, GLContext shareWith) { super(null, capabilities, chooser, shareWith); - System.err.println("MacOSXOffscreenGLContext not implemented yet"); } protected GL createGL() { @@ -65,15 +64,10 @@ public class MacOSXOffscreenGLContext extends MacOSXGLContext } public int getOffscreenContextBufferedImageType() { - if (capabilities.getAlphaBits() > 0) { return BufferedImage.TYPE_INT_ARGB; - } else { - return BufferedImage.TYPE_INT_RGB; - } } public int getOffscreenContextReadBuffer() { - // On Windows these nsContexts are always single-buffered return GL.GL_FRONT; } @@ -100,22 +94,23 @@ public class MacOSXOffscreenGLContext extends MacOSXGLContext } protected synchronized boolean makeCurrent(Runnable initAction) throws GLException { - return false; + if (pendingOffscreenResize) { + if (pendingOffscreenWidth != width || pendingOffscreenHeight != height) { + if (nsContext != 0) { + destroy(); + } + width = pendingOffscreenWidth; + height = pendingOffscreenHeight; + pendingOffscreenResize = false; + } + } + return super.makeCurrent(initAction); } protected synchronized void swapBuffers() throws GLException { - throw new GLException("Not yet implemented"); - } - - protected synchronized void free() throws GLException { - throw new GLException("Not yet implemented"); - } - - protected void create() { - throw new GLException("Not yet implemented"); } private void destroy() { - throw new GLException("Not yet implemented"); + free(); } } -- cgit v1.2.3