2023-07-29 18:58:56 -04:00
|
|
|
//
|
|
|
|
// Created by brett on 6/5/23.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef PARKSNREC_ENGINE_H
|
|
|
|
#define PARKSNREC_ENGINE_H
|
|
|
|
|
2023-07-30 19:37:19 -04:00
|
|
|
#include "resources.h"
|
|
|
|
#include "blt/window.h"
|
2023-07-29 18:58:56 -04:00
|
|
|
#include "blt/math/vectors.h"
|
2023-07-30 19:37:19 -04:00
|
|
|
#include "blt/config.h"
|
|
|
|
#include "blt/shader/basic_shader.vert"
|
|
|
|
#include "blt/shader/ui_shader.vert"
|
|
|
|
#include "blt/shader/basic_shader.frag"
|
|
|
|
#include "blt/shader/ui_shader.frag"
|
|
|
|
#include "player.h"
|
2023-07-29 18:58:56 -04:00
|
|
|
|
2023-08-01 20:57:39 -04:00
|
|
|
namespace blt::graphics {
|
2023-07-29 18:58:56 -04:00
|
|
|
struct StaticEntity {
|
|
|
|
blt::vec3 pos;
|
|
|
|
uint32_t modelID;
|
|
|
|
blt::vec3 rot;
|
|
|
|
uint32_t textureID;
|
|
|
|
};
|
|
|
|
|
|
|
|
class Renderer {
|
|
|
|
private:
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
static GLfloat vertices[] = {
|
|
|
|
// Positions // Colors // Texture Coords
|
|
|
|
0.5f, 0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, // Top Right
|
|
|
|
0.5f, -0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, // Bottom Right
|
|
|
|
-0.5f, -0.5f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, // Bottom Left
|
|
|
|
-0.5f, 0.5f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f // Top Left
|
|
|
|
};
|
|
|
|
static GLuint indices[] = { // Note that we start from 0!
|
|
|
|
0, 1, 3, // First Triangle
|
|
|
|
1, 2, 3 // Second Triangle
|
|
|
|
};
|
|
|
|
|
|
|
|
static GLfloat basicQuad_v[] = {
|
|
|
|
// Positions // Texture Coords
|
|
|
|
1, 1, 0.0f, 1.0f, 1.0f, // Top Right
|
|
|
|
1, 0, 0.0f, 1.0f, 0.0f, // Bottom Right
|
|
|
|
0, 0, 0.0f, 0.0f, 0.0f, // Bottom Left
|
|
|
|
0, 1, 0.0f, 0.0f, 1.0f // Top Left
|
|
|
|
};
|
|
|
|
static GLuint basicQuad_i[] = { // Note that we start from 0!
|
|
|
|
0, 1, 3, // First Triangle
|
|
|
|
1, 2, 3 // Second Triangle
|
|
|
|
};
|
|
|
|
|
|
|
|
class Engine {
|
|
|
|
private:
|
|
|
|
Shader testShader{BasicShaderVertex, BasicShaderFragment};
|
|
|
|
Shader uiShader{UIShaderVertex, UIShaderFragment};
|
|
|
|
VAOStorageObject vao;
|
|
|
|
VAOStorageObject basicQuadVAO;
|
|
|
|
GLTexture2D geneticImageTexture;
|
|
|
|
const Settings& settings;
|
|
|
|
|
|
|
|
Player player;
|
|
|
|
CameraController basicCameraController {player};
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit Engine(const Settings& settings);
|
|
|
|
|
|
|
|
void run();
|
|
|
|
|
|
|
|
~Engine();
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif //PARKSNREC_ENGINE_H
|