Author Topic: getRenderTarget method?  (Read 1925 times)

Offline MichaelJPCT

  • float
  • ****
  • Posts: 264
    • View Profile
getRenderTarget method?
« on: November 01, 2020, 05:24:12 am »
Hi Egon,
i thought of a situation which i am not sure is necessary at all, that temporarily switching the render target.
if that happens, a getRenderTarget method can ease the problem of (the engine user) keeping track which texture is the current target.
like this:
b=getRenderTarget();
setRenderTarget(a);
render something;
setRenderTarget(b);

but if the engine doesn't call setRenderTarget, only the app code call it, then the user can use a global variable to keep track of the target texture. then getRenderTarget is unnecessary.
and temporarily switching render target might be a wrong thing to do.

Offline AeroShark333

  • float
  • ****
  • Posts: 319
    • View Profile
Re: getRenderTarget method?
« Reply #1 on: November 01, 2020, 04:57:58 pm »
I'm not sure what you entirely mean...
I think it wouldn't be necessary as the engine doesn't create RenderTextures on its own that are bound to the FrameBuffer.
The only RenderTextures that the FrameBuffer uses are made by you, so you should have control over these RenderTexture instances..?
If no RenderTexture is set, "null" is used.