1
Graphics / Re: SDL_RenderCopyEx equivalent
« on: May 05, 2025, 10:45:24 pm »
Everything kojack said would be the first things I would check. Did that fix it for you?
It looks suspiciously like you're using SFML 2..
I noticed that you're using integers for positions so could those positions be pixel positions instead of co-ordinates? If so, make sure your view is correct and convert between the types if necessary.
Also, consider if you are drawing in the range of the window.
sf::Sprite::rotate takes a float (in SFML 2) so you could just pass it as a float.
All in all, remember that for each frame, you must:
If you're using a render texture, you'd need to:
It looks suspiciously like you're using SFML 2..

I noticed that you're using integers for positions so could those positions be pixel positions instead of co-ordinates? If so, make sure your view is correct and convert between the types if necessary.
Also, consider if you are drawing in the range of the window.
sf::Sprite::rotate takes a float (in SFML 2) so you could just pass it as a float.
All in all, remember that for each frame, you must:
window.clear();
window.draw(someObject);
window.display();
window.draw(someObject);
window.display();
If you're using a render texture, you'd need to:
//RENDER TEXTURE: clear, draw, display
renderTexture.clear();
renderTexture.draw(someObject);
renderTexture.display();
// use a "render" sprite to draw the render texture
renderSprite.setTexture(renderTexture.getTexture());
// WINDOW: clear, draw, display
window.clear();
window.draw(renderSprite);
window.display();
renderTexture.clear();
renderTexture.draw(someObject);
renderTexture.display();
// use a "render" sprite to draw the render texture
renderSprite.setTexture(renderTexture.getTexture());
// WINDOW: clear, draw, display
window.clear();
window.draw(renderSprite);
window.display();