Skip to content

Commit

Permalink
Fixed mingw Windows build, since SDL_vulkan_internal.h includes windo…
Browse files Browse the repository at this point in the history
…ws.h
  • Loading branch information
slouken committed Aug 28, 2017
1 parent 0d011ec commit 50efbda
Show file tree
Hide file tree
Showing 22 changed files with 37 additions and 43 deletions.
2 changes: 1 addition & 1 deletion src/events/SDL_events.c
Expand Up @@ -24,14 +24,14 @@

#include "SDL.h"
#include "SDL_events.h"
#include "SDL_syswm.h"
#include "SDL_thread.h"
#include "SDL_events_c.h"
#include "../timer/SDL_timer_c.h"
#if !SDL_JOYSTICK_DISABLED
#include "../joystick/SDL_joystick_c.h"
#endif
#include "../video/SDL_sysvideo.h"
#include "SDL_syswm.h"

/*#define SDL_DEBUG_EVENTS 1*/

Expand Down
4 changes: 2 additions & 2 deletions src/video/SDL_sysvideo.h
Expand Up @@ -207,8 +207,8 @@ struct SDL_VideoDevice
/*
* Window functions
*/
int (*CreateWindow) (_THIS, SDL_Window * window);
int (*CreateWindowFrom) (_THIS, SDL_Window * window, const void *data);
int (*CreateSDLWindow) (_THIS, SDL_Window * window);
int (*CreateSDLWindowFrom) (_THIS, SDL_Window * window, const void *data);
void (*SetWindowTitle) (_THIS, SDL_Window * window);
void (*SetWindowIcon) (_THIS, SDL_Window * window, SDL_Surface * icon);
void (*SetWindowPosition) (_THIS, SDL_Window * window);
Expand Down
15 changes: 5 additions & 10 deletions src/video/SDL_video.c
Expand Up @@ -52,11 +52,6 @@
#endif
#endif

/* On Windows, windows.h defines CreateWindow */
#ifdef CreateWindow
#undef CreateWindow
#endif

#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
Expand Down Expand Up @@ -1479,7 +1474,7 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)
}
_this->windows = window;

if (_this->CreateWindow && _this->CreateWindow(_this, window) < 0) {
if (_this->CreateSDLWindow && _this->CreateSDLWindow(_this, window) < 0) {
SDL_DestroyWindow(window);
return NULL;
}
Expand Down Expand Up @@ -1516,7 +1511,7 @@ SDL_CreateWindowFrom(const void *data)
SDL_UninitializedVideo();
return NULL;
}
if (!_this->CreateWindowFrom) {
if (!_this->CreateSDLWindowFrom) {
SDL_Unsupported();
return NULL;
}
Expand All @@ -1538,7 +1533,7 @@ SDL_CreateWindowFrom(const void *data)
}
_this->windows = window;

