]> git.tdb.fi Git - libs/gl.git/blob - source/meshbuilder.cpp
Support linear to sRGB conversion when loading materials and textures
[libs/gl.git] / source / meshbuilder.cpp
1 #include "mesh.h"
2 #include "meshbuilder.h"
3
4 namespace Msp {
5 namespace GL {
6
7 MeshBuilder::MeshBuilder(Mesh &m):
8         PrimitiveBuilder(m.vertices),
9         mesh(m),
10         batch(0)
11 { }
12
13 void MeshBuilder::auto_offset()
14 {
15         offset(mesh.get_vertices().size());
16 }
17
18 void MeshBuilder::begin_()
19 {
20         batch = new Batch(type);
21 }
22
23 void MeshBuilder::end_()
24 {
25         mesh.add_batch(*batch);
26         delete batch;
27         batch = 0;
28 }
29
30 void MeshBuilder::element_(unsigned i)
31 {
32         batch->append(i);
33 }
34
35 } // namespace GL
36 } // namespace Msp