开发者

Threaded rendering with NSOpenGLView

开发者 https://www.devze.com 2022-12-20 06:04 出处:网络
I have an old AGL-based OpenGL windowing system that I am updating to use NSOpenGLView. The engine using it needs to run in its own loop in a separate开发者_C百科 thread and I am having trouble gettin

I have an old AGL-based OpenGL windowing system that I am updating to use NSOpenGLView. The engine using it needs to run in its own loop in a separate开发者_C百科 thread and I am having trouble getting that to work. With AGL, I created the context in the loop thread, so there was no issue, but I'm a little bit confused about the way to do that with NSOpenGLView. I'd like to be able to instantiate it in the nib, so I don't want to create the whole thing in the loop thread. Is it even possible otherwise?

Hope it makes sense.


Your separate thread can attach the NSOpenGLContext it creates to an existing NSOpenGLView by using the setOpenGLContext: method.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号