SFML community forums

Help => General => Topic started by: mitrious on September 23, 2012, 12:21:44 am

Title: Threads and Drawing
Post by: mitrious on September 23, 2012, 12:21:44 am
Well, I'm creating a 2D game and using SFML, I've been wondering if it's worth dividing the logic and window handling of the game. Like this: putting the drawing and updating the window logic into one thread and the game logic in the main thread, making they work kinda together. I made a test to see if I could get it done and it seems like I can, at least I was drawing in one screen and updating logic on the other, but I didn't care so much about the FPS of both, I have an idea of how to do this, so I think it would work.

Anyways, is this a good idea?
Title: Re: Threads and Drawing
Post by: eXpl0it3r on September 23, 2012, 08:09:30 am
There are quite a few boundaries you have to keep track un a mulithreaded enviroment, so it may not be the most trivial although it might seem to work you still can have race conditions etc.
If you should do it depends highly on what your game is all about and if it's worth it. You might get a boost in FPS but then again the FPS count probably is alright already without the seperat threads...