When i try to get existing window by handle, application crashes returning code -1073740771 (0xC000041D)
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
#include <math.h>
#include <gui.h>
void shutdown(){
exit(0);
}
void render(sf::WindowHandle windowhandle){
printf("Starting render thread for window %u...",(unsigned int)windowhandle);
sf::RenderWindow window(windowhandle); //crash
/*
while(window.isOpen())
{
sf::Event event;
while (window.pollEvent(event)){
if (event.type == sf::Event::Closed)
shutdown();
}
...
window.display();
}
*/
}
int main(){
sf::RenderWindow window(sf::VideoMode(800,600),"cool thinge",sf::Style::Close);
window.setVerticalSyncEnabled(true);
sf::Thread thrender(&render,window.getSystemHandle());
thrender.launch();
return 0;
}