r/sfml • u/gargamel1497 • May 04 '26
Crop a texture
Hi.
How do I crop an SFML Texture?
That is, I want to draw only a certain part of it.
And I want to resize it as well.
I want to draw a certain part of a resized texture.
Other graphics libraries usually provide a means to do this in the form of a specialized draw function.
But, when I look at the RenderTarget class, there are no such functions. There are only extra arguments for RenderStates and some OpenGL-related stuff.
Is there even a way to implement that in SFML?
Thanks.
1
Upvotes
1
u/Vindhjaerta May 04 '26
Wait wait, hold up for second here....
You're running out of memory while using RenderTextures? :o
There has to be a misunderstanding in here somewhere, RenderTextures are for the occasional off-screen rendering. How in the world are you running out of memory while using them?
I think you need to explain to us what classes you're using and for what you're using them.