]> git.tdb.fi Git - gldbg.git/blob - flavors/gl/source/arraystate.cpp
Use a centralized packet framework
[gldbg.git] / flavors / gl / source / arraystate.cpp
1 /* $Id$
2
3 This file is part of gldbg
4 Copyright © 2010  Mikko Rasa, Mikkosoft Productions
5 Distributed under the GPL
6 */
7
8 #include "arraystate.h"
9 #include "bufferstate.h"
10
11 ArrayState::ArrayState():
12         kind(0),
13         index(0),
14         enabled(false),
15         size(4),
16         type(GL_FLOAT),
17         normalized(false),
18         stride(0),
19         buffer(0),
20         pointer(0)
21 { }
22
23 void ArrayState::set(unsigned s, GLenum t, bool n, unsigned r, BufferState *b, long p)
24 {
25         size = s;
26         type = t;
27         stride = r;
28         normalized = n;
29         buffer = b;
30         pointer = p;
31
32         if(buffer)
33                 buffer->content.update(*this);
34 }