SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SLGLEnums.h
Go to the documentation of this file.
1 /**
2  * \file SLGLEnums.h
3  * \brief Enumerations containing OpenGL constants
4  * \date January 2016
5  * \authors Marcus Hudritsch
6  * \copyright http://opensource.org/licenses/GPL-3.0
7  * \remarks Please use clangformat to format the code. See more code style on
8  * https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
9 */
10 
11 #ifndef SLGLENUM_H
12 #define SLGLENUM_H
13 
14 #include <SL.h>
15 #include <SLGLState.h>
16 
17 //-----------------------------------------------------------------------------
18 //! Enumeration for buffer data types
20 {
21  BT_float = GL_FLOAT, //!< float vertex attributes
22  BT_int = GL_INT, //!< int vertex attributes
23  BT_ubyte = GL_UNSIGNED_BYTE, //!< vertex index type (0-2^8)
24  BT_ushort = GL_UNSIGNED_SHORT, //!< vertex index type (0-2^16)
25  BT_uint = GL_UNSIGNED_INT //!< vertex index type (0-2^32)
26 };
27 //-----------------------------------------------------------------------------
28 // Enumeration for OpenGL primitive types
30 {
31  PT_points = GL_POINTS,
32  PT_lines = GL_LINES,
33  PT_lineLoop = GL_LINE_LOOP,
34  PT_lineStrip = GL_LINE_STRIP,
35  PT_triangles = GL_TRIANGLES,
36  PT_triangleStrip = GL_TRIANGLE_STRIP,
37  PT_triangleFan = GL_TRIANGLE_FAN
38 };
39 //-----------------------------------------------------------------------------
40 //! Enumeration for float vertex attribute types
41 /* This index must correspond to the layout location index in GLSL shaders.
42  * See also SLMesh vertex attributes.
43  */
45 {
46  /*
47  // The enum must correspond to the attributes in SLMesh:
48  SLVVec3f P; //!< Vector for vertex positions layout (location = 0)
49  SLVVec3f N; //!< Vector for vertex normals (opt.) layout (location = 1)
50  SLVVec2f UV1; //!< Vector for 1st vertex tex. coords. (opt.) layout (location = 2)
51  SLVVec2f UV2; //!< Vector for 2nd. vertex tex. coords. (opt.) layout (location = 3)
52  SLVCol4f C; //!< Vector for vertex colors (opt.) layout (location = 4)
53  SLVVec4f T; //!< Vector for vertex tangents (opt.) layout (location = 5)
54  SLVVuchar Ji; //!< 2D Vector of per vertex joint ids (opt.) layout (location = 6)
55  SLVVfloat Jw; //!< 2D Vector of per vertex joint weights (opt.) layout (location = 7)
56  */
57 
58  AT_position = 0, //!< Vertex position as a 2, 3 or 4 component vectors
59  AT_normal, //!< Vertex normal as a 3 component vector
60  AT_uv1, //!< Vertex 1st texture coordinate as 2 component vector
61  AT_uv2, //!< Vertex 2nd texture coordinate as 2 component vector
62  AT_color, //!< Vertex color as 3 or 4 component vector
63  AT_tangent, //!< Vertex tangent as a 4 component vector (see SLMesh)
64  AT_jointIndex, //!< Vertex joint id for vertex skinning
65  AT_jointWeight, //!< Vertex joint weight for vertex skinning
66 
67  AT_custom0, //!< Custom vertex attribute 0
68  AT_custom1, //!< Custom vertex attribute 1
69  AT_custom2, //!< Custom vertex attribute 2
70  AT_custom3, //!< Custom vertex attribute 3
71  AT_custom4, //!< Custom vertex attribute 4
72  AT_custom5, //!< Custom vertex attribute 5
73  AT_custom6, //!< Custom vertex attribute 6
74  AT_custom7, //!< Custom vertex attribute 7
75  AT_custom8, //!< Custom vertex attribute 8
76  AT_custom9, //!< Custom vertex attribute 9
77 
78  AT_velocity = 1, //!< Vertex velocity 3 component vectors
79  AT_startTime = 2, //!< Vertex start time float
80  AT_initialVelocity = 3, //!< Vertex initial velocity 3 component vectors
81  AT_rotation = 4, //!< Vertex rotation float
82  AT_angularVelo = 5, //!< Vertex angular velocity for rotation float
83  AT_texNum = 6, //!< Vertex texture number int
84  AT_initialPosition = 7, //!< Vertex initial position 3 component vectors
85  AT_instancePosition = 8 //!< Vertex instance position for instanced particle drawing
86 };
87 //-----------------------------------------------------------------------------
88 //! Enumeration for buffer usage types also supported by OpenGL ES
90 {
91  BU_static = GL_STATIC_DRAW, //!< Buffer will be modified once and used many times.
92  BU_stream = GL_STREAM_DRAW, //!< Buffer will be modified once and used at most a few times.
93  BU_dynamic = GL_DYNAMIC_DRAW, //!< Buffer will be modified repeatedly and used many times.
94 };
95 //-----------------------------------------------------------------------------
96 
97 #endif
SLGLAttributeType
Enumeration for float vertex attribute types.
Definition: SLGLEnums.h:45
@ AT_jointWeight
Vertex joint weight for vertex skinning.
Definition: SLGLEnums.h:65
@ AT_instancePosition
Vertex instance position for instanced particle drawing.
Definition: SLGLEnums.h:85
@ AT_angularVelo
Vertex angular velocity for rotation float.
Definition: SLGLEnums.h:82
@ AT_texNum
Vertex texture number int.
Definition: SLGLEnums.h:83
@ AT_jointIndex
Vertex joint id for vertex skinning.
Definition: SLGLEnums.h:64
@ AT_custom5
Custom vertex attribute 5.
Definition: SLGLEnums.h:72
@ AT_custom0
Custom vertex attribute 0.
Definition: SLGLEnums.h:67
@ AT_custom1
Custom vertex attribute 1.
Definition: SLGLEnums.h:68
@ AT_position
Vertex position as a 2, 3 or 4 component vectors.
Definition: SLGLEnums.h:58
@ AT_custom3
Custom vertex attribute 3.
Definition: SLGLEnums.h:70
@ AT_normal
Vertex normal as a 3 component vector.
Definition: SLGLEnums.h:59
@ AT_custom7
Custom vertex attribute 7.
Definition: SLGLEnums.h:74
@ AT_rotation
Vertex rotation float.
Definition: SLGLEnums.h:81
@ AT_custom9
Custom vertex attribute 9.
Definition: SLGLEnums.h:76
@ AT_color
Vertex color as 3 or 4 component vector.
Definition: SLGLEnums.h:62
@ AT_custom2
Custom vertex attribute 2.
Definition: SLGLEnums.h:69
@ AT_uv1
Vertex 1st texture coordinate as 2 component vector.
Definition: SLGLEnums.h:60
@ AT_startTime
Vertex start time float.
Definition: SLGLEnums.h:79
@ AT_custom6
Custom vertex attribute 6.
Definition: SLGLEnums.h:73
@ AT_initialPosition
Vertex initial position 3 component vectors.
Definition: SLGLEnums.h:84
@ AT_velocity
Vertex velocity 3 component vectors.
Definition: SLGLEnums.h:78
@ AT_uv2
Vertex 2nd texture coordinate as 2 component vector.
Definition: SLGLEnums.h:61
@ AT_tangent
Vertex tangent as a 4 component vector (see SLMesh)
Definition: SLGLEnums.h:63
@ AT_custom8
Custom vertex attribute 8.
Definition: SLGLEnums.h:75
@ AT_initialVelocity
Vertex initial velocity 3 component vectors.
Definition: SLGLEnums.h:80
@ AT_custom4
Custom vertex attribute 4.
Definition: SLGLEnums.h:71
SLGLPrimitiveType
Definition: SLGLEnums.h:30
@ PT_points
Definition: SLGLEnums.h:31
@ PT_lines
Definition: SLGLEnums.h:32
@ PT_triangleFan
Definition: SLGLEnums.h:37
@ PT_triangleStrip
Definition: SLGLEnums.h:36
@ PT_triangles
Definition: SLGLEnums.h:35
@ PT_lineStrip
Definition: SLGLEnums.h:34
@ PT_lineLoop
Definition: SLGLEnums.h:33
SLGLBufferUsage
Enumeration for buffer usage types also supported by OpenGL ES.
Definition: SLGLEnums.h:90
@ BU_stream
Buffer will be modified once and used at most a few times.
Definition: SLGLEnums.h:92
@ BU_static
Buffer will be modified once and used many times.
Definition: SLGLEnums.h:91
@ BU_dynamic
Buffer will be modified repeatedly and used many times.
Definition: SLGLEnums.h:93
SLGLBufferType
Enumeration for buffer data types.
Definition: SLGLEnums.h:20
@ BT_ubyte
vertex index type (0-2^8)
Definition: SLGLEnums.h:23
@ BT_ushort
vertex index type (0-2^16)
Definition: SLGLEnums.h:24
@ BT_float
float vertex attributes
Definition: SLGLEnums.h:21
@ BT_int
int vertex attributes
Definition: SLGLEnums.h:22
@ BT_uint
vertex index type (0-2^32)
Definition: SLGLEnums.h:25
Singleton class for global render state.