29 lines
620 B
C++
29 lines
620 B
C++
#pragma once
|
|
|
|
#include <SDL3/SDL.h>
|
|
|
|
#include <cstdint>
|
|
|
|
class Screen {
|
|
public:
|
|
static void init();
|
|
static void destroy();
|
|
static auto get() -> Screen*;
|
|
|
|
void clear(std::uint8_t r = 0, std::uint8_t g = 0, std::uint8_t b = 0);
|
|
void present();
|
|
|
|
[[nodiscard]] auto getRenderer() const -> SDL_Renderer* { return renderer_; }
|
|
[[nodiscard]] auto getTarget() const -> SDL_Texture* { return game_texture_; }
|
|
|
|
private:
|
|
Screen();
|
|
~Screen();
|
|
|
|
static Screen* instance;
|
|
|
|
SDL_Window* window_{nullptr};
|
|
SDL_Renderer* renderer_{nullptr};
|
|
SDL_Texture* game_texture_{nullptr};
|
|
};
|