1
Window / Window and multiple threads
« on: September 19, 2011, 07:51:15 pm »
I have a thread one where i create the window:
Then i pass the wnd ponter to two other threads.
In thread two i query window for events:
And in thread three I draw in it:
The window is of course protected by proper locking.
This causes lots of
Code: [Select]
sf::Window* wnd = new sf::Window(sf::VideoMode(400, 300), "some title", sf::Style::Close);
Then i pass the wnd ponter to two other threads.
In thread two i query window for events:
Code: [Select]
sf::Event event;
while (true)
while(wnd->PollEvent(event))
{
//....
}
And in thread three I draw in it:
Code: [Select]
while (true)
{
//...
wnd->Display();
}
The window is of course protected by proper locking.
This causes lots of
Quote
Failed to activate window's contextmessages to the console. Is what i am trying to do even possible?