mirror of https://github.com/axmolengine/axmol.git
Merge pull request #1951 from dumganhar/iss1697-render-texture
issue #1697: fixed two logical errors in CCRenderTexture::initWithWithAndHeight.
This commit is contained in:
commit
0465a950c7
|
@ -249,7 +249,7 @@ bool CCRenderTexture::initWithWidthAndHeight(int w, int h, CCTexture2DPixelForma
|
|||
|
||||
bool CCRenderTexture::initWithWidthAndHeight(int w, int h, CCTexture2DPixelFormat eFormat, GLuint uDepthStencilFormat)
|
||||
{
|
||||
CCAssert(m_ePixelFormat != kCCTexture2DPixelFormat_A8, "only RGB and RGBA formats are valid for a render texture");
|
||||
CCAssert(eFormat != kCCTexture2DPixelFormat_A8, "only RGB and RGBA formats are valid for a render texture");
|
||||
|
||||
bool bRet = false;
|
||||
void *data = NULL;
|
||||
|
@ -313,7 +313,7 @@ bool CCRenderTexture::initWithWidthAndHeight(int w, int h, CCTexture2DPixelForma
|
|||
// associate texture with FBO
|
||||
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_pTexture->getName(), 0);
|
||||
|
||||
if (m_uDepthRenderBufffer != 0)
|
||||
if (uDepthStencilFormat != 0)
|
||||
{
|
||||
//create and attach depth buffer
|
||||
glGenRenderbuffers(1, &m_uDepthRenderBufffer);
|
||||
|
|
Loading…
Reference in New Issue