CUGL 1.2
Cornell University Game Library
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
CUVertex.h
1 //
2 // CUVertex2.h
3 // Cornell University Game Library (CUGL)
4 //
5 // This module provides the basic structs for the default rendering pipeline.
6 // These structs are meant to be passed by value, so we have no methods for
7 // shared pointers.
8 //
9 // CUGL MIT License:
10 // This software is provided 'as-is', without any express or implied
11 // warranty. In no event will the authors be held liable for any damages
12 // arising from the use of this software.
13 //
14 // Permission is granted to anyone to use this software for any purpose,
15 // including commercial applications, and to alter it and redistribute it
16 // freely, subject to the following restrictions:
17 //
18 // 1. The origin of this software must not be misrepresented; you must not
19 // claim that you wrote the original software. If you use this software
20 // in a product, an acknowledgment in the product documentation would be
21 // appreciated but is not required.
22 //
23 // 2. Altered source versions must be plainly marked as such, and must not
24 // be misrepresented as being the original software.
25 //
26 // 3. This notice may not be removed or altered from any source distribution.
27 //
28 // Author: Walker White
29 // Version: 6/23/16
30 
31 #ifndef __CU_VERTEX2_H__
32 #define __CU_VERTEX2_H__
33 
34 #include <cugl/math/CUVec2.h>
35 #include <cugl/math/CUVec3.h>
36 #include <cugl/math/CUColor4.h>
37 
38 namespace cugl {
39 
46 class Vertex2 {
47 public:
54 
56  static const GLvoid* positionOffset() { return (GLvoid*)offsetof(Vertex2, position); }
58  static const GLvoid* colorOffset() { return (GLvoid*)offsetof(Vertex2, color); }
60  static const GLvoid* texcoordOffset() { return (GLvoid*)offsetof(Vertex2, texcoord); }
61 };
62 
69 class Vertex3 {
70 public:
77 
79  static const GLvoid* positionOffset() { return (GLvoid*)offsetof(Vertex3, position); }
81  static const GLvoid* colorOffset() { return (GLvoid*)offsetof(Vertex3, color); }
83  static const GLvoid* texcoordOffset() { return (GLvoid*)offsetof(Vertex3, texcoord); }
84 };
85 
86 }
87 
88 #endif /* __CU_VERTEX2_H__ */
Definition: CUVec2.h:61
cugl::Vec2 texcoord
Definition: CUVertex.h:76
static const GLvoid * texcoordOffset()
Definition: CUVertex.h:83
cugl::Vec3 position
Definition: CUVertex.h:72
static const GLvoid * colorOffset()
Definition: CUVertex.h:81
cugl::Color4 color
Definition: CUVertex.h:74
cugl::Vec2 texcoord
Definition: CUVertex.h:53
Definition: CUVertex.h:46
cugl::Color4 color
Definition: CUVertex.h:51
static const GLvoid * texcoordOffset()
Definition: CUVertex.h:60
static const GLvoid * positionOffset()
Definition: CUVertex.h:56
static const GLvoid * positionOffset()
Definition: CUVertex.h:79
Definition: CUVertex.h:69
Definition: CUVec3.h:61
static const GLvoid * colorOffset()
Definition: CUVertex.h:58
Definition: CUColor4.h:1084
Definition: CUAction.h:51
cugl::Vec2 position
Definition: CUVertex.h:49