-
Notifications
You must be signed in to change notification settings - Fork 0
/
objects.h
94 lines (78 loc) · 2.07 KB
/
objects.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#pragma once
#include <iostream>
#include <cmath>
#include <fstream>
#include <vector>
#include <map>
#include <string>
#include <time.h>
#include <cstdlib>
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#define GLM_FORCE_RADIANS
#include <glm/glm.hpp>
#include <glm/gtx/transform.hpp>
#include <glm/gtc/matrix_transform.hpp>
using namespace std;
struct VAO {
GLuint VertexArrayID;
GLuint VertexBuffer;
GLuint ColorBuffer;
GLuint NormalBuffer;
GLenum PrimitiveMode;
GLenum FillMode;
int NumVertices;
};
typedef struct VAO VAO;
struct color{
float r, g, b;
};
typedef struct color color;
struct Object2D {
float x, y, z;
float height, width, depth;
float anglex;
float anglez;
color objcolor;
VAO *objectvao;
int active;
};
typedef struct Object2D Object2D;
extern map <string, Object2D> blockparts;
extern float tileside;
extern float tiledepth;
extern int blockstate;
extern int curlevel;
extern color red;
extern color blue;
extern color black;
extern color grey;
extern color green;
extern color yellow;
extern color white;
extern VAO *rectangle;
extern VAO *cuboid;
extern int (*tilemap)[15];
extern int (*activetiles)[15];
extern Object2D (*tiles)[15];
extern Object2D (*base)[15];
extern int level1[10][15];
extern int active1[10][15];
extern int level2[10][15];
extern int active2[10][15];
extern int level3[10][15];
extern int active3[10][15];
extern Object2D tiles1[10][15];
extern Object2D base1[10][15];
extern Object2D tiles2[10][15];
extern Object2D base2[10][15];
extern Object2D tiles3[10][15];
extern Object2D base3[10][15];
extern Object2D block, lightSource, scamN;
extern color tilecolor[6];
extern map <string, Object2D> display;
bool operator==(const color& lhs, const color& rhs);
struct VAO* create3DObject (GLenum primitive_mode, int numVertices, const GLfloat* vertex_buffer_data, const GLfloat* color_buffer_data, const GLfloat* normal_buffer_data, GLenum fill_mode);
void draw3DObject (struct VAO* vao);
Object2D createCuboid (color objcolor, float anglex, float anglez, float x, float y, float z, float height, float width, float depth);
void initObjects();