Page 1 of 1

How to handle CEGUI in multi thread

Posted: Wed Apr 04, 2012 04:25
by Michael.Zhang
I set up a new thread by _beginthreadex method.
And when i using setText method in this thread, some unknown error happens.
So how can i use CEGUI in multi thread.

Re: How to handle CEGUI in multi thread

Posted: Wed Apr 04, 2012 10:25
by Kulik
You have to use some sort of a synchronisation scheme between threads as CEGUI isn't thread safe.

Most likely a queue that gets locked before each frame and all actions from it are performed in the CEGUI thread, then CEGUI gets rendered.

Google should get you plenty of material for this.