[gluon] Re: Review Request: New VertexBuffer and VertexAttribute classes

[ Thread Index | Date Index | More lists.tuxfamily.org/gluon Archives ]


This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/100392/

graphics/mesh.cpp (Diff revision 1)
126
    glGenBuffers( 1, &d->buffer );
107
    return d->buffer->isLoaded();
Actually, mesh should track its own loading state. While not directly relevant now, the idea is that Mesh takes care of loading data from an external file.

graphics/vertexattribute.h (Diff revision 1)
namespace GluonGraphics
27
            int singleDataSize() const;
If you rename size() to itemCount() you could name this itemSize() or itemElementCount()

graphics/vertexattribute.cpp (Diff revision 1)
VertexAttribute::VertexAttribute( const VertexAttribute& other )
42
    d->data = other.d->data;
Oh right, data is a vector. Though it was a c-style array :p

- Arjen


On January 14th, 2011, 9:54 p.m., Giulio Camuffo wrote:

Review request for Gluon.
By Giulio Camuffo.

Updated Jan. 14, 2011, 9:54 p.m.

Description

This patch adds the VertexAttribute and VertexBuffer classes, moving the rendering out of Mesh. It allows a Mesh subclass to use more vertex attributes adding them to the buffer provided by the method Mesh::vertexBuffer.

There is the singleDataSize method in VertexAttribute which name is basically a placeholder because i could not find a better one. It returns the number of fields for each vertex. E.g 3 for the vertex position (x,y,z), 4 for the color (r,g,b,a), etc. Suggestions welcome!

Testing

I tested it with a sprite component and my TerrainMesh. It works right.

Diffs

  • graphics/CMakeLists.txt (984fe25)
  • graphics/mesh.h (95d1230)
  • graphics/mesh.cpp (d367c62)
  • graphics/vertexattribute.h (PRE-CREATION)
  • graphics/vertexattribute.cpp (PRE-CREATION)
  • graphics/vertexbuffer.h (PRE-CREATION)
  • graphics/vertexbuffer.cpp (PRE-CREATION)

View Diff



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/