Hi all!
I'm having a problem, maybe an easy to solve one, nevertheless I can't find any working solution.
I want to capture whole window content, pass it to another method and display as background. At first I tought about
sf::Image
class so I created an object and tried to get what's on the screen. But even though one cycle of rendering stuff from the game passed all I got captured was the loading screen. I started some research and found out it's not the best option, because it's slow. OK then, I wrote Sleep(5000); over the capturing call and it didn't helped at all. But then I used more recommended code which is
sf::Texture::update();
Now it's worse, because I get that error:
Assertion failed: x + window.getSize().x <= m_size.x, file D:\sfml-release\_Sources\SFML\src\SFML\Graphics\Texture.cpp, line 407
Fine. There were thousands of errors in my life, aint one like that. I googled it and I found it might be some problem with including *.dll files to my project. So I checked all of them, for debug as well as release version and didn't find any mistake. Now I'm desperate, this is my code:
if (!cut_scene)
{
Texture tex;
tex.update(window);
cut_scenes.run(tex);
cut_scene = true;
}
When I change the line with updating texture with window content to loading to the texture a file it works perfectly.
I'm sorry, if this error is easy to fix but I really googled much and found nothing helpful. I'm also sorry for my english, which is probably awful.
Thank you in advance for help.