No longer try creating rtt's for compressed image formats

Those are not supported by any graphic card and we just end up with invalid textures.
Returning 0 now instead in addRenderTargetTexture for OpenGL and D3D9.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6047 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien
2020-01-06 14:05:26 +00:00
parent 83d368cef4
commit 50f4bdecbe
2 changed files with 19 additions and 4 deletions

View File

@ -3269,6 +3269,9 @@ ITexture* CD3D9Driver::addRenderTargetTexture(const core::dimension2d<u32>& size
const io::path& name,
const ECOLOR_FORMAT format)
{
if ( IImage::isCompressedFormat(format) )
return 0;
CD3D9Texture* tex = new CD3D9Texture(this, size, name, ETT_2D, format);
if (tex)
{
@ -3287,6 +3290,9 @@ ITexture* CD3D9Driver::addRenderTargetTexture(const core::dimension2d<u32>& size
ITexture* CD3D9Driver::addRenderTargetTextureCubemap(const irr::u32 sideLen,
const io::path& name, const ECOLOR_FORMAT format)
{
if ( IImage::isCompressedFormat(format) )
return 0;
CD3D9Texture* tex = new CD3D9Texture(this, core::dimension2d<u32>(sideLen, sideLen), name, ETT_CUBEMAP, format);
if (tex)
{