remove kmGLFreeAll call

This commit is contained in:
Huabing.Xu 2014-04-03 17:40:14 +08:00
parent 14f004b12a
commit 1b8e45fe19
3 changed files with 22 additions and 2 deletions

View File

@ -434,11 +434,31 @@ void Director::initMatrixStack()
kmMat4 identity;
kmMat4Identity(&identity);
while (!_modelViewMatrixStack.empty())
{
_modelViewMatrixStack.pop();
}
while (!_projectionMatrixStack.empty())
{
_projectionMatrixStack.pop();
}
while (!_textureMatrixStack.empty())
{
_textureMatrixStack.pop();
}
_modelViewMatrixStack.push(identity);
_projectionMatrixStack.push(identity);
_textureMatrixStack.push(identity);
}
void Director::resetMatrixStack()
{
initMatrixStack();
}
void Director::popMatrix(MATRIX_STACK_TYPE type)
{
if(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW == type)

View File

@ -106,6 +106,7 @@ public:
void loadMatrix(MATRIX_STACK_TYPE type, const kmMat4& mat);
void multiplyMatrix(MATRIX_STACK_TYPE type, const kmMat4& mat);
kmMat4 getMatrix(MATRIX_STACK_TYPE type);
void resetMatrixStack();
public:
static const char *EVENT_PROJECTION_CHANGED;
static const char* EVENT_AFTER_UPDATE;

View File

@ -65,8 +65,7 @@ namespace GL {
void invalidateStateCache( void )
{
kmGLFreeAll();
Director::getInstance()->resetMatrixStack();
s_currentProjectionMatrix = -1;
s_vertexAttribPosition = false;
s_vertexAttribColor = false;