diff options
author | Kenneth Russel <[email protected]> | 2005-07-10 23:17:43 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2005-07-10 23:17:43 +0000 |
commit | 8a4e964a88703bcab4a8888b25ea9e997953180a (patch) | |
tree | 073e1a11d44a0f4cb407419c90f89aee0979403d /src/net/java/games/jogl/impl/GLPbufferImpl.java | |
parent | 6e8dd12319e2d6f702cf66728b177e6ea0152c2c (diff) |
Initial set of context-related changes for the JSR-231 API. GLContext
has been exposed in the public API. The GLEventListener callback
mechanism has been removed from the core GLContext implementation and
moved up to a higher level. GLAutoDrawable now contains the
GLEventListener-related methods, and the GLEventListener's methods now
receive a GLAutoDrawable as argument. All JOGL demos have been updated
for the new APIs. Many FIXMEs and much unimplemented functionality
remain. There is slightly different initialization behavior for the
demos containing pbuffers, and the deferring of reshape callbacks
needs to be rethought.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JSR-231@320 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/net/java/games/jogl/impl/GLPbufferImpl.java')
-rw-r--r-- | src/net/java/games/jogl/impl/GLPbufferImpl.java | 46 |
1 files changed, 14 insertions, 32 deletions
diff --git a/src/net/java/games/jogl/impl/GLPbufferImpl.java b/src/net/java/games/jogl/impl/GLPbufferImpl.java index 7b17c3010..4e8bd7c63 100644 --- a/src/net/java/games/jogl/impl/GLPbufferImpl.java +++ b/src/net/java/games/jogl/impl/GLPbufferImpl.java @@ -53,13 +53,13 @@ import net.java.games.jogl.*; public class GLPbufferImpl implements GLPbuffer { // GLPbufferContext - private GLContext context; + private GLContextImpl context; private GLDrawableHelper drawableHelper = new GLDrawableHelper(); private boolean isInitialized=false; private int floatMode; public GLPbufferImpl(GLContext context) { - this.context = context; + this.context = (GLContextImpl) context; } public void display() { @@ -73,15 +73,12 @@ public class GLPbufferImpl implements GLPbuffer { throw new GLException("Not yet implemented"); } - public void setSize(Dimension d) { - setSize(d.width, d.height); - } - - public Dimension getSize() { - return getSize(null); + public int getWidth() { + // FIXME + throw new GLException("Not yet implemented"); } - public Dimension getSize(Dimension d) { + public int getHeight() { // FIXME throw new GLException("Not yet implemented"); } @@ -110,26 +107,6 @@ public class GLPbufferImpl implements GLPbuffer { context.setGLU(glu); } - void willSetRenderingThread() { - // Not supported for pbuffers - } - - public void setRenderingThread(Thread currentThreadOrNull) throws GLException { - // Not supported for pbuffers - } - - public Thread getRenderingThread() { - // Not supported for pbuffers - return null; - } - - public void setNoAutoRedrawMode(boolean noAutoRedraws) { - } - - public boolean getNoAutoRedrawMode() { - return false; - } - public void setAutoSwapBufferMode(boolean onOrOff) { context.setAutoSwapBufferMode(onOrOff); } @@ -168,6 +145,11 @@ public class GLPbufferImpl implements GLPbuffer { return context; } + // FIXME: workaround for problems with deferring reshape actions + public GLDrawableHelper getDrawableHelper() { + return drawableHelper; + } + //---------------------------------------------------------------------- // No-ops for ComponentEvents // @@ -239,7 +221,7 @@ public class GLPbufferImpl implements GLPbuffer { throw new GLException(e); } } else { - context.invokeGL(invokeGLAction, isReshape, initAction); + drawableHelper.invokeGL(context, invokeGLAction, isReshape, initAction); } } @@ -271,14 +253,14 @@ public class GLPbufferImpl implements GLPbuffer { // being resized on the AWT event dispatch thread class DisplayOnEventDispatchThreadAction implements Runnable { public void run() { - context.invokeGL(displayAction, false, initAction); + drawableHelper.invokeGL(context, displayAction, false, initAction); } } private DisplayOnEventDispatchThreadAction displayOnEventDispatchThreadAction = new DisplayOnEventDispatchThreadAction(); class SwapBuffersOnEventDispatchThreadAction implements Runnable { public void run() { - context.invokeGL(swapBuffersAction, false, initAction); + drawableHelper.invokeGL(context, swapBuffersAction, false, initAction); } } private SwapBuffersOnEventDispatchThreadAction swapBuffersOnEventDispatchThreadAction = |