Initializing OpenGL without GLUT

TholePin picture TholePin · May 18, 2009 · Viewed 48.7k times · Source

every introduction and sample that I can find seems to use GLUT or some other framework to "initialize" OpenGL. Is there a way of initializing OpenGL with just what is available in GL and GLU? If not, then what is GLUT doing that is not possible without it?

Answer

fixermark picture fixermark · May 18, 2009

As luke noted, the code to create and bind the context is specific to each windowing platform.

Here are some functions to get you started in terms of initializing OpenGL on specific platforms:

Windows (a tutorial is here)

  • wglCreateContext(hDC)

Mac OS X -- OS X has essentially three options: Carbon, Cocoa, and the underlying Core Graphics Layer

Linux

  • glx: glXCreateContext