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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Jo

Pages: [1]
1
General discussions / SFML 2.0 - RenderImage is cleared on first display
« on: August 18, 2010, 06:43:51 pm »
Oh, that was too obvious. Thanks for your help.

2
General discussions / SFML 2.0 - RenderImage is cleared on first display
« on: August 17, 2010, 09:56:53 pm »
Hi everyone.

I just switched to SFML 2.0 (SVN from today) and found some strange behaviour, as the following code shows:

Code: [Select]

#include <SFML/Graphics.hpp>
 
int main() {
if (!sf::RenderImage::IsAvailable())
return -1;

sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");

sf::RenderImage image;
if (!image.Create(500, 500))
return -1;

sf::Sprite sprite(image.GetImage());
//window.Draw(sprite);//Uncomment to make it work as expected

image.Clear(sf::Color::Red);
while (window.IsOpened()) {
window.Clear();

window.Draw(sprite);

window.Display();
}
}

Using this code, the image will be shown black though it's been filled red before. If it's drawn onto the screen once before filling, it's red as expected.

If this is a bug, this is the report, if it's a feature, I'd like to know more about it.

Jo

Pages: [1]