Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Drawing/Display operations on worker thread  (Read 1464 times)

0 Members and 2 Guests are viewing this topic.

Qix

  • Full Member
  • ***
  • Posts: 139
  • I am Qix!
    • View Profile
    • Natoga Technologies
Drawing/Display operations on worker thread
« on: September 30, 2012, 12:33:55 pm »
Stemming from this thread, 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 seems to say that OpenGL contexts are thread safe for Mac, but I'd like to confirm.
« Last Edit: September 30, 2012, 12:35:49 pm by Qix »
~ Qix
Creator of Rippl Studio
Code: [Select]
<danharibo> iostream: I don't do enough drugs to think that's a good idea.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Drawing/Display operations on worker thread
« Reply #1 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.
SFML / OS X developer

Qix

  • Full Member
  • ***
  • Posts: 139
  • I am Qix!
    • View Profile
    • Natoga Technologies
Re: Drawing/Display operations on worker thread
« Reply #2 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!
~ Qix
Creator of Rippl Studio
Code: [Select]
<danharibo> iostream: I don't do enough drugs to think that's a good idea.