diff --git a/engine/client/ref_common.c b/engine/client/ref_common.c index 1a3f43cb..74fc9ec9 100644 --- a/engine/client/ref_common.c +++ b/engine/client/ref_common.c @@ -313,7 +313,7 @@ static screenfade_t *pfnRefGetScreenFade( void ) return &clgame.fade; } -static qboolean R_Init_Video_( const int type ) +static qboolean R_Init_Video_( ref_graphic_apis_t type ) { host.apply_opengl_config = true; Cbuf_AddTextf( "exec %s.cfg\n", ref.dllFuncs.R_GetConfigName()); diff --git a/engine/platform/dos/vid_dos.c b/engine/platform/dos/vid_dos.c index ae5129c2..1fbe843c 100644 --- a/engine/platform/dos/vid_dos.c +++ b/engine/platform/dos/vid_dos.c @@ -49,7 +49,7 @@ static void DOS_GetScreenRes( int *x, int *y ) *y = 200; } -qboolean R_Init_Video( const int type ) +qboolean R_Init_Video( ref_graphic_apis_t type ) { qboolean retval; diff --git a/engine/platform/linux/vid_fbdev.c b/engine/platform/linux/vid_fbdev.c index 24c2be7e..097b9f4c 100644 --- a/engine/platform/linux/vid_fbdev.c +++ b/engine/platform/linux/vid_fbdev.c @@ -50,7 +50,7 @@ void FB_GetScreenRes( int *x, int *y ) *y = fb.vinfo.yres; } -qboolean R_Init_Video( const int type ) +qboolean R_Init_Video( ref_graphic_apis_t type ) { qboolean retval; string fbdev = DEFAULT_FBDEV; diff --git a/engine/platform/platform.h b/engine/platform/platform.h index fce82b98..7eb0bca8 100644 --- a/engine/platform/platform.h +++ b/engine/platform/platform.h @@ -320,9 +320,10 @@ typedef enum struct vidmode_s; typedef enum window_mode_e window_mode_t; typedef enum ref_window_type_e ref_window_type_t; +typedef enum ref_graphic_apis_e ref_graphic_apis_t; // Window -qboolean R_Init_Video( const int type ); +qboolean R_Init_Video( ref_graphic_apis_t type ); void R_Free_Video( void ); qboolean VID_SetMode( void ); rserr_t R_ChangeDisplaySettings( int width, int height, window_mode_t window_mode ); diff --git a/engine/platform/sdl1/vid_sdl1.c b/engine/platform/sdl1/vid_sdl1.c index 2917170c..2bc61d38 100644 --- a/engine/platform/sdl1/vid_sdl1.c +++ b/engine/platform/sdl1/vid_sdl1.c @@ -377,7 +377,7 @@ int GL_GetAttribute( int attr, int *val ) R_Init_Video ================== */ -qboolean R_Init_Video( const int type ) +qboolean R_Init_Video( ref_graphic_apis_t type ) { string safe; qboolean retval; diff --git a/engine/platform/sdl2/vid_sdl2.c b/engine/platform/sdl2/vid_sdl2.c index e9264147..bc139c5a 100644 --- a/engine/platform/sdl2/vid_sdl2.c +++ b/engine/platform/sdl2/vid_sdl2.c @@ -987,7 +987,7 @@ int GL_GetAttribute( int attr, int *val ) R_Init_Video ================== */ -qboolean R_Init_Video( const int type ) +qboolean R_Init_Video( ref_graphic_apis_t type ) { string safe; SDL_DisplayMode displayMode; diff --git a/engine/platform/sdl3/vid_sdl3.c b/engine/platform/sdl3/vid_sdl3.c index fb2d5c3b..420252f9 100644 --- a/engine/platform/sdl3/vid_sdl3.c +++ b/engine/platform/sdl3/vid_sdl3.c @@ -270,7 +270,7 @@ void GL_UpdateSwapInterval( void ) } } -qboolean R_Init_Video( const int type ) +qboolean R_Init_Video( ref_graphic_apis_t type ) { qboolean retval = false; diff --git a/engine/ref_api.h b/engine/ref_api.h index 835b6a5e..3adf3d85 100644 --- a/engine/ref_api.h +++ b/engine/ref_api.h @@ -220,12 +220,12 @@ enum ref_defaultsprite_e // the order of first three is important! // so you can use this value in IEngineStudio.StudioIsHardware -enum ref_graphic_apis_e +typedef enum ref_graphic_apis_e { REF_SOFTWARE, // hypothetical: just make a surface to draw on, in software REF_GL, // create GL context REF_D3D, // Direct3D -}; +} ref_graphic_apis_t; typedef enum { @@ -447,7 +447,7 @@ typedef struct ref_api_s // video init // try to create window // will call GL_SetupAttributes in case of REF_GL - qboolean (*R_Init_Video)( int type ); // will also load and execute renderer config(see R_GetConfigName) + qboolean (*R_Init_Video)( ref_graphic_apis_t type ); // will also load and execute renderer config(see R_GetConfigName) void (*R_Free_Video)( void ); // GL