Fixed mingw Windows build, since SDL_vulkan_internal.h includes windows.h

This commit is contained in:
Sam Lantinga 2017-08-28 00:43:14 -07:00
parent 0d011ec66d
commit 50efbda736
22 changed files with 37 additions and 43 deletions

View File

@ -24,7 +24,6 @@
#include "SDL.h" #include "SDL.h"
#include "SDL_events.h" #include "SDL_events.h"
#include "SDL_syswm.h"
#include "SDL_thread.h" #include "SDL_thread.h"
#include "SDL_events_c.h" #include "SDL_events_c.h"
#include "../timer/SDL_timer_c.h" #include "../timer/SDL_timer_c.h"
@ -32,6 +31,7 @@
#include "../joystick/SDL_joystick_c.h" #include "../joystick/SDL_joystick_c.h"
#endif #endif
#include "../video/SDL_sysvideo.h" #include "../video/SDL_sysvideo.h"
#include "SDL_syswm.h"
/*#define SDL_DEBUG_EVENTS 1*/ /*#define SDL_DEBUG_EVENTS 1*/

View File

@ -207,8 +207,8 @@ struct SDL_VideoDevice
/* /*
* Window functions * Window functions
*/ */
int (*CreateWindow) (_THIS, SDL_Window * window); int (*CreateSDLWindow) (_THIS, SDL_Window * window);
int (*CreateWindowFrom) (_THIS, SDL_Window * window, const void *data); int (*CreateSDLWindowFrom) (_THIS, SDL_Window * window, const void *data);
void (*SetWindowTitle) (_THIS, SDL_Window * window); void (*SetWindowTitle) (_THIS, SDL_Window * window);
void (*SetWindowIcon) (_THIS, SDL_Window * window, SDL_Surface * icon); void (*SetWindowIcon) (_THIS, SDL_Window * window, SDL_Surface * icon);
void (*SetWindowPosition) (_THIS, SDL_Window * window); void (*SetWindowPosition) (_THIS, SDL_Window * window);

View File

