mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-02 16:08:30 +00:00
removed WinRT support.
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
#include "../../SDL_internal.h"
|
||||
|
||||
#if defined(__WIN32__) || defined(__WINRT__) || defined(__GDK__)
|
||||
#if defined(__WIN32__) || defined(__GDK__)
|
||||
|
||||
#include "SDL_windows.h"
|
||||
#include "SDL_error.h"
|
||||
@@ -89,14 +89,7 @@ WIN_CoInitialize(void)
|
||||
|
||||
If you need multi-threaded mode, call CoInitializeEx() before SDL_Init()
|
||||
*/
|
||||
#ifdef __WINRT__
|
||||
/* DLudwig: On WinRT, it is assumed that COM was initialized in main().
|
||||
CoInitializeEx is available (not CoInitialize though), however
|
||||
on WinRT, main() is typically declared with the [MTAThread]
|
||||
attribute, which, AFAIK, should initialize COM.
|
||||
*/
|
||||
return S_OK;
|
||||
#elif defined(__XBOXONE__) || defined(__XBOXSERIES__)
|
||||
#if defined(__XBOXONE__) || defined(__XBOXSERIES__)
|
||||
/* On Xbox, there's no need to call CoInitializeEx (and it's not implemented) */
|
||||
return S_OK;
|
||||
#else
|
||||
@@ -118,12 +111,9 @@ WIN_CoInitialize(void)
|
||||
void
|
||||
WIN_CoUninitialize(void)
|
||||
{
|
||||
#ifndef __WINRT__
|
||||
CoUninitialize();
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef __WINRT__
|
||||
void *
|
||||
WIN_LoadComBaseFunction(const char *name)
|
||||
{
|
||||
@@ -140,14 +130,10 @@ WIN_LoadComBaseFunction(const char *name)
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
HRESULT
|
||||
WIN_RoInitialize(void)
|
||||
{
|
||||
#ifdef __WINRT__
|
||||
return S_OK;
|
||||
#else
|
||||
typedef HRESULT (WINAPI *RoInitialize_t)(RO_INIT_TYPE initType);
|
||||
RoInitialize_t RoInitializeFunc = (RoInitialize_t)WIN_LoadComBaseFunction("RoInitialize");
|
||||
if (RoInitializeFunc) {
|
||||
@@ -167,22 +153,19 @@ WIN_RoInitialize(void)
|
||||
} else {
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
WIN_RoUninitialize(void)
|
||||
{
|
||||
#ifndef __WINRT__
|
||||
typedef void (WINAPI *RoUninitialize_t)(void);
|
||||
RoUninitialize_t RoUninitializeFunc = (RoUninitialize_t)WIN_LoadComBaseFunction("RoUninitialize");
|
||||
if (RoUninitializeFunc) {
|
||||
RoUninitializeFunc();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(__WINRT__) && !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
|
||||
#if !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
|
||||
static BOOL
|
||||
IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor)
|
||||
{
|
||||
@@ -206,7 +189,7 @@ IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServiceP
|
||||
|
||||
BOOL WIN_IsWindowsVistaOrGreater(void)
|
||||
{
|
||||
#if defined(__WINRT__) || defined(__XBOXONE__) || defined(__XBOXSERIES__)
|
||||
#if defined(__XBOXONE__) || defined(__XBOXSERIES__)
|
||||
return TRUE;
|
||||
#else
|
||||
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_WIN32_WINNT_VISTA), 0);
|
||||
@@ -215,7 +198,7 @@ BOOL WIN_IsWindowsVistaOrGreater(void)
|
||||
|
||||
BOOL WIN_IsWindows7OrGreater(void)
|
||||
{
|
||||
#if defined(__WINRT__) || defined(__XBOXONE__) || defined(__XBOXSERIES__)
|
||||
#if defined(__XBOXONE__) || defined(__XBOXSERIES__)
|
||||
return TRUE;
|
||||
#else
|
||||
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN7), LOBYTE(_WIN32_WINNT_WIN7), 0);
|
||||
@@ -224,7 +207,7 @@ BOOL WIN_IsWindows7OrGreater(void)
|
||||
|
||||
BOOL WIN_IsWindows8OrGreater(void)
|
||||
{
|
||||
#if defined(__WINRT__) || defined(__XBOXONE__) || defined(__XBOXSERIES__)
|
||||
#if defined(__XBOXONE__) || defined(__XBOXSERIES__)
|
||||
return TRUE;
|
||||
#else
|
||||
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN8), LOBYTE(_WIN32_WINNT_WIN8), 0);
|
||||
@@ -255,8 +238,8 @@ WASAPI doesn't need this. This is just for DirectSound/WinMM.
|
||||
char *
|
||||
WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid)
|
||||
{
|
||||
#if defined(__WINRT__) || defined(__XBOXONE__) || defined(__XBOXSERIES__)
|
||||
return WIN_StringToUTF8(name); /* No registry access on WinRT/UWP and Xbox, go with what we've got. */
|
||||
#if defined(__XBOXONE__) || defined(__XBOXSERIES__)
|
||||
return WIN_StringToUTF8(name); /* No registry access on Xbox, go with what we've got. */
|
||||
#else
|
||||
static const GUID nullguid = { 0 };
|
||||
const unsigned char *ptr;
|
||||
@@ -308,7 +291,7 @@ WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid)
|
||||
retval = WIN_StringToUTF8(strw);
|
||||
SDL_free(strw);
|
||||
return retval ? retval : WIN_StringToUTF8(name);
|
||||
#endif /* if __WINRT__ / else */
|
||||
#endif /**/
|
||||
}
|
||||
|
||||
BOOL
|
||||
@@ -341,6 +324,6 @@ WIN_RectToRECT(const SDL_Rect *sdlrect, RECT *winrect)
|
||||
winrect->bottom = sdlrect->y + sdlrect->h - 1;
|
||||
}
|
||||
|
||||
#endif /* defined(__WIN32__) || defined(__WINRT__) || defined(__GDK__) */
|
||||
#endif /* defined(__WIN32__) || defined(__GDK__) */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
Reference in New Issue
Block a user