Hello,
I'm using SFML 2.0 (compiled from the source files) on windows and I am trying to use the rendertexture. Which works fine as long as I do not move anything around, when I animated a sprite to move I got the following effect:
The code for this is a bit complex, however the core of it is the following:
renderTexture->clear();
/// Draw everything!
RenderingManager::RenderObjects(renderTexture);
renderTexture->display();
// Clear screen
window->clear();
window->draw(*renderSprite);
// Update the window
window->display();
RenderingManager::ClearRenderList();
Which is built around the example code for rendertexture usage:
// Create a new render-window
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
// Create a new render-texture
sf::RenderTexture texture;
if (!texture.create(500, 500))
return -1
// The main loop
while (window.isOpen())
{
// Event processing
// ...
// Clear the whole texture with red color
texture.clear(sf::Color::Red);
// Draw stuff to the texture
texture.draw(sprite); // sprite is a sf::Sprite
texture.draw(shape); // shape is a sf::Shape
texture.draw(text); // text is a sf::Text
// We're done drawing to the texture
texture.display();
// Now we start rendering to the window, clear it first
window.clear();
// Draw the texture
sf::Sprite sprite(texture.getTexture());
window.draw(sprite);
// End the current frame and display its contents on screen
window.display();
}
I am running this on a AMD HD7870 Eyefinity card on 2 monitors with the latest drivers installed.
// Zap