44 lines
799 B
C++
44 lines
799 B
C++
|
#pragma once
|
||
|
|
||
|
#include <format>
|
||
|
#include <string>
|
||
|
#include <stdexcept>
|
||
|
#include <SDL2/SDL.h>
|
||
|
|
||
|
#include <callback.hpp>
|
||
|
#include <math/types.hpp>
|
||
|
#include <renderer/renderer.hpp>
|
||
|
|
||
|
namespace hibis {
|
||
|
namespace rsdl {
|
||
|
/** \class RSDL
|
||
|
* Renderer implementation using SDL2 Renderer for the Hibis game engine
|
||
|
*/
|
||
|
class RSDL : public Renderer {
|
||
|
public:
|
||
|
RSDL(std::string title, IntVec2 size, LoggerCallback callback);
|
||
|
|
||
|
~RSDL();
|
||
|
|
||
|
void clearScreen(Color col = Color {0, 0, 0, 1});
|
||
|
|
||
|
void renderCurrent();
|
||
|
|
||
|
void drawText(Resource* resource, std::string text, IntVec2 pos, Color color);
|
||
|
|
||
|
void preDraw();
|
||
|
void postDraw();
|
||
|
|
||
|
void update();
|
||
|
|
||
|
void setWindowTitle(std::string title);
|
||
|
|
||
|
private:
|
||
|
SDL_Window* window;
|
||
|
SDL_Renderer* renderer;
|
||
|
|
||
|
LoggerCallback logger;
|
||
|
};
|
||
|
}
|
||
|
}
|