mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 18:21:16 +02:00
Move #if #else #endif for convenience
This is a convenience change. The double '{' created by the #else messes up Xcode autoindentation. It won't that way and the fact that useClientState is a const set to false when SUPPORT_LEGACY_OPENGL, the code inside the if should still get optimised out by the compiler.
This commit is contained in:
parent
3d7a834356
commit
526ec3d489
1 changed files with 13 additions and 11 deletions
|
@ -66,22 +66,23 @@ void GLBackend::updateInput() {
|
||||||
newActivation.set(attrib._slot);
|
newActivation.set(attrib._slot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Manage Activation what was and what is expected now
|
// Manage Activation what was and what is expected now
|
||||||
for (unsigned int i = 0; i < newActivation.size(); i++) {
|
for (unsigned int i = 0; i < newActivation.size(); i++) {
|
||||||
bool newState = newActivation[i];
|
bool newState = newActivation[i];
|
||||||
if (newState != _input._attributeActivation[i]) {
|
if (newState != _input._attributeActivation[i]) {
|
||||||
#if defined(SUPPORT_LEGACY_OPENGL)
|
#if defined(SUPPORT_LEGACY_OPENGL)
|
||||||
if (i < NUM_CLASSIC_ATTRIBS) {
|
const bool useClientState = i < NUM_CLASSIC_ATTRIBS;
|
||||||
|
#else
|
||||||
|
const bool useClientState = false;
|
||||||
|
#endif
|
||||||
|
if (useClientState) {
|
||||||
if (newState) {
|
if (newState) {
|
||||||
glEnableClientState(attributeSlotToClassicAttribName[i]);
|
glEnableClientState(attributeSlotToClassicAttribName[i]);
|
||||||
} else {
|
} else {
|
||||||
glDisableClientState(attributeSlotToClassicAttribName[i]);
|
glDisableClientState(attributeSlotToClassicAttribName[i]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
#else
|
|
||||||
{
|
|
||||||
#endif
|
|
||||||
if (newState) {
|
if (newState) {
|
||||||
glEnableVertexAttribArray(i);
|
glEnableVertexAttribArray(i);
|
||||||
} else {
|
} else {
|
||||||
|
@ -89,7 +90,7 @@ void GLBackend::updateInput() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
(void) CHECK_GL_ERROR();
|
(void) CHECK_GL_ERROR();
|
||||||
|
|
||||||
_input._attributeActivation.flip(i);
|
_input._attributeActivation.flip(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -123,8 +124,12 @@ void GLBackend::updateInput() {
|
||||||
GLenum type = _elementTypeToGLType[attrib._element.getType()];
|
GLenum type = _elementTypeToGLType[attrib._element.getType()];
|
||||||
GLuint stride = strides[bufferNum];
|
GLuint stride = strides[bufferNum];
|
||||||
GLuint pointer = attrib._offset + offsets[bufferNum];
|
GLuint pointer = attrib._offset + offsets[bufferNum];
|
||||||
#if defined(SUPPORT_LEGACY_OPENGL)
|
#if defined(SUPPORT_LEGACY_OPENGL)
|
||||||
if (slot < NUM_CLASSIC_ATTRIBS) {
|
const bool useClientState = i < NUM_CLASSIC_ATTRIBS;
|
||||||
|
#else
|
||||||
|
const bool useClientState = false;
|
||||||
|
#endif
|
||||||
|
if (useClientState) {
|
||||||
switch (slot) {
|
switch (slot) {
|
||||||
case Stream::POSITION:
|
case Stream::POSITION:
|
||||||
glVertexPointer(count, type, stride, reinterpret_cast<GLvoid*>(pointer));
|
glVertexPointer(count, type, stride, reinterpret_cast<GLvoid*>(pointer));
|
||||||
|
@ -140,9 +145,6 @@ void GLBackend::updateInput() {
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
#else
|
|
||||||
{
|
|
||||||
#endif
|
|
||||||
GLboolean isNormalized = attrib._element.isNormalized();
|
GLboolean isNormalized = attrib._element.isNormalized();
|
||||||
glVertexAttribPointer(slot, count, type, isNormalized, stride,
|
glVertexAttribPointer(slot, count, type, isNormalized, stride,
|
||||||
reinterpret_cast<GLvoid*>(pointer));
|
reinterpret_cast<GLvoid*>(pointer));
|
||||||
|
|
Loading…
Reference in a new issue