Initializing OpenGL without GLUT

后端 未结 7 1627
日久生厌
日久生厌 2020-12-02 07:26

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 av

7条回答
  •  情歌与酒
    2020-12-02 08:28

    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

    • The entire guide for Mac OS X OpenGL development
    • Carbon: aglCreateContext
    • Cocoa: Create (or subclass) an NSOpenGLView. They create their own context, and you can read their method documentation to find how to make it current.
    • CoreGraphicsLayer: CGLCreateContext

    Linux

    • glx: glXCreateContext

提交回复
热议问题