SFML community forums

Help => Graphics => Topic started by: gamecreator on May 15, 2019, 06:34:16 pm

Title: Drawing Outside of RenderTexture
Post by: gamecreator on May 15, 2019, 06:34:16 pm
I know the documentation states that using SetPixel outside of an Image is undefined.  What about drawing shapes on a RenderTexture?  The Draw documentation doesn't mention this, that I've found.  This is broken up into two questions then, because I'm drawing a thick line to a RenderTexture:

1.  Must the beginning and end points of a line be inside the RenderTexture?
2.  Must all pixels of a thick line be inside the RenderTexture?

Unlike SetPixel on an Image, I haven't had the program crash on me yet for drawing outside the RenderTarget but I'd like to know for sure.

Thank you.
Title: Re: Drawing Outside of RenderTexture
Post by: Hapax on May 15, 2019, 08:31:53 pm
RenderTexture is a render target similar to a window. You can treat it identically: if you draw outside a window, it doesn't render those pixels.
It still processes all of the vertices and geometry outside of the render target/texture so - as always - you should be avoiding drawing things that don't affect anything inside it. But, drawing from outside to inside - or from outside to outside through the inside - is fine, as with a window.
Title: Re: Drawing Outside of RenderTexture
Post by: gamecreator on May 15, 2019, 09:26:14 pm
Thank you.