37 lines
716 B
C++
37 lines
716 B
C++
#ifndef GAME_RENDERER_HPP
|
|
#define GAME_RENDERER_HPP
|
|
|
|
#include <string>
|
|
#include <SDL2/SDL.h>
|
|
#include "Sprite.hpp"
|
|
|
|
class GameRenderer
|
|
{
|
|
private:
|
|
SDL_Renderer *renderer;
|
|
SDL_Window *window;
|
|
|
|
std::string title;
|
|
|
|
public:
|
|
int screen_width;
|
|
int screen_height;
|
|
|
|
GameRenderer(const std::string &title, int screen_width, int screen_height);
|
|
|
|
~GameRenderer();
|
|
|
|
Sprite load_sprite(const std::string &file, int width, int height) const;
|
|
|
|
void draw_sprite(Sprite sprite, int x, int y) const;
|
|
|
|
void draw_sprite_rotated(Sprite sprite, int x, int y, double angle) const;
|
|
|
|
void clear_screen(int r, int g, int b, int a) const;
|
|
|
|
void flush() const;
|
|
|
|
void redraw() const;
|
|
};
|
|
|
|
#endif |