From: notaz Date: Wed, 6 Feb 2013 01:45:53 +0000 (+0200) Subject: sdl: add resize callback X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e288d77607c6c0f3eda615f9dcc2cc81f5396f65;p=libpicofe.git sdl: add resize callback --- diff --git a/plat_sdl.c b/plat_sdl.c index f10427d..37370bf 100644 --- a/plat_sdl.c +++ b/plat_sdl.c @@ -24,6 +24,7 @@ SDL_Surface *plat_sdl_screen; SDL_Overlay *plat_sdl_overlay; int plat_sdl_gl_active; +void (*plat_sdl_resize_cb)(int w, int h); void (*plat_sdl_quit_cb)(void); static char vid_drv_name[32]; @@ -117,6 +118,9 @@ int plat_sdl_change_video_mode(int w, int h, int force) } old_fullscreen = plat_target.vout_fullscreen; + if (plat_sdl_resize_cb != NULL) + plat_sdl_resize_cb(plat_sdl_screen->w, plat_sdl_screen->h); + return 0; } diff --git a/plat_sdl.h b/plat_sdl.h index d1d62d6..a953265 100644 --- a/plat_sdl.h +++ b/plat_sdl.h @@ -3,6 +3,7 @@ extern SDL_Surface *plat_sdl_screen; extern SDL_Overlay *plat_sdl_overlay; extern int plat_sdl_gl_active; +extern void (*plat_sdl_resize_cb)(int w, int h); extern void (*plat_sdl_quit_cb)(void); int plat_sdl_init(void);