hibiscus/renderer/rglcore/rglcore.hpp

47 lines
1.1 KiB
C++
Raw Normal View History

#pragma once
2023-06-01 19:19:18 +00:00
#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
2023-06-01 19:19:18 +00:00
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;
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;
// 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;
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);
};
}