aboutsummaryrefslogtreecommitdiff
path: root/graphics/graphics.h
diff options
context:
space:
mode:
authorjacopograndi <jak.sk8@hotmail.it>2021-08-29 13:57:41 +0200
committerjacopograndi <jak.sk8@hotmail.it>2021-08-29 13:57:41 +0200
commitace5c3f3093c50ff7fa6f8b281a377e3788abbd5 (patch)
tree8a52803dc2b777822e9b1cab148bec8798bfeadf /graphics/graphics.h
parenta8bcacc95045102e67f2feabbdddf79535837554 (diff)
adding techs
Diffstat (limited to 'graphics/graphics.h')
-rw-r--r--graphics/graphics.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/graphics/graphics.h b/graphics/graphics.h
index 6b36cbd..dd7e51a 100644
--- a/graphics/graphics.h
+++ b/graphics/graphics.h
@@ -17,13 +17,14 @@
class Graphics_sdl_text {
public:
Graphics_sdl_text();
- int get_text_width (char str[]);
+ int get_width (std::string str);
void render_text (std::string str, vec2 off);
SDL_Renderer* gRenderer;
SDL_Texture *tex;
int char_width[128];
};
+
class Graphics_sdl {
public:
Graphics_sdl (int resx, int resy);
@@ -31,6 +32,9 @@ class Graphics_sdl {
SDL_Renderer* get_renderer ();
void load_sheet ();
void present ();
+ void change_res (int resx, int resy) {
+ SDL_SetWindowSize(window, resx, resy);
+ }
void render_sprite (
int x, int y, int w, int h,
int u, int v, int s, int t);
@@ -65,6 +69,10 @@ class Graphics {
void render (Gst &gst, View &view);
void present ();
+ void change_res (int x, int y) {
+ resx = x; resy = y;
+ backend.change_res(x, y);
+ }
};
#endif \ No newline at end of file