]> git.tdb.fi Git - libs/gl.git/blob - source/immediate.cpp
Use RAII checks for extensions and versions
[libs/gl.git] / source / immediate.cpp
1 /* $Id$
2
3 This file is part of libmspgl
4 Copyright © 2007  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #include "immediate.h"
9
10 namespace Msp {
11 namespace GL {
12
13 Immediate::Immediate(VertexFormat f):
14         PrimitiveBuilder(array),
15         array(f)
16 { }
17
18 void Immediate::end_()
19 {
20         array.apply();
21         draw_elements(type, indices.size(), &indices[0]);
22
23         array.clear();
24         indices.clear();
25 }
26
27 void Immediate::element_(unsigned i)
28 {
29         indices.push_back(i);
30 }
31
32 } // namespace GL
33 } // namespace Msp