-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrenderer.h
More file actions
35 lines (22 loc) · 791 Bytes
/
renderer.h
File metadata and controls
35 lines (22 loc) · 791 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#pragma once
#include "config.h"
#include <SDL2/SDL.h>
#include <SDL2/SDL_ttf.h>
class Renderer {
public:
Renderer() {}
int init(SDL_Window *window);
void update() const;
int load_tiles(const char *fname);
void render_tile(int sx, int sy, int dx, int dy) const;
void render_tile(int sx, int sy, int dx, int dy, double angle) const;
void render_string(const char *str, int size, SDL_Color& color, int x, int y) const;
void render_string_right(const char *str, int size, SDL_Color& color, int x, int y) const;
SDL_Renderer *get_renderer();
private:
void render_string_(const char *str, int size, SDL_Color& color, int x, int y, bool right) const;
// SDL_Surface *tiles_;
SDL_Surface *window_surface_;
SDL_Renderer *renderer_;
SDL_Texture *tiles_;
};