34 lines
588 B
C++
34 lines
588 B
C++
// video.hpp
|
|
|
|
#pragma once
|
|
|
|
#include <SDL3/SDL.h>
|
|
#include <string>
|
|
|
|
class Video {
|
|
public:
|
|
struct Config {
|
|
bool fullscreen{false};
|
|
float zoom{2.0F};
|
|
float width{320.0F};
|
|
float height{240.0F};
|
|
std::string window_caption{};
|
|
bool vsync{true};
|
|
};
|
|
|
|
Video(Config config);
|
|
~Video();
|
|
|
|
void clean(int color);
|
|
void present();
|
|
|
|
private:
|
|
Config config_;
|
|
|
|
SDL_Window* window_{nullptr};
|
|
SDL_Renderer* renderer_{nullptr};
|
|
SDL_Texture* game_texture_{nullptr};
|
|
|
|
auto initSDL() -> int;
|
|
void cleanup();
|
|
}; |