diff options
author | Kenneth Russel <[email protected]> | 2005-06-02 22:56:14 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2005-06-02 22:56:14 +0000 |
commit | 90752caa7b31475d4fd424e8007ef2c9dd3851b5 (patch) | |
tree | 7fdd7426b5b02f0eefa955dbcf914e621397b5bd /src/native | |
parent | 2c06e5f46292ee7e3e4824527e1fe6cf6708df7b (diff) |
Made pbuffer code and in particular floating-point pbuffer code more
correct on Mac OS X; problems still exist, however (very likely driver
bugs)
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@293 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/native')
-rw-r--r-- | src/native/jogl/MacOSXWindowSystemInterface.m | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/native/jogl/MacOSXWindowSystemInterface.m b/src/native/jogl/MacOSXWindowSystemInterface.m index 0b68ee5d4..516bda0db 100644 --- a/src/native/jogl/MacOSXWindowSystemInterface.m +++ b/src/native/jogl/MacOSXWindowSystemInterface.m @@ -1,5 +1,6 @@ #import <Cocoa/Cocoa.h> #import <OpenGL/gl.h> +#import <OpenGL/CGLTypes.h> #import <jni.h> #import "ContextUpdater.h" @@ -29,6 +30,8 @@ void* createContext(void* shareContext, void* view, int accumAlphaBits, int sampleBuffers, int numSamples, + int pbuffer, + int floatingPoint, int* viewNotReady) { int colorSize = redBits + greenBits + blueBits; @@ -50,11 +53,16 @@ void* createContext(void* shareContext, void* view, return NULL; } } - + NSOpenGLPixelFormatAttribute attribs[256]; int idx = 0; - if (doubleBuffer) attribs[idx++] = NSOpenGLPFADoubleBuffer; - if (stereo) attribs[idx++] = NSOpenGLPFAStereo; + if (pbuffer) attribs[idx++] = NSOpenGLPFAPixelBuffer; + // kCGLPFAColorFloat is equivalent to NSOpenGLPFAColorFloat, but the + // latter is only available on 10.4 and we need to compile under + // 10.3 + if (floatingPoint) attribs[idx++] = kCGLPFAColorFloat; + if (doubleBuffer) attribs[idx++] = NSOpenGLPFADoubleBuffer; + if (stereo) attribs[idx++] = NSOpenGLPFAStereo; attribs[idx++] = NSOpenGLPFAColorSize; attribs[idx++] = colorSize; attribs[idx++] = NSOpenGLPFAAlphaSize; attribs[idx++] = alphaBits; attribs[idx++] = NSOpenGLPFADepthSize; attribs[idx++] = depthBits; |