From 532413bb45e35852429ec062ca27d95f6900a9b6 Mon Sep 17 00:00:00 2001 From: Gerard Ziemski Date: Sat, 8 Nov 2003 19:47:35 +0000 Subject: use USE_GL_TEXTURE_RECTANGLE_EXT for PBuffers - needed for GLJPanel git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@72 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/native/jogl/MacOSXWindowSystemInterface.m | 53 ++++++++++++++++++--------- 1 file changed, 36 insertions(+), 17 deletions(-) (limited to 'src/native/jogl/MacOSXWindowSystemInterface.m') diff --git a/src/native/jogl/MacOSXWindowSystemInterface.m b/src/native/jogl/MacOSXWindowSystemInterface.m index 2d812ec58..f72170b69 100644 --- a/src/native/jogl/MacOSXWindowSystemInterface.m +++ b/src/native/jogl/MacOSXWindowSystemInterface.m @@ -2,8 +2,13 @@ #import #import "ContextUpdater.h" -#ifndef GL_TEXTURE_RECTANGLE_EXT - #define GL_TEXTURE_RECTANGLE_EXT 0x84F5 +// see MacOSXPbufferGLContext.java createPbuffer +#define USE_GL_TEXTURE_RECTANGLE_EXT + +#ifdef USE_GL_TEXTURE_RECTANGLE_EXT + #ifndef GL_TEXTURE_RECTANGLE_EXT + #define GL_TEXTURE_RECTANGLE_EXT 0x84F5 + #endif #endif typedef int Bool; @@ -32,7 +37,7 @@ void* createContext(void* shareContext, void* view) return NULL; } } - + if (gAutoreleasePool == NULL) { gAutoreleasePool = [[NSAutoreleasePool alloc] init]; @@ -56,11 +61,6 @@ void* createContext(void* shareContext, void* view) 0 }; - if (nsView == NULL) - { - attribs[12] = 0; // no stencil, no accums for pBuffers - } - NSOpenGLPixelFormat* fmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:attribs]; NSOpenGLContext* nsContext = [[NSOpenGLContext alloc] initWithFormat:fmt shareContext:nsChareCtx]; @@ -73,9 +73,10 @@ void* createContext(void* shareContext, void* view) [nsView unlockFocus]; } - + [nsContext retain]; +//fprintf(stderr, " nsContext=%p\n", nsContext); return nsContext; } @@ -140,6 +141,7 @@ void updateContextUnregister(void* context, void* view, void* updater) [contextUpdater release]; } +#ifndef USE_GL_TEXTURE_RECTANGLE_EXT static int getNextPowerOf2(int number) { if (((number-1) & number) == 0) @@ -155,23 +157,28 @@ static int getNextPowerOf2(int number) } return (1<