Hi folks,
I wanna render to a texture. The texture is of size 16 times 16 create like this:
driver->createRenderTargetTexture(dimension2di(16,16))
Now i wanna make a source rect and a destnation rect like
rect<s32> sourceRect(x0, y0, x,y);
rect<s32> destRect(x1, y1,x2, y2);
and finally call
driver->draw2DImage(renderTarget, destRect, sourceRect);
Now the question is, do in the source rect x0 and y0 have to be 0 and x and y have to be 15, or is it x0/y0=1 and x/y=16 ?
Thank you and have a nive weekend
Simon
Indexing in Rectangles and draw2DImage
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
I don't know of any screen coordinate systems that are 1-indexed. Irrlicht is certainly 0-indexed.
If you want to render to it, call driver->setRenderTarget(renderTarget,...), as per example 13.RenderToTexture.
Apologies if you already know this; it's not clear from your post.
Just so we're clear, that draws from renderTarget, not to it.I wanna render to a texture.
...
Code: Select all
driver->draw2DImage(renderTarget, destRect, sourceRect);
If you want to render to it, call driver->setRenderTarget(renderTarget,...), as per example 13.RenderToTexture.
Apologies if you already know this; it's not clear from your post.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way