-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIndexBuffer.h
executable file
·53 lines (41 loc) · 928 Bytes
/
IndexBuffer.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//
// IndexBuffer.hpp
// ogl4
//
// Created by Philipp Lensing on 19.09.16.
// Copyright © 2016 Philipp Lensing. All rights reserved.
//
#ifndef IndexBuffer_hpp
#define IndexBuffer_hpp
#ifdef WIN32
#include <GL/glew.h>
#include <glfw/glfw3.h>
#else
#define GLFW_INCLUDE_GLCOREARB
#define GLFW_INCLUDE_GLEXT
#include <glfw/glfw3.h>
#endif
#include <iostream>
#include <vector>
#include <stdio.h>
class IndexBuffer
{
public:
IndexBuffer();
~IndexBuffer();
void begin();
void addIndex( unsigned int Index);
void end();
void activate();
void deactivate();
GLenum indexFormat() { return IndexFormat; }
unsigned int indexCount() { return IndexCount; }
private:
std::vector<unsigned int> Indices;
GLuint IBO;
bool BufferInitialized;
bool WithinBeginAndEnd;
GLenum IndexFormat;
unsigned int IndexCount;
};
#endif /* IndexBuffer_hpp */