mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-14 06:34:10 +00:00
Disable X11_XCB dependencies for Linux and macOS
This commit is contained in:
parent
c4030850ab
commit
d71eb2bf36
3 changed files with 19 additions and 18 deletions
|
@ -424,18 +424,18 @@ if(USE_VULKAN)
|
|||
|
||||
# Eric: For use with SDL2/Vulkan
|
||||
if(UNIX)
|
||||
find_package(X11_XCB)
|
||||
if(X11_XCB_FOUND)
|
||||
add_definitions(-DHAVE_X11_XCB)
|
||||
list(APPEND SUBSYSTEMS [X11])
|
||||
# SRS - Added PKG_ preface to X11_XCB_INCLUDE_DIRS for OSX, not sure about UNIX
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
include_directories(${PKG_X11_XCB_INCLUDE_DIRS})
|
||||
else()
|
||||
include_directories(${X11_XCB_INCLUDE_DIRS})
|
||||
endif()
|
||||
endif()
|
||||
add_definitions(-DVK_USE_PLATFORM_XLIB_KHR)
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
# SRS - Do nothing here for Linux and OSX since SDL2 is used in place of platform-specific Vulkan
|
||||
else()
|
||||
find_package(X11_XCB)
|
||||
if(X11_XCB_FOUND)
|
||||
list(APPEND SUBSYSTEMS [X11])
|
||||
include_directories(${X11_XCB_INCLUDE_DIR})
|
||||
add_definitions(-DVK_USE_PLATFORM_XCB_KHR)
|
||||
else()
|
||||
message(FATAL_ERROR "Could not find XCB library!")
|
||||
endif()
|
||||
endif()
|
||||
elseif(WIN32)
|
||||
add_definitions(-DVK_USE_PLATFORM_WIN32_KHR)
|
||||
endif()
|
||||
|
|
|
@ -435,7 +435,7 @@ CreateSurface
|
|||
|
||||
static void CreateSurface()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
#if defined(VK_USE_PLATFORM_WIN32_KHR) // _WIN32
|
||||
VkWin32SurfaceCreateInfoKHR createInfo = {};
|
||||
createInfo.sType = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR;
|
||||
createInfo.hinstance = win32.hInstance;
|
||||
|
@ -459,7 +459,7 @@ static void CreateSurface()
|
|||
{
|
||||
idLib::FatalError( "Error while creating Vulkan surface: %s", SDL_GetError() );
|
||||
}
|
||||
#else
|
||||
#else // defined(VK_USE_PLATFORM_XCB_KHR)
|
||||
VkXcbSurfaceCreateInfoKHR createInfo = {};
|
||||
createInfo.sType = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR;
|
||||
createInfo.pNext = NULL;
|
||||
|
@ -468,7 +468,7 @@ static void CreateSurface()
|
|||
createInfo.window = info.window;
|
||||
|
||||
ID_VK_CHECK( vkCreateXcbSurfaceKHR( vkcontext.instance, &createInfo, NULL, &vkcontext.surface ) );
|
||||
#endif // __linux__
|
||||
#endif // UNIX-style platforms
|
||||
|
||||
#endif // _WIN32
|
||||
|
||||
|
|
|
@ -31,7 +31,8 @@ If you have questions concerning this license or the applicable additional terms
|
|||
|
||||
#include <signal.h>
|
||||
|
||||
#ifdef USE_VULKAN
|
||||
// SRS - Not used on Linux/macOS since using SDL2
|
||||
#if defined(USE_VULKAN) && defined(VK_USE_PLATFORM_XCB_KHR)
|
||||
#include <xcb/xcb.h>
|
||||
#endif
|
||||
|
||||
|
@ -74,8 +75,8 @@ enum /*clk_id_t*/ clockid_t { CLOCK_REALTIME, CLOCK_MONOTONIC, CLOCK_MONOTONIC_R
|
|||
int clock_gettime( /*clk_id_t*/ clockid_t clock, struct timespec* tp ); // SRS - use APPLE clockid_t
|
||||
#endif
|
||||
|
||||
// Eric: Not used on Linux since using SDL2
|
||||
#if 0 //defined(USE_VULKAN)
|
||||
// Eric: Not used on Linux/macOS since using SDL2
|
||||
#if defined(USE_VULKAN) && defined(VK_USE_PLATFORM_XCB_KHR)
|
||||
/* Struct that holds global xcb state for vulkan */
|
||||
typedef struct _posixInfo
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue