]> git.tdb.fi Git - gldbg.git/blob - flavors/gl/source/bufferstate.h
Replace per-file license notices with License.txt
[gldbg.git] / flavors / gl / source / bufferstate.h
1 #ifndef BUFFERSTATE_H_
2 #define BUFFERSTATE_H_
3
4 #include <string>
5 #include <vector>
6 #include "opengl.h"
7
8 struct ArrayState;
9
10 struct BufferContent
11 {
12         struct Array
13         {
14                 GLenum kind;
15                 unsigned index;
16                 unsigned size;
17                 GLenum type;
18                 int offset;
19
20                 Array();
21                 Array(const ArrayState &);
22         };
23
24         bool consistent;
25         unsigned stride;
26         std::vector<Array> arrays;
27
28         BufferContent();
29         void update(const ArrayState &);
30         void update_elements(GLenum);
31         std::string describe() const;
32 };
33
34 struct BufferState
35 {
36         unsigned id;
37         GLenum target;
38         GLenum usage;
39         unsigned size;
40         char *data;
41         BufferContent content;
42
43         BufferState();
44         void set_data(unsigned, const void *, GLenum);
45         void set_sub_data(unsigned, unsigned, const void *);
46         std::string describe() const;
47 };
48
49 #endif