mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-01 11:56:58 -05:00
Mark DX11 as unsuported if build is created for higher windows version but running on WinXP or lower
This commit is contained in:
parent
5486e6ba1e
commit
86d6e003cc
1 changed files with 23 additions and 0 deletions
23
src/bgfx.cpp
23
src/bgfx.cpp
|
@ -1351,6 +1351,28 @@ namespace bgfx
|
||||||
#endif // BX_PLATFORM_WINDOWS
|
#endif // BX_PLATFORM_WINDOWS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool windowsVersionIsOrBellow(uint32_t _version)
|
||||||
|
{
|
||||||
|
#if BX_PLATFORM_WINDOWS
|
||||||
|
OSVERSIONINFOEXA ovi;
|
||||||
|
memset(&ovi, 0, sizeof(ovi));
|
||||||
|
ovi.dwOSVersionInfoSize = sizeof(ovi);
|
||||||
|
// _WIN32_WINNT_WINBLUE 0x0603
|
||||||
|
// _WIN32_WINNT_WIN8 0x0602
|
||||||
|
// _WIN32_WINNT_WIN7 0x0601
|
||||||
|
// _WIN32_WINNT_VISTA 0x0600
|
||||||
|
ovi.dwMajorVersion = HIBYTE(_version);
|
||||||
|
ovi.dwMinorVersion = LOBYTE(_version);
|
||||||
|
DWORDLONG cond = 0;
|
||||||
|
VER_SET_CONDITION(cond, VER_MAJORVERSION, VER_LESS_EQUAL);
|
||||||
|
VER_SET_CONDITION(cond, VER_MINORVERSION, VER_LESS_EQUAL);
|
||||||
|
return !!VerifyVersionInfoA(&ovi, VER_MAJORVERSION | VER_MINORVERSION, cond);
|
||||||
|
#else
|
||||||
|
BX_UNUSED(_version);
|
||||||
|
return false;
|
||||||
|
#endif // BX_PLATFORM_WINDOWS
|
||||||
|
}
|
||||||
|
|
||||||
RendererContextI* rendererCreate(RendererType::Enum _type)
|
RendererContextI* rendererCreate(RendererType::Enum _type)
|
||||||
{
|
{
|
||||||
if (RendererType::Count == _type)
|
if (RendererType::Count == _type)
|
||||||
|
@ -1891,6 +1913,7 @@ again:
|
||||||
uint8_t num = 0;
|
uint8_t num = 0;
|
||||||
for (uint8_t ii = 0; ii < uint8_t(RendererType::Count); ++ii)
|
for (uint8_t ii = 0; ii < uint8_t(RendererType::Count); ++ii)
|
||||||
{
|
{
|
||||||
|
if ((ii == RendererType::Direct3D11) && windowsVersionIsOrBellow(0x0502)) continue;
|
||||||
if (s_rendererCreator[ii].supported)
|
if (s_rendererCreator[ii].supported)
|
||||||
{
|
{
|
||||||
_enum[num++] = RendererType::Enum(ii);
|
_enum[num++] = RendererType::Enum(ii);
|
||||||
|
|
Loading…
Reference in a new issue