aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/games/jogl/impl/macosx/MacOSXOffscreenGLContext.java
diff options
context:
space:
mode:
authorGerard Ziemski <[email protected]>2003-10-12 06:31:59 +0000
committerGerard Ziemski <[email protected]>2003-10-12 06:31:59 +0000
commitfbdf8c337805b02385bf43b65aad93c20a2e3ad2 (patch)
treeae1575e8291ee93c85a1c00e6cbb5e00a0c59255 /src/net/java/games/jogl/impl/macosx/MacOSXOffscreenGLContext.java
parent30664570919282ddef3d0496251a3bfb8558b298 (diff)
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
Diffstat (limited to 'src/net/java/games/jogl/impl/macosx/MacOSXOffscreenGLContext.java')
-rw-r--r--src/net/java/games/jogl/impl/macosx/MacOSXOffscreenGLContext.java31
1 files changed, 13 insertions, 18 deletions
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();
}
}