Merge pull request #1951 from dumganhar/iss1697-render-texture

issue #1697: fixed two logical errors in CCRenderTexture::initWithWithAndHeight.
This commit is contained in:
minggo 2013-02-04 00:28:54 -08:00
commit 0465a950c7
1 changed files with 2 additions and 2 deletions

View File

@ -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);