mirror of
https://github.com/leozide/leocad
synced 2024-12-26 21:58:44 +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;
|
||||
|
||||
glEnableVertexAttribArray(1);
|
||||
glEnableVertexAttribArray(2);
|
||||
glEnableVertexAttribArray(3);
|
||||
if (!mNormalEnabled)
|
||||
{
|
||||
glEnableVertexAttribArray(1);
|
||||
mNormalEnabled = true; // todo: store state using an array
|
||||
}
|
||||
|
||||
mNormalEnabled = true; // todo: store state using an array
|
||||
mTexCoordEnabled = true;
|
||||
mColorEnabled = true;
|
||||
if (!mTexCoordEnabled)
|
||||
{
|
||||
glEnableVertexAttribArray(2);
|
||||
mTexCoordEnabled = true;
|
||||
}
|
||||
|
||||
if (!mColorEnabled)
|
||||
{
|
||||
glEnableVertexAttribArray(3);
|
||||
mColorEnabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue