SFML community forums
Help => Graphics => Topic started by: tmac on July 07, 2008, 10:50:23 pm
-
Hello
I have a RenderWindow that for now contains only OpenGL rendered graphics. But when I use the screenshot code in the tutorial:
sf::Image Screen = App.Capture();
Screen.SaveToFile("screenshot.jpg");
all I get is a black image. Is Capture() supposed to capture OpenGL graphics? And If I write text using RenderWindow::Draw(), it does not appear in the screenshot either.
Btw, is it possible to save as PNG? I couldn't find anything in the Image class to set the image format.
Debian Sid, SFML1.3
Best regards,
Torquil Sørensen
-
all I get is a black image
It captures the current contents of the screen, so it may vary depending on where you locate your call in the main loop. The right place should be between the last Draw and Display.
Btw, is it possible to save as PNG? I couldn't find anything in the Image class to set the image format.
Yes, PNG is supported. The format is simply deduced from the filename extension.
-
Thanks, it works fine when I put the command immediately before the Display() as you said. I should have thought of that :-)
Best regards
Torquil Sørensen