diff options
author | Sven Gothel <[email protected]> | 2009-09-25 12:30:31 -0700 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2009-09-25 12:30:31 -0700 |
commit | 760d6821e09985252c8b439d9a92bead7bcf1193 (patch) | |
tree | 71808409d1b424eb2d24e13942babc219b3bf64d /src/jogl/native/macosx/MacOSXCustomCGLCode.c | |
parent | 82ff74cfca31c3c72d9c1de260c17323943fa571 (diff) |
Fix MacOSX External GLContext
Diffstat (limited to 'src/jogl/native/macosx/MacOSXCustomCGLCode.c')
-rw-r--r-- | src/jogl/native/macosx/MacOSXCustomCGLCode.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/jogl/native/macosx/MacOSXCustomCGLCode.c b/src/jogl/native/macosx/MacOSXCustomCGLCode.c new file mode 100644 index 000000000..c29be889d --- /dev/null +++ b/src/jogl/native/macosx/MacOSXCustomCGLCode.c @@ -0,0 +1,24 @@ +#include <stdlib.h> + +#include <assert.h> + +#include </usr/include/machine/types.h> +#include "macosx-window-system.h" + +void CGLQueryPixelFormat(void* pixelFormat, int* iattrs, int niattrs, int* ivalues) { + CGLPixelFormatObj pix = (CGLPixelFormatObj) pixelFormat; + // FIXME: think about how specifying this might affect the API + int virtualScreen = 0; + + int i; + GLint value; + for (i = 0; i < niattrs && iattrs[i]>0; i++) { + CGLPixelFormatAttribute attr = (CGLPixelFormatAttribute) iattrs[i]; + if ( kCGLNoError == CGLDescribePixelFormat(pix, virtualScreen, attr, &value) ) { + ivalues[i] = value; + } else { + ivalues[i] = 0; + } + } +} + |