NSOpenGLView and GLFW


Newbie question: Reading the docs, it’s all about creating OpenGL windows and going from there, but on my Mac app, I really want to have a NIB with an NSOpenGLView in it, so I can bind things to the application, and then somehow get GLFW to use the context (and pixel format ?) provided by the NSOpenGLView.

To expand on that: specifically, there is a host application which loads many plugins. One of the plugins is a 3D plot window, and I’d like to make that 3D plot window be based on OpenGL. The plugin is loaded on demand, and can provide an NSView to the host application - so Ideally I’d like to provide an NSView containing an NSOpenGLView, that the plugin can manipulate using GLFW, if that’s possible.

Is it possible to combine these together ? I see references to NSOpenGLView in the changelog, but if it’s in the docs somewhere, I’m missing it :frowning:



GLFW is designed for platform independent window creation and input / event handling for OpenGL and Vulkan. If you’re window is being created elsewhere you likely just want to use OpenGL and native event/input handling.

However if you want to make the window using GLFW you can get hold of the platform information you need using the native access functions.