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

- (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


郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。