Initializing OpenGL without GLUT

后端 未结 7 1617
日久生厌
日久生厌 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
    0 讨论(0)
提交回复
热议问题