setRenderTarget documentation

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
CuteAlien
Admin
Posts: 9652
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

setRenderTarget documentation

Post by CuteAlien »

Just something that was confusing me for a while the last hour (or maybe I'm still confused and everything is fine?) ...

setRenderTarget says that setRenderTarget (0) restores the previous rendertarget - also the variables used in the D3D drivers are called PrevRenderTarget. But I think that's not what is actually done (and probably also wouldn't make sense to do). As far as I can see it does not restore the previous RT but the original default RT (aka - the screen). So only the previous if you just use a single rendertarget, but not if you work with more than one. Or said different - it doesn't update the PrevRenderTarget when it already has one.

So I suppose the code is correct (except variable-names), but the documentation probably not.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: setRenderTarget documentation

Post by hybrid »

Yeah, wording seems to come from the time when only one RTT was available. The 0 restores the initial framebuffer as target.
Post Reply