OpenGL defaults to 2.1 under MAC OS X

Source: Internet
Author: User

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

}




Output:

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 defaults to 2.1 under MAC OS X

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.