Refactor COpenGLCoreRenderTarget::setTexture slightly.
Just making it easier to see when DepthStencil can be set (we never have a depth texture format when we have no texture). git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5833 dfc29bdd-3216-0410-991c-e03cc46cb475master
parent
52e41751a8
commit
7aaf3cce9d
|
@ -122,15 +122,11 @@ public:
|
|||
needSizeUpdate = true;
|
||||
TOpenGLTexture* currentTexture = (depthStencil && depthStencil->getDriverType() == DriverType) ? static_cast<TOpenGLTexture*>(depthStencil) : 0;
|
||||
|
||||
GLuint textureID = 0;
|
||||
|
||||
if (currentTexture)
|
||||
{
|
||||
if (currentTexture->getType() == ETT_2D)
|
||||
textureID = currentTexture->getOpenGLTextureName();
|
||||
else
|
||||
os::Printer::log("This driver doesn't support depth/stencil to cubemaps.", ELL_WARNING);
|
||||
}
|
||||
{
|
||||
GLuint textureID = currentTexture->getOpenGLTextureName();
|
||||
|
||||
const ECOLOR_FORMAT textureFormat = (textureID != 0) ? depthStencil->getColorFormat() : ECF_UNKNOWN;
|
||||
if (IImage::isDepthFormat(textureFormat))
|
||||
|
@ -138,6 +134,12 @@ public:
|
|||
DepthStencil = depthStencil;
|
||||
DepthStencil->grab();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
os::Printer::log("This driver doesn't support depth/stencil to cubemaps.", ELL_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
RequestDepthStencilUpdate = true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue