-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAttributeInfo.h
More file actions
44 lines (37 loc) · 984 Bytes
/
AttributeInfo.h
File metadata and controls
44 lines (37 loc) · 984 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef ATTRIBUTEINFO_H
#define ATTRIBUTEINFO_H
#include <cassert>
#include <string>
#include <glad/glad.h>
struct AttributeInfo
{
enum Type
{
Byte = GL_BYTE,
UnsignedByte = GL_UNSIGNED_BYTE,
Short = GL_SHORT,
UnsignedShort = GL_UNSIGNED_SHORT,
Int = GL_INT,
UnsignedInt = GL_UNSIGNED_INT,
Float = GL_FLOAT
};
GLint sizeOfType()
{
switch(type)
{
case Byte: return sizeof(GLbyte);
case UnsignedByte: return sizeof(GLubyte);
case Short: return sizeof(GLshort);
case UnsignedShort: return sizeof(GLushort);
case Int: return sizeof(GLint);
case UnsignedInt: return sizeof(GLuint);
case Float: return sizeof(GLfloat);
}
assert(false);
return 0;
}
std::string name;
Type type;
GLint count;
};
#endif // ATTRIBUTEINFO_H