diff options
Diffstat (limited to 'graphics/graphics.h')
-rw-r--r-- | graphics/graphics.h | 10 |
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 |