Bläddra i källkod

windows: added WIN_IsWindows7OrGreater().

Ryan C. Gordon 7 år sedan
förälder
incheckning
ed64d54dfd
2 ändrade filer med 12 tillägg och 0 borttagningar
  1. 9 0
      src/core/windows/SDL_windows.c
  2. 3 0
      src/core/windows/SDL_windows.h

+ 9 - 0
src/core/windows/SDL_windows.c

@@ -124,6 +124,15 @@ BOOL WIN_IsWindowsVistaOrGreater(void)
 #endif
 #endif
 }
 }
 
 
+BOOL WIN_IsWindows7OrGreater(void)
+{
+#ifdef __WINRT__
+    return TRUE;
+#else
+    return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN7), LOBYTE(_WIN32_WINNT_WIN7), 0);
+#endif
+}
+
 /*
 /*
 WAVExxxCAPS gives you 31 bytes for the device name, and just truncates if it's
 WAVExxxCAPS gives you 31 bytes for the device name, and just truncates if it's
 longer. However, since WinXP, you can use the WAVExxxCAPS2 structure, which
 longer. However, since WinXP, you can use the WAVExxxCAPS2 structure, which

+ 3 - 0
src/core/windows/SDL_windows.h

@@ -60,6 +60,9 @@ extern void WIN_CoUninitialize(void);
 /* Returns SDL_TRUE if we're running on Windows Vista and newer */
 /* Returns SDL_TRUE if we're running on Windows Vista and newer */
 extern BOOL WIN_IsWindowsVistaOrGreater(void);
 extern BOOL WIN_IsWindowsVistaOrGreater(void);
 
 
+/* Returns SDL_TRUE if we're running on Windows 7 and newer */
+extern BOOL WIN_IsWindows7OrGreater(void);
+
 /* You need to SDL_free() the result of this call. */
 /* You need to SDL_free() the result of this call. */
 extern char *WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid);
 extern char *WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid);