Avoid using a plain texture as RTT if screensize is too small.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1686 dfc29bdd-3216-0410-991c-e03cc46cb475
master
hybrid 2008-11-04 23:25:03 +00:00
parent 04e788aeeb
commit fe09f2ebbc
1 changed files with 6 additions and 1 deletions

View File

@ -2582,7 +2582,12 @@ ITexture* COpenGLDriver::addRenderTargetTexture(const core::dimension2d<s32>& si
else
#endif
{
rtt = addTexture(size, name, ECF_A8R8G8B8);
// 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);
if (rtt)
{
rtt->grab();