Skip to content

Commit

Permalink
Pass array size to OGL mesh buffer correctly
Browse files Browse the repository at this point in the history
Remove comments from vertex attribute declarations
  • Loading branch information
elnormous committed Feb 1, 2017
1 parent bfd04bf commit d884013
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions ouzel/graphics/Vertex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ namespace ouzel
namespace graphics
{
const std::vector<VertexAttribute> VertexPC::ATTRIBUTES = {
VertexAttribute(VertexAttribute::Usage::POSITION, 0, DataType::FLOAT_VECTOR3, false), // position
VertexAttribute(VertexAttribute::Usage::COLOR, 0, DataType::UNSIGNED_BYTE_VECTOR4, true) // color
VertexAttribute(VertexAttribute::Usage::POSITION, 0, DataType::FLOAT_VECTOR3, false),
VertexAttribute(VertexAttribute::Usage::COLOR, 0, DataType::UNSIGNED_BYTE_VECTOR4, true)
};

VertexPC::VertexPC()
Expand All @@ -22,9 +22,9 @@ namespace ouzel
}

const std::vector<VertexAttribute> VertexPCT::ATTRIBUTES = {
VertexAttribute(VertexAttribute::Usage::POSITION, 0, DataType::FLOAT_VECTOR3, false), // position
VertexAttribute(VertexAttribute::Usage::COLOR, 0, DataType::UNSIGNED_BYTE_VECTOR4, true), // color
VertexAttribute(VertexAttribute::Usage::TEXTURE_COORDINATES, 0, DataType::FLOAT_VECTOR2, false) // texcoord
VertexAttribute(VertexAttribute::Usage::POSITION, 0, DataType::FLOAT_VECTOR3, false),
VertexAttribute(VertexAttribute::Usage::COLOR, 0, DataType::UNSIGNED_BYTE_VECTOR4, true),
VertexAttribute(VertexAttribute::Usage::TEXTURE_COORDINATES, 0, DataType::FLOAT_VECTOR2, false)
};

VertexPCT::VertexPCT()
Expand Down
2 changes: 1 addition & 1 deletion ouzel/graphics/opengl/MeshBufferOGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ namespace ouzel
GLboolean normalized = vertexAttribute.normalized ? GL_TRUE : GL_FALSE;

vertexAttribs.push_back({
3, getVertexFormat(vertexAttribute.dataType), normalized,
getArraySize(vertexAttribute.dataType), getVertexFormat(vertexAttribute.dataType), normalized,
static_cast<GLsizei>(data.vertexSize),
reinterpret_cast<const GLvoid*>(offset)
});
Expand Down

0 comments on commit d884013

Please sign in to comment.