From 1734b8e5db030ebd53fedceded84c44f3fc06f37 Mon Sep 17 00:00:00 2001 From: Lynix Date: Wed, 27 May 2020 20:37:20 +0200 Subject: [PATCH] SDL fixes --- build/scripts/modules/platform.lua | 9 +++++++++ src/Nazara/Platform/SDL2/WindowImpl.cpp | 2 +- thirdparty/include/SDL2/SDL_config.h | 1 - 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/build/scripts/modules/platform.lua b/build/scripts/modules/platform.lua index 9a04ca3e8..e3be1e0be 100644 --- a/build/scripts/modules/platform.lua +++ b/build/scripts/modules/platform.lua @@ -16,3 +16,12 @@ MODULE.Files = { "../src/Nazara/Platform/SDL2/**.hpp", "../src/Nazara/Platform/SDL2/**.cpp" } + +MODULE.OsDefines.Windows = { + "SDL_VIDEO_DRIVER_WINDOWS=1" +} + +MODULE.OsDefines.Posix = { + "SDL_VIDEO_DRIVER_X11=1", + "SDL_VIDEO_DRIVER_WAYLAND=1", +} diff --git a/src/Nazara/Platform/SDL2/WindowImpl.cpp b/src/Nazara/Platform/SDL2/WindowImpl.cpp index acbbc8382..29ea02862 100644 --- a/src/Nazara/Platform/SDL2/WindowImpl.cpp +++ b/src/Nazara/Platform/SDL2/WindowImpl.cpp @@ -129,7 +129,7 @@ namespace Nz bool WindowImpl::Create(void* handle) { m_handle = SDL_CreateWindowFrom(handle); - if (!m_handle || !SDL_GetWindowID(m_handle)) + if (!m_handle) { NazaraError("Invalid handle"); return false; diff --git a/thirdparty/include/SDL2/SDL_config.h b/thirdparty/include/SDL2/SDL_config.h index f269bfc04..efebe9f02 100644 --- a/thirdparty/include/SDL2/SDL_config.h +++ b/thirdparty/include/SDL2/SDL_config.h @@ -214,7 +214,6 @@ typedef unsigned int uintptr_t; /* Enable various video drivers */ #define SDL_VIDEO_DRIVER_DUMMY 1 -#define SDL_VIDEO_DRIVER_WINDOWS 1 #ifndef SDL_VIDEO_RENDER_D3D #define SDL_VIDEO_RENDER_D3D 1