aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/games/jogl/impl
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2005-05-20 19:21:02 +0000
committerKenneth Russel <[email protected]>2005-05-20 19:21:02 +0000
commitbea9f9567ca5892813b308bf92eab96166248afe (patch)
treeda37b659a3dc5028ac54f4a1852d3aae52d6b118 /src/net/java/games/jogl/impl
parenta6655b13e61b28e5e2c38c7b53c6d26db93b0cbb (diff)
Added first-cut support for floating-point pbuffers on Mac OS X
(untested) git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@276 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/net/java/games/jogl/impl')
-rw-r--r--src/net/java/games/jogl/impl/macosx/MacOSXPbufferGLContext.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/net/java/games/jogl/impl/macosx/MacOSXPbufferGLContext.java b/src/net/java/games/jogl/impl/macosx/MacOSXPbufferGLContext.java
index bc046bcc1..d374230d9 100644
--- a/src/net/java/games/jogl/impl/macosx/MacOSXPbufferGLContext.java
+++ b/src/net/java/games/jogl/impl/macosx/MacOSXPbufferGLContext.java
@@ -64,8 +64,20 @@ public class MacOSXPbufferGLContext extends MacOSXGLContext {
height = getNextPowerOf2(initHeight);
renderTarget = GL.GL_TEXTURE_2D;
}
+
+ int internalFormat = GL.GL_RGBA;
+ if (capabilities.getOffscreenFloatingPointBuffers()) {
+ 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;
+ default: throw new GLException("Invalid floating-point bit depth (only 16 and 32 supported)");
+ }
+ }
- pBuffer = CGL.createPBuffer(renderTarget, width, height);
+ pBuffer = CGL.createPBuffer(renderTarget, internalFormat, width, height);
if (pBuffer == 0) {
throw new GLException("pbuffer creation error: CGL.createPBuffer() failed");
}