< prev index next >

src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLGraphicsConfig.m

Print this page




 216 + (void) _getCGLConfigInfo: (NSMutableArray *)argValue {
 217     AWT_ASSERT_APPKIT_THREAD;
 218 
 219     jint displayID = (jint)[(NSNumber *)[argValue objectAtIndex: 0] intValue];
 220     jint pixfmt = (jint)[(NSNumber *)[argValue objectAtIndex: 1] intValue];
 221     jint swapInterval = (jint)[(NSNumber *)[argValue objectAtIndex: 2] intValue];
 222     JNIEnv *env = [ThreadUtilities getJNIEnvUncached];
 223     [argValue removeAllObjects];
 224 
 225     J2dRlsTraceLn(J2D_TRACE_INFO, "CGLGraphicsConfig_getCGLConfigInfo");
 226 
 227     NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
 228 
 229     CGOpenGLDisplayMask glMask = (CGOpenGLDisplayMask)pixfmt;
 230     if (sharedContext == NULL) {
 231         if (glMask == 0) {
 232             glMask = CGDisplayIDToOpenGLDisplayMask(displayID);
 233         }
 234 
 235         NSOpenGLPixelFormatAttribute attrs[] = {

 236             NSOpenGLPFAClosestPolicy,
 237             NSOpenGLPFAWindow,
 238             NSOpenGLPFAPixelBuffer,
 239             NSOpenGLPFADoubleBuffer,
 240             NSOpenGLPFAColorSize, 32,
 241             NSOpenGLPFAAlphaSize, 8,
 242             NSOpenGLPFADepthSize, 16,
 243             NSOpenGLPFAScreenMask, glMask,
 244             0
 245         };
 246 
 247         sharedPixelFormat =
 248             [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs];
 249         if (sharedPixelFormat == nil) {
 250             J2dRlsTraceLn(J2D_TRACE_ERROR, "CGLGraphicsConfig_getCGLConfigInfo: shared NSOpenGLPixelFormat is NULL");
 251             [argValue addObject: [NSNumber numberWithLong: 0L]];
 252             return;
 253         }
 254 
 255         sharedContext =




 216 + (void) _getCGLConfigInfo: (NSMutableArray *)argValue {
 217     AWT_ASSERT_APPKIT_THREAD;
 218 
 219     jint displayID = (jint)[(NSNumber *)[argValue objectAtIndex: 0] intValue];
 220     jint pixfmt = (jint)[(NSNumber *)[argValue objectAtIndex: 1] intValue];
 221     jint swapInterval = (jint)[(NSNumber *)[argValue objectAtIndex: 2] intValue];
 222     JNIEnv *env = [ThreadUtilities getJNIEnvUncached];
 223     [argValue removeAllObjects];
 224 
 225     J2dRlsTraceLn(J2D_TRACE_INFO, "CGLGraphicsConfig_getCGLConfigInfo");
 226 
 227     NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
 228 
 229     CGOpenGLDisplayMask glMask = (CGOpenGLDisplayMask)pixfmt;
 230     if (sharedContext == NULL) {
 231         if (glMask == 0) {
 232             glMask = CGDisplayIDToOpenGLDisplayMask(displayID);
 233         }
 234 
 235         NSOpenGLPixelFormatAttribute attrs[] = {
 236             NSOpenGLPFAAllowOfflineRenderers,
 237             NSOpenGLPFAClosestPolicy,
 238             NSOpenGLPFAWindow,
 239             NSOpenGLPFAPixelBuffer,
 240             NSOpenGLPFADoubleBuffer,
 241             NSOpenGLPFAColorSize, 32,
 242             NSOpenGLPFAAlphaSize, 8,
 243             NSOpenGLPFADepthSize, 16,
 244             NSOpenGLPFAScreenMask, glMask,
 245             0
 246         };
 247 
 248         sharedPixelFormat =
 249             [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs];
 250         if (sharedPixelFormat == nil) {
 251             J2dRlsTraceLn(J2D_TRACE_ERROR, "CGLGraphicsConfig_getCGLConfigInfo: shared NSOpenGLPixelFormat is NULL");
 252             [argValue addObject: [NSNumber numberWithLong: 0L]];
 253             return;
 254         }
 255 
 256         sharedContext =


< prev index next >