mirror of
https://github.com/leozide/leocad
synced 2024-12-27 21:58:37 +01:00
Removed redundant state changes.
This commit is contained in:
parent
989373155f
commit
b6acab713d
1 changed files with 16 additions and 6 deletions
|
@ -944,13 +944,23 @@ void lcContext::SetVertexFormatConditional(int BufferOffset)
|
||||||
|
|
||||||
mVertexBufferOffset = VertexBufferPointer;
|
mVertexBufferOffset = VertexBufferPointer;
|
||||||
|
|
||||||
glEnableVertexAttribArray(1);
|
if (!mNormalEnabled)
|
||||||
glEnableVertexAttribArray(2);
|
{
|
||||||
glEnableVertexAttribArray(3);
|
glEnableVertexAttribArray(1);
|
||||||
|
mNormalEnabled = true; // todo: store state using an array
|
||||||
|
}
|
||||||
|
|
||||||
mNormalEnabled = true; // todo: store state using an array
|
if (!mTexCoordEnabled)
|
||||||
mTexCoordEnabled = true;
|
{
|
||||||
mColorEnabled = true;
|
glEnableVertexAttribArray(2);
|
||||||
|
mTexCoordEnabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!mColorEnabled)
|
||||||
|
{
|
||||||
|
glEnableVertexAttribArray(3);
|
||||||
|
mColorEnabled = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue