From ace5c3f3093c50ff7fa6f8b281a377e3788abbd5 Mon Sep 17 00:00:00 2001 From: jacopograndi Date: Sun, 29 Aug 2021 13:57:41 +0200 Subject: adding techs --- graphics/graphics.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'graphics/graphics.h') 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 -- cgit v1.2.3-54-g00ecf