2023-06-01 17:27:14 +00:00
|
|
|
#pragma once
|
|
|
|
|
2023-06-01 19:19:18 +00:00
|
|
|
#include <unordered_map>
|
2023-06-01 17:27:14 +00:00
|
|
|
#include <GL/glew.h>
|
|
|
|
#include <GLFW/glfw3.h>
|
|
|
|
|
|
|
|
#include <ft2build.h>
|
|
|
|
#include FT_FREETYPE_H
|
|
|
|
|
|
|
|
#include <callback.hpp>
|
|
|
|
#include <renderer/renderer.hpp>
|
|
|
|
|
|
|
|
namespace hibis::rglcore {
|
|
|
|
class RGLCore : public Renderer {
|
|
|
|
public:
|
|
|
|
RGLCore(std::string title, IntVec2 size, LoggerCallback callback);
|
|
|
|
~RGLCore();
|
|
|
|
|
|
|
|
// Draw
|
2023-06-01 19:19:18 +00:00
|
|
|
void clearScreen(Color col = Color {0, 0, 0, 255}) override;
|
2023-06-01 17:27:14 +00:00
|
|
|
void renderCurrent() override;
|
|
|
|
|
|
|
|
void drawText(Resource* resource, std::string text, IntVec2 pos, Color color) override;
|
2023-06-01 19:19:18 +00:00
|
|
|
void drawTexture(Texture* resource, IntRect size) override;
|
|
|
|
|
|
|
|
void useShader(Shader* shader, Point2D points[3]) override;
|
|
|
|
void stopUsingShaders() override;
|
2023-06-01 17:27:14 +00:00
|
|
|
|
|
|
|
// Pre and Post draw
|
|
|
|
void preDraw() override;
|
|
|
|
void postDraw() override;
|
|
|
|
|
|
|
|
// Update
|
|
|
|
void update() override;
|
|
|
|
|
|
|
|
// Util
|
2023-06-01 19:19:18 +00:00
|
|
|
void compileShader(Shader* shader) override;
|
|
|
|
void toggleWireframe() override;
|
2023-06-01 17:27:14 +00:00
|
|
|
void setWindowTitle(std::string title) override;
|
|
|
|
private:
|
|
|
|
GLFWwindow* mWindow;
|
2023-06-01 19:19:18 +00:00
|
|
|
std::unordered_map<Texture*, unsigned int> mTextures;
|
|
|
|
|
2023-06-14 20:59:21 +00:00
|
|
|
std::string loadFile(std::string path);
|
2023-06-01 17:27:14 +00:00
|
|
|
};
|
|
|
|
}
|