You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
MangoHud/src/wsi_helpers.h

56 lines
1.1 KiB
C

#pragma once
2 years ago
#include <functional>
2 years ago
#include <vector>
#ifdef HAVE_XKBCOMMON
#include <xkbcommon/xkbcommon.h>
#else
typedef uint32_t xkb_keysym_t;
#endif
#ifdef VK_USE_PLATFORM_XLIB_KHR
#include "loaders/loader_x11.h"
#endif
#ifdef VK_USE_PLATFORM_XCB_KHR
#include <xcb/xproto.h>
#endif
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
#include <wayland-client.h>
#endif
struct wsi_connection
{
2 years ago
std::function<void(bool)> focus_changed;
2 years ago
std::function<void(xkb_keysym_t, uint32_t)> key_pressed;
std::function<bool(const std::vector<xkb_keysym_t>& keys)> keys_are_pressed;
2 years ago
#ifdef VK_USE_PLATFORM_XCB_KHR
struct xcb {
2 years ago
xcb_connection_t *conn;
xcb_window_t window;
} xcb;
#endif
#ifdef VK_USE_PLATFORM_XLIB_KHR
struct xlib {
2 years ago
Display *dpy;
Window window;
int evmask;
} xlib;
#endif
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
struct wl {
wl_display *display;
wl_surface *surface;
} wl;
#endif
};
// struct wsi_connection;
// bool check_window_focus(const wsi_connection&);
2 years ago
void wsi_wayland_init(wsi_connection& conn);