1
Graphics / Re: RenderWindow::draw not working on different thread?
« on: January 02, 2013, 08:59:10 pm »
cool, thanks!
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
void main() {
Thread mainThread( &GameManager::Init, GetGameManager() );
sf::Event evt;
bool running = true;
while( running ) {
if( renderWindow == NULL ) {
ThreadSleep( PTimeMS( 25 ) );
continue;
}
while( renderWindow->GetEvent( evt ) ) {
if( evt.Type == sf::Event::Closed ) {
GetGameManager()->StopGame();
running = false;
}
}
ThreadSleep( PTimeMS( 10 ) );
}
mainThread.join();
}
class A {
A();
sf::Shape s;
};
A() {
s = sf::Shape::Circle( ... );
}
SFML (in this context) just uses a std::vector with its default allocator. In fact I think that you should be able to reproduce the problem without SFML.