How to handle CEGUI in multi thread

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

Michael.Zhang
Just popping in
Just popping in
Posts: 9
Joined: Sun Mar 11, 2012 18:14

How to handle CEGUI in multi thread

Postby Michael.Zhang » Wed Apr 04, 2012 04:25

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.

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: How to handle CEGUI in multi thread

Postby Kulik » Wed Apr 04, 2012 10:25

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.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 3 guests