-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtestshapes.hpp
57 lines (52 loc) · 1.09 KB
/
testshapes.hpp
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
54
55
56
57
#ifndef TESTSHAPES_H
#define TESTSHAPES_H
#include <gl/glew.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include "shader.hpp"
#ifdef WIN32
#include <d3d11.h>
#endif
#undef min
#undef max
class Triangle {
public:
Triangle();
static void Init(unsigned);
static void Init_D3D11();
void Render();
#ifdef WIN32
void Render_D3D11();
#endif
private:
static GLuint vao, vbo;
static float base_vertices_and_attrib_ccw[3 * 6];
static float base_vertices_and_attrib_cw[3 * 4];
static unsigned program;
#ifdef WIN32
static ID3D11Buffer* d3d11buffer;
static ID3D11InputLayout* d3d11_input_layout;
#endif
public:
glm::vec3 pos;
};
class ColorCube {
public:
ColorCube();
static void Init(unsigned);
static void Init_D3D11();
void Render();
void Render_D3D11();
private:
static GLuint vao, vbo;
static float base_vertices_and_attrib[36*6];
static float base_vertices_and_attrib_cw[36 * 6];
static unsigned program;
#ifdef WIN32
static ID3D11Buffer* d3d11_vertex_buffer;
static ID3D11InputLayout* d3d11_input_layout;
#endif
public:
glm::vec3 pos;
};
#endif