瀏覽代碼

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

legacy
Sam Hocevar sam 12 年之前
父節點
當前提交
3e206b60e0
共有 1 個文件被更改,包括 9 次插入1 次删除
  1. +9
    -1
      src/gpu/vertexbuffer.cpp

+ 9
- 1
src/gpu/vertexbuffer.cpp 查看文件

@@ -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…
取消
儲存