-
Notifications
You must be signed in to change notification settings - Fork 2
/
GLvbo.h
30 lines (23 loc) · 878 Bytes
/
GLvbo.h
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
// Copyright © 2008-2012 Pioneer Developers. See AUTHORS.txt for details
// Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
#ifndef __glvbo_h__
#define __glvbo_h__
// Include GLEE to get definitions for GLuint and GLenum... yes Andy you should do this cleaner!
#include "glew.h"
class CGLvbo
{
private:
void Init(const int nElements, const void *pVertexBuf, const void *pNormalBuf=nullptr, const void *pUVBuf=nullptr, GLenum nUsage=GL_STATIC_DRAW); // Or GL_DYNAMIC_DRAW
void Cleanup();
protected:
GLuint mVAO;
GLuint mVertObjId;
GLuint mNormObjId;
GLuint mUVObjId;
public:
CGLvbo(const int nElements, const void *pVertexBuf, const void *pNormalBuf=nullptr, const void *pUVBuf=nullptr, GLenum nUsage=GL_STATIC_DRAW); // Or GL_DYNAMIC_DRAW
~CGLvbo();
void Bind() const;
void Release() const;
};
#endif // __glvbo_h__