Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > NSOpenGLPFAFullScreen

NSOpenGLPFAFullScreen
Thread Tools
Fresh-Faced Recruit
Join Date: Sep 2002
Status: Offline
Reply With Quote
Nov 17, 2002, 06:28 PM
 
I am unable to obtain an NSOpenGLPixelFormat pointer that includes NSOpenGLPFAFullScreen in its array of NSOpenGLPixelFormatAttributes. This is surprising as I am able to grab the full screen for OpenGL rendering when dealing directly with the CoreGraphics framework instead of going through the AppKit OpenGL abstractions.

My system is a PowerBook G4 running Mac OS X 10.2.2. The following is a simple example of code that will fail to create the described NSOpenGLPixelFormat. Any insight would be appreciated.

#import <Cocoa/Cocoa.h>

int main() {
[[NSAutoreleasePool alloc] init];
int numberOfColorBits = 24;
int numberOfAlphaBits = 8;
int numberOfDepthBits = 32;
NSOpenGLPixelFormatAttribute pixelFormatAttributes[] = {NSOpenGLPFADoubleBuffer, NSOpenGLPFAColorSize, numberOfColorBits, NSOpenGLPFAAlphaSize, numberOfAlphaBits, NSOpenGLPFADepthSize, numberOfDepthBits, NSOpenGLPFAMinimumPolicy, NSOpenGLPFAAccelerated, NSOpenGLPFAFullScreen, nil};
NSOpenGLPixelFormat* pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributesixelFormatAttributes];
if(pixelFormat == nil) {
NSLog(@"Unable to create a pixel format for an OpenGL hardware accelerated, double-buffered renderer with at least %d bits for color, %d bits for alpha, and %d bits for depth.", numberOfColorBits, numberOfAlphaBits, numberOfDepthBits);
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:21 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2