Browse Source

gpu: do not try to call glVertexAttribIPointer if Glew did not find it.

legacy
Sam Hocevar sam 12 years ago
parent
commit
3e206b60e0
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      src/gpu/vertexbuffer.cpp

+ 9
- 1
src/gpu/vertexbuffer.cpp View File

@@ -393,7 +393,12 @@ void VertexDeclaration::SetStream(VertexBuffer *vb, ShaderAttrib attr1,
if (tlut[type_index].type == GL_FLOAT
|| tlut[type_index].type == GL_DOUBLE
|| tlut[type_index].type == GL_BYTE
|| tlut[type_index].type == GL_UNSIGNED_BYTE)
|| tlut[type_index].type == GL_UNSIGNED_BYTE
# if defined USE_GLEW
/* If this is not available, don't use it */
|| !glVertexAttribIPointer
# endif
|| false)
{
/* Normalize unsigned bytes by default, because it's usually
* some color information. */
@@ -426,6 +431,9 @@ void VertexDeclaration::SetStream(VertexBuffer *vb, ShaderAttrib attr1,
glColorPointer(tlut[type_index].size, tlut[type_index].type,
stride, (GLvoid const *)(uintptr_t)offset);
break;
default:
Log::Error("vertex usage %d is not supported yet\n");
break;
}
# endif
}


Loading…
Cancel
Save