Hi there,
I have seperate render-class of wich one function runs in a seperate sf::Thread to draw...
In another thread i want to load my textures and sprites, and manipulate them there
So far so good.
but if i want to load a texture, i have to activate the window in the thread i want to load the texture, wich would pause rendering.
so...
Something like this works:
// create the window
//...
//set up the renderclass
Render renderer;
renderer.setwindow.....
...
//load textures and set up sprites...
//copy them into render class
window.setActive(false);
sf::Thread renderthr(&Render::renderthread, &render); // create our renderer-thread
renderthr.launch(); //start the renderer
and something like this gives me a blank screen and doesn't draw anything
// create the window
//...
window.setActive(false);
//set up the renderclass
Render renderer;
renderer.setwindow.....
...
//load textures and set up sprites...
//copy them into render class
sf::Thread renderthr(&Render::renderthread, &render); // create our renderer-thread
renderthr.launch(); //start the renderer
i hope this is enough code to explain my problem...
basically something like
renderer.pause(true);
window.setactive(true);
//loadmytexture and create the sprite
//copy the sprity into the rendererclass
window.setactive(false);
renderer.pause(false);
would work but that is suboptimal...