mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-31 14:11:39 +08:00
Added SDL_HINT_X11_XCB_LIBRARY
This commit is contained in:
@@ -3862,6 +3862,17 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
#define SDL_HINT_X11_WINDOW_TYPE "SDL_X11_WINDOW_TYPE"
|
#define SDL_HINT_X11_WINDOW_TYPE "SDL_X11_WINDOW_TYPE"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the XCB library to load for the X11 driver.
|
||||||
|
*
|
||||||
|
* This defaults to "libX11-xcb.so"
|
||||||
|
*
|
||||||
|
* This hint should be set before initializing the video subsystem.
|
||||||
|
*
|
||||||
|
* \since This hint is available since SDL 3.0.0.
|
||||||
|
*/
|
||||||
|
#define SDL_HINT_X11_XCB_LIBRARY "SDL_X11_XCB_LIBRARY"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A variable controlling whether XInput should be used for controller
|
* A variable controlling whether XInput should be used for controller
|
||||||
* handling.
|
* handling.
|
||||||
|
|||||||
@@ -107,8 +107,8 @@ int X11_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path)
|
|||||||
SDL_SetError("Installed Vulkan doesn't implement either the " VK_KHR_XCB_SURFACE_EXTENSION_NAME "extension or the " VK_KHR_XLIB_SURFACE_EXTENSION_NAME " extension");
|
SDL_SetError("Installed Vulkan doesn't implement either the " VK_KHR_XCB_SURFACE_EXTENSION_NAME "extension or the " VK_KHR_XLIB_SURFACE_EXTENSION_NAME " extension");
|
||||||
goto fail;
|
goto fail;
|
||||||
} else {
|
} else {
|
||||||
const char *libX11XCBLibraryName = SDL_getenv("SDL_X11_XCB_LIBRARY");
|
const char *libX11XCBLibraryName = SDL_GetHint(SDL_HINT_X11_XCB_LIBRARY);
|
||||||
if (!libX11XCBLibraryName) {
|
if (!libX11XCBLibraryName || !*libX11XCBLibraryName) {
|
||||||
libX11XCBLibraryName = "libX11-xcb.so";
|
libX11XCBLibraryName = "libX11-xcb.so";
|
||||||
}
|
}
|
||||||
videoData->vulkan_xlib_xcb_library = SDL_LoadObject(libX11XCBLibraryName);
|
videoData->vulkan_xlib_xcb_library = SDL_LoadObject(libX11XCBLibraryName);
|
||||||
|
|||||||
Reference in New Issue
Block a user