Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: sf::Image::SaveToFile() freezes my computer  (Read 1999 times)

0 Members and 1 Guest are viewing this topic.

chocobn

  • Newbie
  • *
  • Posts: 39
    • View Profile
sf::Image::SaveToFile() freezes my computer
« on: March 29, 2011, 07:29:19 pm »
Hello,
I'm having some trouble with one function is SFML. I'm developing one software since september, and i need to export an animation frame by frame. I have a loop, and in this loop i redraw an sfml window for displaying the frame, and i export it with the SaveToFile method, from sf::Image.

My code works perfectly, it makes the frame by frame animation and put it into one folder. But when i have to compute lots of frames, it simply freezes the computer completely! it does not seems to be because i uses all the available memory, because it is not laggy or nothing like that. For It works perfectly until the 29th frame, and at the 30th my computer is completely frozen. I can't do anything, even move the cursor.

I'm using Linux Ubuntu, and SFML 2.0, and it does seems to be normal...

Does anyone had that kind of trouble with SFML???

[EDIT] this is the code executed in each loop who seems to be problematic :
Code: [Select]

m_app->canvasWindow->canvas->setViewFromFrame(counter);
std::cout<<counter<<std::endl;
std::string numFrame;
std::stringstream numFrameSS;
numFrameSS << counter;
numFrame = numFrameSS.str();
m_app->canvasWindow->canvas->getFlattenedImage().SaveToFile("res/out/"+numFrame+".bmp");


It cames directly from my project, which is quite huge, so sorry if my code is not reader-friendly and messy...