开发者

Threaded rendering with NSOpenGLView

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