@ -52,11 +52,6 @@
#endif #endif
#endif #endif
/* On Windows, windows.h defines CreateWindow */
#ifdef CreateWindow
#undef CreateWindow
#endif
#ifdef __EMSCRIPTEN__ #ifdef __EMSCRIPTEN__
#include <emscripten.h> #include <emscripten.h>
#endif #endif
@ -1479,7 +1474,7 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)
} }
_this->windows = window; _this->windows = window;
if (_this->CreateWindow && _this->CreateWindow(_this, window) < 0) { if (_this->CreateSDLWindow && _this->CreateSDLWindow(_this, window) < 0) {
SDL_DestroyWindow(window); SDL_DestroyWindow(window);
return NULL; return NULL;
} }
@ -1516,7 +1511,7 @@ SDL_CreateWindowFrom(const void *data)
SDL_UninitializedVideo(); SDL_UninitializedVideo();
return NULL; return NULL;
} }
if (!_this->CreateWindowFrom) { if (!_this->CreateSDLWindowFrom) {
SDL_Unsupported(); SDL_Unsupported();
return NULL; return NULL;
} }
@ -1538,7 +1533,7 @@ SDL_CreateWindowFrom(const void *data)
} }
_this->windows = window; _this->windows = window;
if (_this->CreateWindowFrom(_this, window, data) < 0) { if (_this->CreateSDLWindowFrom(_this, window, data) < 0) {
SDL_DestroyWindow(window); SDL_DestroyWindow(window);
return NULL; return NULL;
} }
@ -1602,8 +1597,8 @@ SDL_RecreateWindow(SDL_Window * window, Uint32 flags)
window->last_fullscreen_flags = window->flags; window->last_fullscreen_flags = window->flags;
window->is_destroying = SDL_FALSE; window->is_destroying = SDL_FALSE;
if (_this->CreateWindow && !(flags & SDL_WINDOW_FOREIGN)) { if (_this->CreateSDLWindow && !(flags & SDL_WINDOW_FOREIGN)) {
if (_this->CreateWindow(_this, window) < 0) { if (_this->CreateSDLWindow(_this, window) < 0) {
if (loaded_opengl) { if (loaded_opengl) {
SDL_GL_UnloadLibrary(); SDL_GL_UnloadLibrary();
window->flags &= ~SDL_WINDOW_OPENGL; window->flags &= ~SDL_WINDOW_OPENGL;

View File

@ -49,6 +49,7 @@
#endif #endif
#if SDL_VIDEO_DRIVER_WINDOWS #if SDL_VIDEO_DRIVER_WINDOWS
#define VK_USE_PLATFORM_WIN32_KHR #define VK_USE_PLATFORM_WIN32_KHR
#include "../core/windows/SDL_windows.h"
#endif #endif
#if SDL_VIDEO_DRIVER_X11 #if SDL_VIDEO_DRIVER_X11
#define VK_USE_PLATFORM_XLIB_KHR #define VK_USE_PLATFORM_XLIB_KHR

View File

@ -115,7 +115,7 @@ Android_CreateDevice(int devindex)
device->VideoQuit = Android_VideoQuit; device->VideoQuit = Android_VideoQuit;
device->PumpEvents = Android_PumpEvents; device->PumpEvents = Android_PumpEvents;
device->CreateWindow = Android_CreateWindow; device->CreateSDLWindow = Android_CreateWindow;
device->SetWindowTitle = Android_SetWindowTitle; device->SetWindowTitle = Android_SetWindowTitle;
device->DestroyWindow = Android_DestroyWindow; device->DestroyWindow = Android_DestroyWindow;
device->GetWindowWMInfo = Android_GetWindowWMInfo; device->GetWindowWMInfo = Android_GetWindowWMInfo;

View File

@ -81,8 +81,8 @@ Cocoa_CreateDevice(int devindex)
device->PumpEvents = Cocoa_PumpEvents; device->PumpEvents = Cocoa_PumpEvents;
device->SuspendScreenSaver = Cocoa_SuspendScreenSaver; device->SuspendScreenSaver = Cocoa_SuspendScreenSaver;
device->CreateWindow = Cocoa_CreateWindow; device->CreateSDLWindow = Cocoa_CreateWindow;
device->CreateWindowFrom = Cocoa_CreateWindowFrom; device->CreateSDLWindowFrom = Cocoa_CreateWindowFrom;
device->SetWindowTitle = Cocoa_SetWindowTitle; device->SetWindowTitle = Cocoa_SetWindowTitle;
device->SetWindowIcon = Cocoa_SetWindowIcon; device->SetWindowIcon = Cocoa_SetWindowIcon;
device->SetWindowPosition = Cocoa_SetWindowPosition; device->SetWindowPosition = Cocoa_SetWindowPosition;

View File

@ -109,8 +109,8 @@ DirectFB_CreateDevice(int devindex)
device->GetDisplayModes = DirectFB_GetDisplayModes; device->GetDisplayModes = DirectFB_GetDisplayModes;
device->SetDisplayMode = DirectFB_SetDisplayMode; device->SetDisplayMode = DirectFB_SetDisplayMode;
device->PumpEvents = DirectFB_PumpEventsWindow; device->PumpEvents = DirectFB_PumpEventsWindow;
device->CreateWindow = DirectFB_CreateWindow; device->CreateSDLWindow = DirectFB_CreateWindow;
device->CreateWindowFrom = DirectFB_CreateWindowFrom; device->CreateSDLWindowFrom = DirectFB_CreateWindowFrom;
device->SetWindowTitle = DirectFB_SetWindowTitle; device->SetWindowTitle = DirectFB_SetWindowTitle;
device->SetWindowIcon = DirectFB_SetWindowIcon; device->SetWindowIcon = DirectFB_SetWindowIcon;
device->SetWindowPosition = DirectFB_SetWindowPosition; device->SetWindowPosition = DirectFB_SetWindowPosition;

View File

@ -91,8 +91,7 @@ Emscripten_CreateDevice(int devindex)
device->PumpEvents = Emscripten_PumpEvents; device->PumpEvents = Emscripten_PumpEvents;
device->CreateWindow = Emscripten_CreateWindow; device->CreateSDLWindow = Emscripten_CreateWindow;
/*device->CreateWindowFrom = Emscripten_CreateWindowFrom;*/
device->SetWindowTitle = Emscripten_SetWindowTitle; device->SetWindowTitle = Emscripten_SetWindowTitle;
/*device->SetWindowIcon = Emscripten_SetWindowIcon; /*device->SetWindowIcon = Emscripten_SetWindowIcon;
device->SetWindowPosition = Emscripten_SetWindowPosition;*/ device->SetWindowPosition = Emscripten_SetWindowPosition;*/

View File

@ -68,8 +68,8 @@ BE_CreateDevice(int devindex)
device->SetDisplayMode = BE_SetDisplayMode; device->SetDisplayMode = BE_SetDisplayMode;
device->PumpEvents = BE_PumpEvents; device->PumpEvents = BE_PumpEvents;
device->CreateWindow = BE_CreateWindow; device->CreateSDLWindow = BE_CreateWindow;
device->CreateWindowFrom = BE_CreateWindowFrom; device->CreateSDLWindowFrom = BE_CreateWindowFrom;
device->SetWindowTitle = BE_SetWindowTitle; device->SetWindowTitle = BE_SetWindowTitle;
device->SetWindowIcon = BE_SetWindowIcon; device->SetWindowIcon = BE_SetWindowIcon;
device->SetWindowPosition = BE_SetWindowPosition; device->SetWindowPosition = BE_SetWindowPosition;

View File

@ -120,8 +120,8 @@ KMSDRM_Create(int devindex)
device->VideoQuit = KMSDRM_VideoQuit; device->VideoQuit = KMSDRM_VideoQuit;
device->GetDisplayModes = KMSDRM_GetDisplayModes; device->GetDisplayModes = KMSDRM_GetDisplayModes;
device->SetDisplayMode = KMSDRM_SetDisplayMode; device->SetDisplayMode = KMSDRM_SetDisplayMode;
device->CreateWindow = KMSDRM_CreateWindow; device->CreateSDLWindow = KMSDRM_CreateWindow;
device->CreateWindowFrom = KMSDRM_CreateWindowFrom; device->CreateSDLWindowFrom = KMSDRM_CreateWindowFrom;
device->SetWindowTitle = KMSDRM_SetWindowTitle; device->SetWindowTitle = KMSDRM_SetWindowTitle;
device->SetWindowIcon = KMSDRM_SetWindowIcon; device->SetWindowIcon = KMSDRM_SetWindowIcon;
device->SetWindowPosition = KMSDRM_SetWindowPosition; device->SetWindowPosition = KMSDRM_SetWindowPosition;

View File

@ -180,7 +180,7 @@ MIR_CreateDevice(int device_index)
device->GL_GetProcAddress = MIR_GL_GetProcAddress; device->GL_GetProcAddress = MIR_GL_GetProcAddress;
/* mirwindow */ /* mirwindow */
device->CreateWindow = MIR_CreateWindow; device->CreateSDLWindow = MIR_CreateWindow;
device->DestroyWindow = MIR_DestroyWindow; device->DestroyWindow = MIR_DestroyWindow;
device->GetWindowWMInfo = MIR_GetWindowWMInfo; device->GetWindowWMInfo = MIR_GetWindowWMInfo;
device->SetWindowFullscreen = MIR_SetWindowFullscreen; device->SetWindowFullscreen = MIR_SetWindowFullscreen;
@ -197,7 +197,7 @@ MIR_CreateDevice(int device_index)
device->SetWindowGammaRamp = MIR_SetWindowGammaRamp; device->SetWindowGammaRamp = MIR_SetWindowGammaRamp;
device->GetWindowGammaRamp = MIR_GetWindowGammaRamp; device->GetWindowGammaRamp = MIR_GetWindowGammaRamp;
device->CreateWindowFrom = NULL; device->CreateSDLWindowFrom = NULL;
device->SetWindowIcon = NULL; device->SetWindowIcon = NULL;
device->RaiseWindow = NULL; device->RaiseWindow = NULL;
device->SetWindowBordered = NULL; device->SetWindowBordered = NULL;

View File

@ -107,7 +107,7 @@ static SDL_VideoDevice *NACL_CreateDevice(int devindex) {
device->VideoQuit = NACL_VideoQuit; device->VideoQuit = NACL_VideoQuit;
device->PumpEvents = NACL_PumpEvents; device->PumpEvents = NACL_PumpEvents;
device->CreateWindow = NACL_CreateWindow; device->CreateSDLWindow = NACL_CreateWindow;
device->SetWindowTitle = NACL_SetWindowTitle; device->SetWindowTitle = NACL_SetWindowTitle;
device->DestroyWindow = NACL_DestroyWindow; device->DestroyWindow = NACL_DestroyWindow;

View File

@ -102,8 +102,8 @@ PND_create()
device->VideoQuit = PND_videoquit; device->VideoQuit = PND_videoquit;
device->GetDisplayModes = PND_getdisplaymodes; device->GetDisplayModes = PND_getdisplaymodes;
device->SetDisplayMode = PND_setdisplaymode; device->SetDisplayMode = PND_setdisplaymode;
device->CreateWindow = PND_createwindow; device->CreateSDLWindow = PND_createwindow;
device->CreateWindowFrom = PND_createwindowfrom; device->CreateSDLWindowFrom = PND_createwindowfrom;
device->SetWindowTitle = PND_setwindowtitle; device->SetWindowTitle = PND_setwindowtitle;
device->SetWindowIcon = PND_setwindowicon; device->SetWindowIcon = PND_setwindowicon;
device->SetWindowPosition = PND_setwindowposition; device->SetWindowPosition = PND_setwindowposition;

View File

@ -113,8 +113,8 @@ PSP_Create()
device->VideoQuit = PSP_VideoQuit; device->VideoQuit = PSP_VideoQuit;
device->GetDisplayModes = PSP_GetDisplayModes; device->GetDisplayModes = PSP_GetDisplayModes;
device->SetDisplayMode = PSP_SetDisplayMode; device->SetDisplayMode = PSP_SetDisplayMode;
device->CreateWindow = PSP_CreateWindow; device->CreateSDLWindow = PSP_CreateWindow;
device->CreateWindowFrom = PSP_CreateWindowFrom; device->CreateSDLWindowFrom = PSP_CreateWindowFrom;
device->SetWindowTitle = PSP_SetWindowTitle; device->SetWindowTitle = PSP_SetWindowTitle;
device->SetWindowIcon = PSP_SetWindowIcon; device->SetWindowIcon = PSP_SetWindowIcon;
device->SetWindowPosition = PSP_SetWindowPosition; device->SetWindowPosition = PSP_SetWindowPosition;

View File

@ -330,7 +330,7 @@ createDevice(int devindex)
device->driverdata = NULL; device->driverdata = NULL;
device->VideoInit = videoInit; device->VideoInit = videoInit;
device->VideoQuit = videoQuit; device->VideoQuit = videoQuit;
device->CreateWindow = createWindow; device->CreateSDLWindow = createWindow;
device->CreateWindowFramebuffer = createWindowFramebuffer; device->CreateWindowFramebuffer = createWindowFramebuffer;
device->UpdateWindowFramebuffer = updateWindowFramebuffer; device->UpdateWindowFramebuffer = updateWindowFramebuffer;
device->SetWindowSize = setWindowSize; device->SetWindowSize = setWindowSize;

View File

@ -97,8 +97,8 @@ RPI_Create()
device->VideoQuit = RPI_VideoQuit; device->VideoQuit = RPI_VideoQuit;
device->GetDisplayModes = RPI_GetDisplayModes; device->GetDisplayModes = RPI_GetDisplayModes;
device->SetDisplayMode = RPI_SetDisplayMode; device->SetDisplayMode = RPI_SetDisplayMode;
device->CreateWindow = RPI_CreateWindow; device->CreateSDLWindow = RPI_CreateWindow;
device->CreateWindowFrom = RPI_CreateWindowFrom; device->CreateSDLWindowFrom = RPI_CreateWindowFrom;
device->SetWindowTitle = RPI_SetWindowTitle; device->SetWindowTitle = RPI_SetWindowTitle;
device->SetWindowIcon = RPI_SetWindowIcon; device->SetWindowIcon = RPI_SetWindowIcon;
device->SetWindowPosition = RPI_SetWindowPosition; device->SetWindowPosition = RPI_SetWindowPosition;

View File

@ -91,7 +91,7 @@ UIKit_CreateDevice(int devindex)
device->SetDisplayMode = UIKit_SetDisplayMode; device->SetDisplayMode = UIKit_SetDisplayMode;
device->PumpEvents = UIKit_PumpEvents; device->PumpEvents = UIKit_PumpEvents;
device->SuspendScreenSaver = UIKit_SuspendScreenSaver; device->SuspendScreenSaver = UIKit_SuspendScreenSaver;
device->CreateWindow = UIKit_CreateWindow; device->CreateSDLWindow = UIKit_CreateWindow;
device->SetWindowTitle = UIKit_SetWindowTitle; device->SetWindowTitle = UIKit_SetWindowTitle;
device->ShowWindow = UIKit_ShowWindow; device->ShowWindow = UIKit_ShowWindow;
device->HideWindow = UIKit_HideWindow; device->HideWindow = UIKit_HideWindow;

View File

@ -88,7 +88,7 @@ VIVANTE_Create()
device->VideoQuit = VIVANTE_VideoQuit; device->VideoQuit = VIVANTE_VideoQuit;
device->GetDisplayModes = VIVANTE_GetDisplayModes; device->GetDisplayModes = VIVANTE_GetDisplayModes;
device->SetDisplayMode = VIVANTE_SetDisplayMode; device->SetDisplayMode = VIVANTE_SetDisplayMode;
device->CreateWindow = VIVANTE_CreateWindow; device->CreateSDLWindow = VIVANTE_CreateWindow;
device->SetWindowTitle = VIVANTE_SetWindowTitle; device->SetWindowTitle = VIVANTE_SetWindowTitle;
device->SetWindowPosition = VIVANTE_SetWindowPosition; device->SetWindowPosition = VIVANTE_SetWindowPosition;
device->SetWindowSize = VIVANTE_SetWindowSize; device->SetWindowSize = VIVANTE_SetWindowSize;

View File

@ -168,7 +168,7 @@ Wayland_CreateDevice(int devindex)
device->GL_GetProcAddress = Wayland_GLES_GetProcAddress; device->GL_GetProcAddress = Wayland_GLES_GetProcAddress;
device->GL_DeleteContext = Wayland_GLES_DeleteContext; device->GL_DeleteContext = Wayland_GLES_DeleteContext;
device->CreateWindow = Wayland_CreateWindow; device->CreateSDLWindow = Wayland_CreateWindow;
device->ShowWindow = Wayland_ShowWindow; device->ShowWindow = Wayland_ShowWindow;
device->SetWindowFullscreen = Wayland_SetWindowFullscreen; device->SetWindowFullscreen = Wayland_SetWindowFullscreen;
device->MaximizeWindow = Wayland_MaximizeWindow; device->MaximizeWindow = Wayland_MaximizeWindow;

View File

@ -137,9 +137,8 @@ WIN_CreateDevice(int devindex)
device->SetDisplayMode = WIN_SetDisplayMode; device->SetDisplayMode = WIN_SetDisplayMode;
device->PumpEvents = WIN_PumpEvents; device->PumpEvents = WIN_PumpEvents;
#undef CreateWindow device->CreateSDLWindow = WIN_CreateWindow;
device->CreateWindow = WIN_CreateWindow; device->CreateSDLWindowFrom = WIN_CreateWindowFrom;
device->CreateWindowFrom = WIN_CreateWindowFrom;
device->SetWindowTitle = WIN_SetWindowTitle; device->SetWindowTitle = WIN_SetWindowTitle;
device->SetWindowIcon = WIN_SetWindowIcon; device->SetWindowIcon = WIN_SetWindowIcon;
device->SetWindowPosition = WIN_SetWindowPosition; device->SetWindowPosition = WIN_SetWindowPosition;

View File

@ -140,7 +140,7 @@ WINRT_CreateDevice(int devindex)
/* Set the function pointers */ /* Set the function pointers */
device->VideoInit = WINRT_VideoInit; device->VideoInit = WINRT_VideoInit;
device->VideoQuit = WINRT_VideoQuit; device->VideoQuit = WINRT_VideoQuit;
device->CreateWindow = WINRT_CreateWindow; device->CreateSDLWindow = WINRT_CreateWindow;
device->SetWindowSize = WINRT_SetWindowSize; device->SetWindowSize = WINRT_SetWindowSize;
device->SetWindowFullscreen = WINRT_SetWindowFullscreen; device->SetWindowFullscreen = WINRT_SetWindowFullscreen;
device->DestroyWindow = WINRT_DestroyWindow; device->DestroyWindow = WINRT_DestroyWindow;

View File

@ -231,8 +231,8 @@ X11_CreateDevice(int devindex)
device->SuspendScreenSaver = X11_SuspendScreenSaver; device->SuspendScreenSaver = X11_SuspendScreenSaver;
device->PumpEvents = X11_PumpEvents; device->PumpEvents = X11_PumpEvents;
device->CreateWindow = X11_CreateWindow; device->CreateSDLWindow = X11_CreateWindow;
device->CreateWindowFrom = X11_CreateWindowFrom; device->CreateSDLWindowFrom = X11_CreateWindowFrom;
device->SetWindowTitle = X11_SetWindowTitle; device->SetWindowTitle = X11_SetWindowTitle;
device->SetWindowIcon = X11_SetWindowIcon; device->SetWindowIcon = X11_SetWindowIcon;
device->SetWindowPosition = X11_SetWindowPosition; device->SetWindowPosition = X11_SetWindowPosition;