diff --git a/include/QF/vid.h b/include/QF/vid.h index 6b03b3c9b..6987ebfc8 100644 --- a/include/QF/vid.h +++ b/include/QF/vid.h @@ -52,6 +52,7 @@ typedef struct { struct vid_internal_s *vid_internal; struct viddef_listener_set_s *onPaletteChanged; + struct viddef_listener_set_s *onVidResize; } viddef_t; typedef struct viddef_listener_set_s LISTENER_SET_TYPE (viddef_t) @@ -76,5 +77,7 @@ void VID_ClearMemory (void); void VID_OnPaletteChange_AddListener (viddef_listener_t listener, void *data); void VID_OnPaletteChange_RemoveListener (viddef_listener_t listener, void *data); +void VID_OnVidResize_AddListener (viddef_listener_t listener, void *data); +void VID_OnVidResize_RemoveListener (viddef_listener_t listener, void *data); #endif//__QF_vid_h diff --git a/include/vid_internal.h b/include/vid_internal.h index f413d4d66..e79fa9a9b 100644 --- a/include/vid_internal.h +++ b/include/vid_internal.h @@ -33,6 +33,7 @@ extern int vid_system_gamma; extern float vid_gamma; void VID_GetWindowSize (int def_w, int def_h); +void VID_SetWindowSize (int width, int height); void VID_InitGamma (const byte *); qboolean VID_SetGamma (double); diff --git a/libs/video/targets/vid.c b/libs/video/targets/vid.c index d6547250a..51c235440 100644 --- a/libs/video/targets/vid.c +++ b/libs/video/targets/vid.c @@ -291,6 +291,24 @@ VID_OnPaletteChange_RemoveListener (viddef_listener_t listener, void *data) } } +VISIBLE void +VID_OnVidResize_AddListener (viddef_listener_t listener, void *data) +{ + if (!viddef.onVidResize) { + viddef.onVidResize = malloc (sizeof (*viddef.onVidResize)); + LISTENER_SET_INIT (viddef.onVidResize, 8); + } + LISTENER_ADD (viddef.onVidResize, listener, data); +} + +VISIBLE void +VID_OnVidResize_RemoveListener (viddef_listener_t listener, void *data) +{ + if (viddef.onVidResize) { + LISTENER_REMOVE (viddef.onVidResize, listener, data); + } +} + VISIBLE void VID_Init (byte *palette, byte *colormap) {