if (_this->CreateWindowFrom(_this, window, data) < 0) {
if (_this->CreateSDLWindowFrom(_this, window, data) < 0) {
SDL_DestroyWindow(window);
return NULL;
}
Expand Down Expand Up @@ -1602,8 +1597,8 @@ SDL_RecreateWindow(SDL_Window * window, Uint32 flags)
window->last_fullscreen_flags = window->flags;
window->is_destroying = SDL_FALSE;

if (_this->CreateWindow && !(flags & SDL_WINDOW_FOREIGN)) {
if (_this->CreateWindow(_this, window) < 0) {
if (_this->CreateSDLWindow && !(flags & SDL_WINDOW_FOREIGN)) {
if (_this->CreateSDLWindow(_this, window) < 0) {
if (loaded_opengl) {
SDL_GL_UnloadLibrary();
window->flags &= ~SDL_WINDOW_OPENGL;
Expand Down
1 change: 1 addition & 0 deletions src/video/SDL_vulkan_internal.h
Expand Up @@ -49,6 +49,7 @@
#endif
#if SDL_VIDEO_DRIVER_WINDOWS
#define VK_USE_PLATFORM_WIN32_KHR
#include "../core/windows/SDL_windows.h"
#endif
#if SDL_VIDEO_DRIVER_X11
#define VK_USE_PLATFORM_XLIB_KHR
Expand Down
2 changes: 1 addition & 1 deletion src/video/android/SDL_androidvideo.c
Expand Up @@ -115,7 +115,7 @@ Android_CreateDevice(int devindex)
device->VideoQuit = Android_VideoQuit;
device->PumpEvents = Android_PumpEvents;

device->CreateWindow = Android_CreateWindow;
device->CreateSDLWindow = Android_CreateWindow;
device->SetWindowTitle = Android_SetWindowTitle;
device->DestroyWindow = Android_DestroyWindow;
device->GetWindowWMInfo = Android_GetWindowWMInfo;
Expand Down
4 changes: 2 additions & 2 deletions src/video/cocoa/SDL_cocoavideo.m
Expand Up @@ -81,8 +81,8 @@
device->PumpEvents = Cocoa_PumpEvents;
device->SuspendScreenSaver = Cocoa_SuspendScreenSaver;

device->CreateWindow = Cocoa_CreateWindow;
device->CreateWindowFrom = Cocoa_CreateWindowFrom;
device->CreateSDLWindow = Cocoa_CreateWindow;
device->CreateSDLWindowFrom = Cocoa_CreateWindowFrom;
device->SetWindowTitle = Cocoa_SetWindowTitle;
device->SetWindowIcon = Cocoa_SetWindowIcon;
device->SetWindowPosition = Cocoa_SetWindowPosition;
Expand Down
4 changes: 2 additions & 2 deletions src/video/directfb/SDL_DirectFB_video.c
Expand Up @@ -109,8 +109,8 @@ DirectFB_CreateDevice(int devindex)
device->GetDisplayModes = DirectFB_GetDisplayModes;
device->SetDisplayMode = DirectFB_SetDisplayMode;
device->PumpEvents = DirectFB_PumpEventsWindow;
device->CreateWindow = DirectFB_CreateWindow;
device->CreateWindowFrom = DirectFB_CreateWindowFrom;
device->CreateSDLWindow = DirectFB_CreateWindow;
device->CreateSDLWindowFrom = DirectFB_CreateWindowFrom;
device->SetWindowTitle = DirectFB_SetWindowTitle;
device->SetWindowIcon = DirectFB_SetWindowIcon;
device->SetWindowPosition = DirectFB_SetWindowPosition;
Expand Down
3 changes: 1 addition & 2 deletions src/video/emscripten/SDL_emscriptenvideo.c
Expand Up @@ -91,8 +91,7 @@ Emscripten_CreateDevice(int devindex)

device->PumpEvents = Emscripten_PumpEvents;

device->CreateWindow = Emscripten_CreateWindow;
/*device->CreateWindowFrom = Emscripten_CreateWindowFrom;*/
device->CreateSDLWindow = Emscripten_CreateWindow;
device->SetWindowTitle = Emscripten_SetWindowTitle;
/*device->SetWindowIcon = Emscripten_SetWindowIcon;
device->SetWindowPosition = Emscripten_SetWindowPosition;*/
Expand Down
4 changes: 2 additions & 2 deletions src/video/haiku/SDL_bvideo.cc
Expand Up @@ -68,8 +68,8 @@ BE_CreateDevice(int devindex)
device->SetDisplayMode = BE_SetDisplayMode;
device->PumpEvents = BE_PumpEvents;

device->CreateWindow = BE_CreateWindow;
device->CreateWindowFrom = BE_CreateWindowFrom;
device->CreateSDLWindow = BE_CreateWindow;
device->CreateSDLWindowFrom = BE_CreateWindowFrom;
device->SetWindowTitle = BE_SetWindowTitle;
device->SetWindowIcon = BE_SetWindowIcon;
device->SetWindowPosition = BE_SetWindowPosition;
Expand Down
4 changes: 2 additions & 2 deletions src/video/kmsdrm/SDL_kmsdrmvideo.c
Expand Up @@ -120,8 +120,8 @@ KMSDRM_Create(int devindex)
device->VideoQuit = KMSDRM_VideoQuit;
device->GetDisplayModes = KMSDRM_GetDisplayModes;
device->SetDisplayMode = KMSDRM_SetDisplayMode;
device->CreateWindow = KMSDRM_CreateWindow;
device->CreateWindowFrom = KMSDRM_CreateWindowFrom;
device->CreateSDLWindow = KMSDRM_CreateWindow;
device->CreateSDLWindowFrom = KMSDRM_CreateWindowFrom;
device->SetWindowTitle = KMSDRM_SetWindowTitle;
device->SetWindowIcon = KMSDRM_SetWindowIcon;
device->SetWindowPosition = KMSDRM_SetWindowPosition;
Expand Down
4 changes: 2 additions & 2 deletions src/video/mir/SDL_mirvideo.c
Expand Up @@ -180,7 +180,7 @@ MIR_CreateDevice(int device_index)
device->GL_GetProcAddress = MIR_GL_GetProcAddress;

/* mirwindow */
device->CreateWindow = MIR_CreateWindow;
device->CreateSDLWindow = MIR_CreateWindow;
device->DestroyWindow = MIR_DestroyWindow;
device->GetWindowWMInfo = MIR_GetWindowWMInfo;
device->SetWindowFullscreen = MIR_SetWindowFullscreen;
Expand All @@ -197,7 +197,7 @@ MIR_CreateDevice(int device_index)
device->SetWindowGammaRamp = MIR_SetWindowGammaRamp;
device->GetWindowGammaRamp = MIR_GetWindowGammaRamp;

device->CreateWindowFrom = NULL;
device->CreateSDLWindowFrom = NULL;
device->SetWindowIcon = NULL;
device->RaiseWindow = NULL;
device->SetWindowBordered = NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/video/nacl/SDL_naclvideo.c
Expand Up @@ -107,7 +107,7 @@ static SDL_VideoDevice *NACL_CreateDevice(int devindex) {
device->VideoQuit = NACL_VideoQuit;
device->PumpEvents = NACL_PumpEvents;

device->CreateWindow = NACL_CreateWindow;
device->CreateSDLWindow = NACL_CreateWindow;
device->SetWindowTitle = NACL_SetWindowTitle;
device->DestroyWindow = NACL_DestroyWindow;

Expand Down
4 changes: 2 additions & 2 deletions src/video/pandora/SDL_pandora.c
Expand Up @@ -102,8 +102,8 @@ PND_create()
device->VideoQuit = PND_videoquit;
device->GetDisplayModes = PND_getdisplaymodes;
device->SetDisplayMode = PND_setdisplaymode;
device->CreateWindow = PND_createwindow;
device->CreateWindowFrom = PND_createwindowfrom;
device->CreateSDLWindow = PND_createwindow;
device->CreateSDLWindowFrom = PND_createwindowfrom;
device->SetWindowTitle = PND_setwindowtitle;
device->SetWindowIcon = PND_setwindowicon;
device->SetWindowPosition = PND_setwindowposition;
Expand Down
4 changes: 2 additions & 2 deletions src/video/psp/SDL_pspvideo.c
Expand Up @@ -113,8 +113,8 @@ PSP_Create()
device->VideoQuit = PSP_VideoQuit;
device->GetDisplayModes = PSP_GetDisplayModes;
device->SetDisplayMode = PSP_SetDisplayMode;
device->CreateWindow = PSP_CreateWindow;
device->CreateWindowFrom = PSP_CreateWindowFrom;
device->CreateSDLWindow = PSP_CreateWindow;
device->CreateSDLWindowFrom = PSP_CreateWindowFrom;
device->SetWindowTitle = PSP_SetWindowTitle;
device->SetWindowIcon = PSP_SetWindowIcon;
device->SetWindowPosition = PSP_SetWindowPosition;
Expand Down
2 changes: 1 addition & 1 deletion src/video/qnx/video.c
Expand Up @@ -330,7 +330,7 @@ createDevice(int devindex)
device->driverdata = NULL;
device->VideoInit = videoInit;
device->VideoQuit = videoQuit;
device->CreateWindow = createWindow;
device->CreateSDLWindow = createWindow;
device->CreateWindowFramebuffer = createWindowFramebuffer;
device->UpdateWindowFramebuffer = updateWindowFramebuffer;
device->SetWindowSize = setWindowSize;
Expand Down
4 changes: 2 additions & 2 deletions src/video/raspberry/SDL_rpivideo.c
Expand Up @@ -97,8 +97,8 @@ RPI_Create()
device->VideoQuit = RPI_VideoQuit;
device->GetDisplayModes = RPI_GetDisplayModes;
device->SetDisplayMode = RPI_SetDisplayMode;
device->CreateWindow = RPI_CreateWindow;
device->CreateWindowFrom = RPI_CreateWindowFrom;
device->CreateSDLWindow = RPI_CreateWindow;
device->CreateSDLWindowFrom = RPI_CreateWindowFrom;
device->SetWindowTitle = RPI_SetWindowTitle;
device->SetWindowIcon = RPI_SetWindowIcon;
device->SetWindowPosition = RPI_SetWindowPosition;
Expand Down
2 changes: 1 addition & 1 deletion src/video/uikit/SDL_uikitvideo.m
Expand Up @@ -91,7 +91,7 @@ static void UIKit_DeleteDevice(SDL_VideoDevice * device)
device->SetDisplayMode = UIKit_SetDisplayMode;
device->PumpEvents = UIKit_PumpEvents;
device->SuspendScreenSaver = UIKit_SuspendScreenSaver;
device->CreateWindow = UIKit_CreateWindow;
device->CreateSDLWindow = UIKit_CreateWindow;
device->SetWindowTitle = UIKit_SetWindowTitle;
device->ShowWindow = UIKit_ShowWindow;
device->HideWindow = UIKit_HideWindow;
Expand Down
2 changes: 1 addition & 1 deletion src/video/vivante/SDL_vivantevideo.c
Expand Up @@ -88,7 +88,7 @@ VIVANTE_Create()
device->VideoQuit = VIVANTE_VideoQuit;
device->GetDisplayModes = VIVANTE_GetDisplayModes;
device->SetDisplayMode = VIVANTE_SetDisplayMode;
device->CreateWindow = VIVANTE_CreateWindow;
device->CreateSDLWindow = VIVANTE_CreateWindow;
device->SetWindowTitle = VIVANTE_SetWindowTitle;
device->SetWindowPosition = VIVANTE_SetWindowPosition;
device->SetWindowSize = VIVANTE_SetWindowSize;
Expand Down
2 changes: 1 addition & 1 deletion src/video/wayland/SDL_waylandvideo.c
Expand Up @@ -168,7 +168,7 @@ Wayland_CreateDevice(int devindex)
device->GL_GetProcAddress = Wayland_GLES_GetProcAddress;
device->GL_DeleteContext = Wayland_GLES_DeleteContext;

device->CreateWindow = Wayland_CreateWindow;
device->CreateSDLWindow = Wayland_CreateWindow;
device->ShowWindow = Wayland_ShowWindow;
device->SetWindowFullscreen = Wayland_SetWindowFullscreen;
device->MaximizeWindow = Wayland_MaximizeWindow;
Expand Down
5 changes: 2 additions & 3 deletions src/video/windows/SDL_windowsvideo.c
Expand Up @@ -137,9 +137,8 @@ WIN_CreateDevice(int devindex)
device->SetDisplayMode = WIN_SetDisplayMode;
device->PumpEvents = WIN_PumpEvents;

#undef CreateWindow
device->CreateWindow = WIN_CreateWindow;
device->CreateWindowFrom = WIN_CreateWindowFrom;
device->CreateSDLWindow = WIN_CreateWindow;
device->CreateSDLWindowFrom = WIN_CreateWindowFrom;
device->SetWindowTitle = WIN_SetWindowTitle;
device->SetWindowIcon = WIN_SetWindowIcon;
device->SetWindowPosition = WIN_SetWindowPosition;
Expand Down
2 changes: 1 addition & 1 deletion src/video/winrt/SDL_winrtvideo.cpp
Expand Up @@ -140,7 +140,7 @@ WINRT_CreateDevice(int devindex)
/* Set the function pointers */
device->VideoInit = WINRT_VideoInit;
device->VideoQuit = WINRT_VideoQuit;
device->CreateWindow = WINRT_CreateWindow;
device->CreateSDLWindow = WINRT_CreateWindow;
device->SetWindowSize = WINRT_SetWindowSize;
device->SetWindowFullscreen = WINRT_SetWindowFullscreen;
device->DestroyWindow = WINRT_DestroyWindow;
Expand Down
4 changes: 2 additions & 2 deletions src/video/x11/SDL_x11video.c
Expand Up @@ -231,8 +231,8 @@ X11_CreateDevice(int devindex)
device->SuspendScreenSaver = X11_SuspendScreenSaver;
device->PumpEvents = X11_PumpEvents;

device->CreateWindow = X11_CreateWindow;
device->CreateWindowFrom = X11_CreateWindowFrom;
device->CreateSDLWindow = X11_CreateWindow;
device->CreateSDLWindowFrom = X11_CreateWindowFrom;
device->SetWindowTitle = X11_SetWindowTitle;
device->SetWindowIcon = X11_SetWindowIcon;
device->SetWindowPosition = X11_SetWindowPosition;
Expand Down

0 comments on commit 50efbda

Please sign in to comment.