码迷,mamicode.com
首页 > 系统相关 > 详细

opengl 在 Mac os x下默认是2.1的问题

时间:2014-12-25 20:40:49      阅读:761      评论:0      收藏:0      [点我收藏+]

标签:

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {

    // Insert code here to initialize your application

    NSRect mainDisplayRect = [[NSScreen mainScreen] frame];

    NSWindow *fullScreenWindow = [[NSWindow alloc] initWithContentRect: mainDisplayRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES];

    [fullScreenWindow setLevel:NSMainMenuWindowLevel+1];    

    [fullScreenWindow setOpaque:YES];

    [fullScreenWindow setHidesOnDeactivate:YES];

    NSOpenGLPixelFormatAttribute attrs[] =

    {

        NSOpenGLPFADoubleBuffer,

        kCGLPFAOpenGLProfile,

        NSOpenGLProfileVersion3_2Core,

        0

    };

    NSOpenGLPixelFormat* pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs];

    

    NSRect viewRect = NSMakeRect(0.0, 0.0, mainDisplayRect.size.width, mainDisplayRect.size.height);

    MyOpenGLView *fullScreenView = [[MyOpenGLView alloc] initWithFrame:viewRect pixelFormat: pixelFormat];

    [fullScreenWindow setContentView: fullScreenView];

    [fullScreenWindow makeKeyAndOrderFront:self];

}




输出:

2014-12-25 19:35:16.291 GoldenTriangle[662:20256] Opengl version: 2.1 INTEL-10.0.86

2014-12-25 19:35:16.399 GoldenTriangle[662:20256] Opengl version: 2.1 INTEL-10.0.86


2014-12-25 19:35:16.410 GoldenTriangle[662:20256] Opengl version: 4.1 INTEL-10.0.86


opengl 在 Mac os x下默认是2.1的问题

标签:

原文地址:http://my.oschina.net/luyuhx/blog/360549

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!