SFML community forums

Help => Graphics => Topic started by: Qix on September 30, 2012, 12:33:55 pm

Title: Drawing/Display operations on worker thread
Post by: Qix on September 30, 2012, 12:33:55 pm
Stemming from this thread (http://en.sfml-dev.org/forums/index.php?topic=4116.0), my question is whether or not drawing functionality can take place in a separate thread (so long as the window events are handled in the main thread) on Mac OSX?

And yes, I know about setActive() :)

EDIT: This ticket (https://github.com/SFML/SFML/issues/159) seems to say that OpenGL contexts are thread safe for Mac, but I'd like to confirm.
Title: Re: Drawing/Display operations on worker thread
Post by: Hiura on September 30, 2012, 03:23:41 pm
Yes, you can draw stuff from a worker thread as long as :
- your window is created on the main thread;
- event are manager on the main thread.

If you have some issue with it, let me know. That's something I haven't so extensively tested.
Title: Re: Drawing/Display operations on worker thread
Post by: Qix on September 30, 2012, 04:29:09 pm
Will do. I asked because of a similar question/issue I had, the answer being to call setActive(false) on the main thread after the window was created.

Thanks Hiura!