From 9596af4ac4d0c8dcde83334889f60d6687940b12 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Mon, 14 Dec 2015 19:36:01 -0800 Subject: Scale mouse data based on window size --- render_sdl.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'render_sdl.c') diff --git a/render_sdl.c b/render_sdl.c index 9973371..dbd7389 100755 --- a/render_sdl.c +++ b/render_sdl.c @@ -22,6 +22,8 @@ SDL_Texture *main_texture; SDL_Rect main_clip; SDL_GLContext *main_context; +int main_width, main_height; + uint8_t render_dbg = 0; uint8_t debug_pal = 0; uint8_t render_gl = 1; @@ -96,6 +98,16 @@ int render_num_joysticks() return num_joysticks; } +int render_width() +{ + return main_width; +} + +int render_height() +{ + return main_height; +} + uint32_t render_map_color(uint8_t r, uint8_t g, uint8_t b) { return 255 << 24 | r << 16 | g << 8 | b; @@ -251,6 +263,8 @@ void render_init(int width, int height, char * title, uint32_t fps, uint8_t full width = mode.w; height = mode.h; } + main_width = width; + main_height = height; render_gl = 0; -- cgit v1.2.3