Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GLUT on OS X with OpenGL 3.2 Core Profile

Is it possible to use GLUT on OS X Lion or OS X Mountain Lion using core profile (so I can use GLSL 1.50)?

Can I use the built in GLUT or do I need to use a third-part library such as FreeGLUT?

And is there any simple 'Hello world' applications available for OS X with either an XCode project or a make-file?

like image 863
Mortennobel Avatar asked Jun 29 '12 09:06

Mortennobel


1 Answers

You need at least Mac OS X Lion (OS X 10.7 or higher) for the basic support of OpenGL 3.2. To use the OpenGL 3.2 Core Profile, just add

glutInitDisplayMode(GLUT_3_2_CORE_PROFILE | ... | ...);

in your main-function. You can check it by

std::printf("%s\n%s\n", 
        glGetString(GL_RENDERER),  // e.g. Intel HD Graphics 3000 OpenGL Engine
        glGetString(GL_VERSION)    // e.g. 3.2 INTEL-8.0.61
        );
like image 55
Michael Dorner Avatar answered Sep 29 '22 00:09

Michael Dorner