How to write a Cocoa OpenGL app in C++?

后端 未结 2 1142
情歌与酒
情歌与酒 2021-02-11 00:07

I\'m writing an application that needs to use OpenGL, on the Mac, in C++.

Is there anyway I can get Cocoa to just give me an OpenGL context and let me do my work in C++?

2条回答
  •  日久生厌
    2021-02-11 00:47

    Look into NSOpenGLView. In drawRect: in your subclass, you can access the view's context and call your OpenGL code.

提交回复
热议问题