Skip to content

Commit

Permalink
Merge pull request cocos2d#330 from yangws/master
Browse files Browse the repository at this point in the history
  • Loading branch information
Walzer committed Jun 28, 2011
2 parents 5117844 + 9e48033 commit b1fae51
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions cocos2dx/effects/CCGrid.cpp
Expand Up @@ -210,8 +210,9 @@ namespace cocos2d
CCSize winSize = CCDirector::sharedDirector()->getWinSizeInPixels();

glLoadIdentity();
// glViewport((GLsizei)0, (GLsizei)0, (GLsizei)winSize.width, (GLsizei)winSize.height);
CCDirector::sharedDirector()->getOpenGLView()->setViewPortInPoints(0, 0, winSize.width, winSize.height);

// set view port for user FBO, fixed bug #543 #544
glViewport((GLsizei)0, (GLsizei)0, (GLsizei)winSize.width, (GLsizei)winSize.height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
ccglOrtho(0, winSize.width, 0, winSize.height, -1024, 1024);
Expand All @@ -223,8 +224,8 @@ namespace cocos2d
{
CCSize winSize = CCDirector::sharedDirector()->getDisplaySizeInPixels();

// glViewport(0, 0, (GLsizei)winSize.width, (GLsizei)winSize.height);
CCDirector::sharedDirector()->getOpenGLView()->setViewPortInPoints(0, 0, winSize.width, winSize.height);
// set view port for user FBO, fixed bug #543 #544
glViewport(0, 0, (GLsizei)winSize.width, (GLsizei)winSize.height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(60, (GLfloat)winSize.width/winSize.height, 0.5f, 1500.0f);
Expand Down Expand Up @@ -264,6 +265,8 @@ namespace cocos2d

glBindTexture(GL_TEXTURE_2D, m_pTexture->getName());

// restore projection for default FBO .fixed bug #543 #544
CCDirector::sharedDirector()->setProjection(CCDirector::sharedDirector()->getProjection());
blit();
}

Expand Down

0 comments on commit b1fae51

Please sign in to comment.