TomorrowPlusX
2004.11.10, 10:54 AM
I recently adapted my game engine to use a separate thread ( a pthread, not NSThread ) to run the physics as opposed to a timer, and I saw a fair decline in CPU use ( about 8 to 10% ), which is very encouraging. So I'm considering using a thread to schedule display.
That said, I'm aware that on OS X any calls to OpenGL must be made from the same thread as which created the context.
So, my question is, does calling display on an NSOpenGLView draw the view directly in the caller's thread, or enqueue an event to the application object to redisplay in the app thread?
I could write a test to verify, but it would take time and I figure somebody here's got to know ;)
Thanks?
That said, I'm aware that on OS X any calls to OpenGL must be made from the same thread as which created the context.
So, my question is, does calling display on an NSOpenGLView draw the view directly in the caller's thread, or enqueue an event to the application object to redisplay in the app thread?
I could write a test to verify, but it would take time and I figure somebody here's got to know ;)
Thanks?