Commit a597253b authored by hybrid's avatar hybrid

Create smaller RTTs instead of none if screen size is limiting the desired size.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1702 dfc29bdd-3216-0410-991c-e03cc46cb475
parent d5a5d9b5
......@@ -2583,11 +2583,10 @@ ITexture* COpenGLDriver::addRenderTargetTexture(const core::dimension2d<s32>& si
#endif
{
// the simple texture is only possible for size <= screensize
// TODO: Needs to be checked on setRenderTarget instead, in
// order to cope with screen size changes
if ((size.Width <= ScreenSize.Width) &&
(size.Height<= ScreenSize.Height))
rtt = addTexture(size, name, ECF_A8R8G8B8);
// we try to find an optimal size with the original constraints
core::dimension2di destSize(core::min_(size.Width,ScreenSize.Width), core::min_(size.Height,ScreenSize.Height));
destSize = destSize.getOptimalSize((size==size.getOptimalSize()), false, false);
rtt = addTexture(destSize, name, ECF_A8R8G8B8);
if (rtt)
{
rtt->grab();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment