Nice forums
I edited code and its working now, thank you both ! Here is edited code if someone else is having problem with it.
int main()
{
// Create window
cout << "Init window"<< endl;
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
// deactivate its OpenGL context
cout << "Deactivate its OpenGL context"<< endl;
window.setActive(false);
// launch the rendering thread
cout << "Launch the rendering thread"<< endl;
sf::Thread thread1(&RenderingThread, &window);
thread1.launch();
while (window.isOpen())
{
// Events
sf::Event event;
while(window.pollEvent(event))
{
// Close request event
if(event.type == sf::Event::Closed)
window.close();
}
}
return 0;
}