mirror of
https://github.com/leozide/leocad
synced 2024-12-28 22:23:35 +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,16 +944,26 @@ void lcContext::SetVertexFormatConditional(int BufferOffset)
|
||||||
|
|
||||||
mVertexBufferOffset = VertexBufferPointer;
|
mVertexBufferOffset = VertexBufferPointer;
|
||||||
|
|
||||||
|
if (!mNormalEnabled)
|
||||||
|
{
|
||||||
glEnableVertexAttribArray(1);
|
glEnableVertexAttribArray(1);
|
||||||
glEnableVertexAttribArray(2);
|
|
||||||
glEnableVertexAttribArray(3);
|
|
||||||
|
|
||||||
mNormalEnabled = true; // todo: store state using an array
|
mNormalEnabled = true; // todo: store state using an array
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!mTexCoordEnabled)
|
||||||
|
{
|
||||||
|
glEnableVertexAttribArray(2);
|
||||||
mTexCoordEnabled = true;
|
mTexCoordEnabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!mColorEnabled)
|
||||||
|
{
|
||||||
|
glEnableVertexAttribArray(3);
|
||||||
mColorEnabled = true;
|
mColorEnabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void lcContext::SetVertexFormat(int BufferOffset, int PositionSize, int NormalSize, int TexCoordSize, int ColorSize, bool EnableNormals)
|
void lcContext::SetVertexFormat(int BufferOffset, int PositionSize, int NormalSize, int TexCoordSize, int ColorSize, bool EnableNormals)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue