2023-05-26 21:41:51 +00:00
|
|
|
#pragma once
|
|
|
|
|
2023-06-01 17:27:14 +00:00
|
|
|
#include <string>
|
|
|
|
|
2023-07-30 16:06:47 +00:00
|
|
|
#include "../input/manager.hpp"
|
2023-05-26 21:41:51 +00:00
|
|
|
#include "../math/types.hpp"
|
|
|
|
#include "../resources/resource.hpp"
|
2023-06-01 19:19:18 +00:00
|
|
|
#include "../resources/shader.hpp"
|
2023-06-01 17:27:14 +00:00
|
|
|
#include "../callback.hpp"
|
2023-05-26 21:41:51 +00:00
|
|
|
|
|
|
|
namespace hibis {
|
|
|
|
class Renderer {
|
|
|
|
public:
|
2023-06-01 19:19:18 +00:00
|
|
|
Renderer(LoggerCallback logger);
|
2023-06-01 17:27:14 +00:00
|
|
|
|
2023-05-26 21:41:51 +00:00
|
|
|
// Draw
|
|
|
|
virtual void clearScreen(Color col) = 0;
|
|
|
|
virtual void renderCurrent() = 0;
|
|
|
|
|
|
|
|
virtual void drawText(Resource* resource, std::string text, IntVec2 pos, Color color) = 0;
|
2023-06-28 20:43:01 +00:00
|
|
|
virtual void drawTexture(Resource* resource, IntRect size) = 0;
|
2023-06-01 19:19:18 +00:00
|
|
|
|
|
|
|
virtual void useShader(Shader* shader, Point2D points[3]) = 0;
|
|
|
|
virtual void stopUsingShaders() = 0;
|
2023-05-26 21:41:51 +00:00
|
|
|
|
|
|
|
// Pre and Post draw
|
|
|
|
virtual void preDraw() = 0;
|
|
|
|
virtual void postDraw() = 0;
|
|
|
|
|
|
|
|
// Update
|
|
|
|
virtual void update() = 0;
|
|
|
|
|
|
|
|
// Util
|
2023-06-01 19:19:18 +00:00
|
|
|
virtual void compileShader(Shader* shader) = 0;
|
|
|
|
virtual void toggleWireframe() = 0;
|
2023-05-26 21:41:51 +00:00
|
|
|
virtual void setWindowTitle(std::string title) = 0;
|
|
|
|
|
2023-05-27 19:47:34 +00:00
|
|
|
bool mKeepOpen = true;
|
2023-06-01 17:27:14 +00:00
|
|
|
LoggerCallback mLogger;
|
2023-07-30 16:06:47 +00:00
|
|
|
InputManager mInputManager;
|
2023-06-28 20:43:01 +00:00
|
|
|
protected:
|
2023-06-01 19:19:18 +00:00
|
|
|
bool mIsWireframeMode = false;
|
2023-05-26 21:41:51 +00:00
|
|
|
};
|
|
|
|
}
|