2024-08-22 16:04:15 +00:00
|
|
|
#pragma once
|
2024-08-01 23:32:51 +00:00
|
|
|
|
|
|
|
#define GLFW_INCLUDE_NONE
|
|
|
|
#include <GLFW/glfw3.h>
|
|
|
|
#include <iostream>
|
|
|
|
#include "VertexArray.h"
|
|
|
|
#include "VertexBuffer.h"
|
2024-08-27 20:24:08 +00:00
|
|
|
#include "IndexBuffer.h"
|
2024-08-01 23:32:51 +00:00
|
|
|
#include "FrameBuffer.h"
|
|
|
|
#include "Window.h"
|
|
|
|
#include "Shader.h"
|
2024-08-22 15:55:30 +00:00
|
|
|
#include "Texture.h"
|
2024-08-01 23:32:51 +00:00
|
|
|
#include "UI.h"
|
2024-08-27 20:24:08 +00:00
|
|
|
#include "Camera.h"
|
2024-08-01 23:32:51 +00:00
|
|
|
|
|
|
|
struct RendererData
|
|
|
|
{
|
|
|
|
VertexArray* m_VAO;
|
|
|
|
VertexBuffer* m_VBO;
|
2024-08-27 20:24:08 +00:00
|
|
|
IndexBuffer* m_IBO;
|
2024-08-01 23:32:51 +00:00
|
|
|
FrameBuffer* m_FBO;
|
2024-08-27 20:24:08 +00:00
|
|
|
Camera* m_Camera;
|
2024-08-01 23:32:51 +00:00
|
|
|
Shader* m_Shader;
|
|
|
|
};
|
|
|
|
|
|
|
|
class Renderer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Renderer();
|
|
|
|
~Renderer();
|
|
|
|
|
|
|
|
static void Init();
|
|
|
|
static void Render();
|
|
|
|
static void Shutdown();
|
|
|
|
|
2024-08-22 15:55:30 +00:00
|
|
|
static RendererData GetData();
|
2024-08-01 23:32:51 +00:00
|
|
|
|
|
|
|
private:
|
2024-08-22 15:55:30 +00:00
|
|
|
static RendererData s_Data;
|
|
|
|
|
2024-08-01 23:32:51 +00:00
|
|
|
static void LoadShaders();
|
|
|
|
static void SetupBuffers();
|
2024-08-27 20:24:08 +00:00
|
|
|
static void SetCallbacks();
|
|
|
|
static void ProcessInput(GLFWwindow* window);
|
|
|
|
|
|
|
|
static float deltaTime;
|
|
|
|
static float lastFrame;
|
|
|
|
|
|
|
|
static bool firstMouse;
|
|
|
|
static float lastX;
|
|
|
|
static float lastY;
|
2024-08-22 16:04:15 +00:00
|
|
|
};
|