www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: MichaelJPCT on November 01, 2020, 05:24:12 am

Title: getRenderTarget method?
Post by: MichaelJPCT 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.
Title: Re: getRenderTarget method?
Post by: AeroShark333 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.