Actually, I can't get anything to render on a RenderImage (or I can't get the RenderImage to be drawn on the screen, can't say).
Would it be a Clear() color or a sprite, the RenderImage remains empty.
The simplest example I can think of :
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(800,600), "SFML window");
sf::RenderImage renderImage;
if (!renderImage.Create(256, 256))
return -1;
sf::Sprite sprite(renderImage.GetImage());
while (window.IsOpened())
{
sf::Event Event;
while (window.PollEvent(Event))
{
if ((Event.Type == sf::Event::Closed) ||
((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape)))
window.Close();
}
renderImage.Clear(sf::Color::Red);
renderImage.Display();
window.Clear();
window.Draw(sprite);
window.Display();
}
return 0;
}
... should, correct me if I'm wrong, display a 256x256 red square at the top left corner of the window, with a black background.
On my laptop, it only renders the black background.
Though, I experience some very strange artifacts... For example while testing this code sample, the console window from which the code was executed suddenly had red borders around it.
Next time I ran it, it was the RenderWindow which got partially red... but on its "title", not in the render area.
I ran it another time, then saw nothing but the black background again.
To be sure, I disactivated completely the window effects of Ubuntu, but that didn't change a thing.
I hope I've been clearer than in my previous post.