Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #import "MyOpenGLView.h"
- int main(int argc, const char *argv[])
- {
- NSApplicationLoad();
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- NSLog(@"Pool allocated");
- NSRect mainDisplayRect = [[NSScreen mainScreen] frame];
- NSWindow *fullScreenWindow = [[[NSWindow alloc] initWithContentRect: mainDisplayRect styleMask: NSBorderlessWindowMask backing: NSBackingStoreBuffered defer: YES] autorelease];
- NSLog(@"window allocated");
- [fullScreenWindow setLevel: NSMainMenuWindowLevel+1];
- NSLog(@"Level set");
- [fullScreenWindow setOpaque: YES];
- [fullScreenWindow setHidesOnDeactivate: YES];
- NSOpenGLPixelFormatAttribute attrs[] =
- {
- NSOpenGLPFADoubleBuffer,
- NSOpenGLPFAFullScreen,
- 0
- };
- NSLog(@"Attributes set");
- NSOpenGLPixelFormat* pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes: attrs] autorelease];
- NSRect viewRect = NSMakeRect(0.0, 0.0, mainDisplayRect.size.width, mainDisplayRect.size.height);
- MyOpenGLView *fullScreenView = [[[MyOpenGLView alloc] initWithFrame: viewRect pixelFormat: pixelFormat] autorelease];
- [fullScreenWindow setContentView: fullScreenView];
- [fullScreenWindow makeKeyAndOrderFront: fullScreenWindow];
- [pool drain];
- NSLog(@"Pool drained");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement