diff options
author | Kenneth Russel <[email protected]> | 2005-07-18 23:15:37 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2005-07-18 23:15:37 +0000 |
commit | 35435c313ba527c9bea35a14f72492d2f80a9c84 (patch) | |
tree | ae7f1ed0a184d990292f0e295fa943c0139868a0 /src/net/java/games/jogl/impl/macosx/MacOSXPbufferGLDrawable.java | |
parent | 8f5492988de9fddf61623b7274915c777ad3a97d (diff) |
Moved pbuffer creation support from MacOSXOnscreenGLDrawable to
MacOSXGLContextFactory. This completes the transition from creating
pbuffers as a subordinate object of a GLCanvas to creating them as
standalone GLDrawables. Deleted code from GLAutoDrawable and all
implementations related to pbuffer instantiation.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JSR-231@328 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/net/java/games/jogl/impl/macosx/MacOSXPbufferGLDrawable.java')
-rw-r--r-- | src/net/java/games/jogl/impl/macosx/MacOSXPbufferGLDrawable.java | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/src/net/java/games/jogl/impl/macosx/MacOSXPbufferGLDrawable.java b/src/net/java/games/jogl/impl/macosx/MacOSXPbufferGLDrawable.java index fc5f3c22e..282d8a08b 100644 --- a/src/net/java/games/jogl/impl/macosx/MacOSXPbufferGLDrawable.java +++ b/src/net/java/games/jogl/impl/macosx/MacOSXPbufferGLDrawable.java @@ -61,6 +61,8 @@ public class MacOSXPbufferGLDrawable extends MacOSXGLDrawable { super(capabilities, null); this.initWidth = initialWidth; this.initHeight = initialHeight; + + createPbuffer(); } public GLContext createContext(GLContext shareWith) { @@ -91,7 +93,19 @@ public class MacOSXPbufferGLDrawable extends MacOSXGLDrawable { return height; } - public void createPbuffer(GL gl) { + public GLCapabilities getCapabilities() { + return capabilities; + } + + public long getPbuffer() { + return pBuffer; + } + + public void swapBuffers() throws GLException { + // FIXME: do we need to do anything if the pbuffer is double-buffered? + } + + protected void createPbuffer() { int renderTarget; if (capabilities.getOffscreenRenderToTextureRectangle()) { width = initWidth; @@ -105,9 +119,15 @@ public class MacOSXPbufferGLDrawable extends MacOSXGLDrawable { int internalFormat = GL.GL_RGBA; if (capabilities.getOffscreenFloatingPointBuffers()) { + // FIXME: want to check availability of GL_APPLE_float_pixels + // extension, but need valid OpenGL context in order to do so -- + // in worst case would need to create dummy window / GLCanvas + // (undesirable) -- could maybe also do this with pbuffers + /* if (!gl.isExtensionAvailable("GL_APPLE_float_pixels")) { throw new GLException("Floating-point support (GL_APPLE_float_pixels) not available"); } + */ switch (capabilities.getRedBits()) { case 16: internalFormat = GL.GL_RGBA_FLOAT16_APPLE; break; case 32: internalFormat = GL.GL_RGBA_FLOAT32_APPLE; break; @@ -125,18 +145,6 @@ public class MacOSXPbufferGLDrawable extends MacOSXGLDrawable { } } - public GLCapabilities getCapabilities() { - return capabilities; - } - - public long getPbuffer() { - return pBuffer; - } - - public void swapBuffers() throws GLException { - // FIXME: do we need to do anything if the pbuffer is double-buffered? - } - private int getNextPowerOf2(int number) { if (((number-1) & number) == 0) { //ex: 8 -> 0b1000; 8-1=7 -> 0b0111; 0b1000&0b0111 == 0 |