diff options
Diffstat (limited to 'Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp b/Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp index 1913b6dcd3..16bcabab4b 100644 --- a/Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp +++ b/Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp @@ -32,18 +32,18 @@ static inline GLuint VarToGL(ComponentFormat t) return lookup[t]; } -static void SetPointer(u32 attrib, u32 stride, const AttributeFormat& format) +static void SetPointer(ShaderAttrib attrib, u32 stride, const AttributeFormat& format) { if (!format.enable) return; - glEnableVertexAttribArray(attrib); + glEnableVertexAttribArray(static_cast<GLuint>(attrib)); if (format.integer) - glVertexAttribIPointer(attrib, format.components, VarToGL(format.type), stride, - (u8*)nullptr + format.offset); + glVertexAttribIPointer(static_cast<GLuint>(attrib), format.components, VarToGL(format.type), + stride, (u8*)nullptr + format.offset); else - glVertexAttribPointer(attrib, format.components, VarToGL(format.type), true, stride, - (u8*)nullptr + format.offset); + glVertexAttribPointer(static_cast<GLuint>(attrib), format.components, VarToGL(format.type), + true, stride, (u8*)nullptr + format.offset); } GLVertexFormat::GLVertexFormat(const PortableVertexDeclaration& vtx_decl) @@ -65,18 +65,18 @@ GLVertexFormat::GLVertexFormat(const PortableVertexDeclaration& vtx_decl) glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vm->GetIndexBufferHandle()); glBindBuffer(GL_ARRAY_BUFFER, vm->GetVertexBufferHandle()); - SetPointer(SHADER_POSITION_ATTRIB, vertex_stride, vtx_decl.position); + SetPointer(ShaderAttrib::Position, vertex_stride, vtx_decl.position); - for (int i = 0; i < 3; i++) - SetPointer(SHADER_NORMAL_ATTRIB + i, vertex_stride, vtx_decl.normals[i]); + for (u32 i = 0; i < 3; i++) + SetPointer(ShaderAttrib::Normal + i, vertex_stride, vtx_decl.normals[i]); - for (int i = 0; i < 2; i++) - SetPointer(SHADER_COLOR0_ATTRIB + i, vertex_stride, vtx_decl.colors[i]); + for (u32 i = 0; i < 2; i++) + SetPointer(ShaderAttrib::Color0 + i, vertex_stride, vtx_decl.colors[i]); - for (int i = 0; i < 8; i++) - SetPointer(SHADER_TEXTURE0_ATTRIB + i, vertex_stride, vtx_decl.texcoords[i]); + for (u32 i = 0; i < 8; i++) + SetPointer(ShaderAttrib::TexCoord0 + i, vertex_stride, vtx_decl.texcoords[i]); - SetPointer(SHADER_POSMTX_ATTRIB, vertex_stride, vtx_decl.posmtx); + SetPointer(ShaderAttrib::PositionMatrix, vertex_stride, vtx_decl.posmtx); } GLVertexFormat::~GLVertexFormat() |
