vk: Support for the SDL 3.1.3 Preview release

https://github.com/yquake2/ref_vk/pull/51
https://github.com/yquake2/yquake2/issues/1156
This commit is contained in:
Jaime Moreira 2024-10-14 22:36:00 -03:00 committed by Denis Pauk
parent e905ae1e09
commit d9de3ea0df

View file

@ -1716,6 +1716,20 @@ static int RE_PrepareForWindow(void)
return SDL_WINDOW_VULKAN;
}
static int
RE_GetSDLVersion(void)
{
#ifdef USE_SDL3
int version = SDL_GetVersion();
return SDL_VERSIONNUM_MAJOR(version);
#else
SDL_version ver;
SDL_VERSION(&ver);
return ver.major;
#endif
}
/*
===============
GetRefAPI
@ -1726,18 +1740,10 @@ GetRefAPI(refimport_t imp)
{
refexport_t refexport = {0};
// Need to communicate the SDL major version to the client.
#ifdef USE_SDL3
SDL_Version ver;
#else
SDL_version ver;
#endif
SDL_VERSION(&ver);
ri = imp;
refexport.api_version = API_VERSION;
refexport.framework_version = ver.major;
refexport.framework_version = RE_GetSDLVersion();
refexport.BeginRegistration = RE_BeginRegistration;
refexport.RegisterModel = RE_RegisterModel;