Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Drawing Outside of RenderTexture  (Read 1558 times)

0 Members and 1 Guest are viewing this topic.

gamecreator

  • Newbie
  • *
  • Posts: 17
    • View Profile
Drawing Outside of RenderTexture
« 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.

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Drawing Outside of RenderTexture
« Reply #1 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.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

gamecreator

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Drawing Outside of RenderTexture
« Reply #2 on: May 15, 2019, 09:26:14 pm »
Thank you.

 

anything