class MeshBuilder
Defined at line 17 of file ../../src/ui/lib/escher/shape/mesh_builder.h
MeshBuilder is used by Escher clients to generate Meshes. Clients should
obtain one via Escher::NewMeshBuilder(), repeatedly call AddVertex() and
AddIndex() to add data for the Mesh, and then call Build() once all data has
been added.
Protected Members
const size_t max_vertex_count_
const size_t max_index_count_
const size_t vertex_stride_
vector vertex_staging_buffer_
vector index_staging_buffer_
uint32_t vertex_count_
uint32_t index_count_
Public Methods
MeshBuilder & AddTriangle (uint32_t index0, uint32_t index1, uint32_t index2)
Defined at line 28 of file ../../src/ui/lib/escher/shape/mesh_builder.h
MeshPtr Build ()
Return a mesh constructed from the indices and vertices added by AddIndex()
and AddVertex(), respectively. After this function is called, all the
staging buffers will be cleared so that the builder can be reused.
size_t vertex_stride ()
Return the size of a vertex for the given mesh-spec.
Defined at line 43 of file ../../src/ui/lib/escher/shape/mesh_builder.h
size_t index_count ()
Return the number of indices that have been added to the builder, so far.
Defined at line 46 of file ../../src/ui/lib/escher/shape/mesh_builder.h
size_t vertex_count ()
Return the number of vertices that have been added to the builder, so far.
Defined at line 49 of file ../../src/ui/lib/escher/shape/mesh_builder.h
uint8_t * GetVertex (size_t index)
Return pointer to start of data for the vertex at the specified index.
Defined at line 52 of file ../../src/ui/lib/escher/shape/mesh_builder.h
uint32_t * GetIndex (size_t i)
Return pointer to the i-th index that was added.
Defined at line 57 of file ../../src/ui/lib/escher/shape/mesh_builder.h
MeshBuilder & AddIndex (uint32_t index)
Copy the index into the staging buffer, so that it will be uploaded to the
GPU when Build() is called.
Defined at line 82 of file ../../src/ui/lib/escher/shape/mesh_builder.h
MeshBuilder & AddVertexData (const void * ptr, size_t size)
Copy |size| bytes of data to the staging buffer; this data represents a
single vertex.
Defined at line 89 of file ../../src/ui/lib/escher/shape/mesh_builder.h
template <typename VertexT>
MeshBuilder & AddVertex (const VertexT & v)
Wrap AddVertexData() to automatically obtain the size from the vertex.
Defined at line 102 of file ../../src/ui/lib/escher/shape/mesh_builder.h
Protected Methods
void MeshBuilder (size_t max_vertex_count, size_t max_index_count, size_t vertex_stride)
Defined at line 11 of file ../../src/ui/lib/escher/shape/mesh_builder.cc
void ~MeshBuilder ()
Defined at line 18 of file ../../src/ui/lib/escher/shape/mesh_builder.cc
void MeshBuilder (const MeshBuilder & )
Defined at line 75 of file ../../src/ui/lib/escher/shape/mesh_builder.h
MeshBuilder & operator= (const MeshBuilder & )
Defined at line 75 of file ../../src/ui/lib/escher/shape/mesh_builder.h
Friends
class RefCountedThreadSafe