hibiscus/renderer/rglcore/rglcore.hpp
2023-06-14 21:59:21 +01:00

47 lines
1.1 KiB
C++

#pragma once
#include <unordered_map>
#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
void clearScreen(Color col = Color {0, 0, 0, 255}) override;
void renderCurrent() override;
void drawText(Resource* resource, std::string text, IntVec2 pos, Color color) override;
void drawTexture(Texture* resource, IntRect size) override;
void useShader(Shader* shader, Point2D points[3]) override;
void stopUsingShaders() override;
// Pre and Post draw
void preDraw() override;
void postDraw() override;
// Update
void update() override;
// Util
void compileShader(Shader* shader) override;
void toggleWireframe() override;
void setWindowTitle(std::string title) override;
private:
GLFWwindow* mWindow;
std::unordered_map<Texture*, unsigned int> mTextures;
std::string loadFile(std::string path);
};
}