-
Notifications
You must be signed in to change notification settings - Fork 0
/
sandbox.h
65 lines (52 loc) · 1.5 KB
/
sandbox.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
#ifndef _SANDBOX_H_
#define _SANDBOX_H_
#include <glad/glad.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <GLFW/glfw3.h>
#include "learnOpenGL/shader.h"
#include "tiles.h"
#include "learnOpenGL/model.h"
#include "object.h"
#include "framebuffer.h"
#include "voxelhandler.h"
class Sandbox
{
public:
Sandbox(GLFWwindow* window);
~Sandbox();
void processInput();
void display();
void drawTriangle(); // Move these to separate handlers later
void drawQuad(); // Move these to separate handlers later
Shader* sandboxShader{};
glm::mat4 projection{};
glm::mat4 view;
glm::mat4 quadModel{};
Shader* bunnyShader;
Shader* depthShader;
Shader* cubeShader;
private:
void initShaders();
void genereteFBODepthTextures(Framebuffer FBO1, Framebuffer FBO2, Framebuffer FBO3, Framebuffer FBO4, Framebuffer FBO5, Framebuffer FBO6);
static void scrollCallback(GLFWwindow* window, double xoffset, double yoffset);
float triangleVertices[9]; // Triangle has 3 vertices each 3 coordninates
float quadVertices[12]; // Quad 4 vertices
unsigned int quadIndices[6]; // Used for EBO
float quadTexCoords[8];
GLFWwindow* window{};
Tiles* bottomTiles{};
glm::vec3 cameraPos;
glm::vec3 cameraFront;
glm::vec3 cameraUp;
float yaw;
float pitch;
VoxelHandler* voxHandler;
bool bunnyToggle;
// TEMPORARY
Sphere bunny;
Sphere cube;
Sphere sphere;
};
#endif