mirror of
https://github.com/glfw/glfw.git
synced 2026-09-18 22:55:46 +00:00
Introduce experimental Wayland backend
This patch introduces a new backend that enables GLFW applications to run on Wayland. For now, only output is supported (windowed and fullscreen). Pointer cursor management, input devices, clipboard etc are not supported yet. There are some concepts that can not be supported, more specifically glfwSetWindowPos, glfwGetWindowPos and glfwSetCursorPos, as they are not supported by Wayland. This patch also changes the time and joystick implementations used by the X11 backend to be shared between the Wayland backend and the X11 backend.
This commit is contained in:
committed by
Camilla Berglund
parent
99c98407c9
commit
8e99996321
+8
-21
@@ -62,6 +62,12 @@
|
||||
#error "No supported context creation API selected"
|
||||
#endif
|
||||
|
||||
#define _GLFW_UNIX_TIME_CONTEXT _glfw.x11.timer
|
||||
#include "unix_time.h"
|
||||
|
||||
#define _GLFW_LINUX_JOYSTICK_CONTEXT _glfw.x11.joystick
|
||||
#include "linux_joystick.h"
|
||||
|
||||
#define _GLFW_PLATFORM_WINDOW_STATE _GLFWwindowX11 x11
|
||||
#define _GLFW_PLATFORM_LIBRARY_WINDOW_STATE _GLFWlibraryX11 x11
|
||||
#define _GLFW_PLATFORM_MONITOR_STATE _GLFWmonitorX11 x11
|
||||
@@ -199,11 +205,7 @@ typedef struct _GLFWlibraryX11
|
||||
int exposure;
|
||||
} saver;
|
||||
|
||||
struct {
|
||||
GLboolean monotonic;
|
||||
double resolution;
|
||||
uint64_t base;
|
||||
} timer;
|
||||
_GLFWtimeUNIX timer;
|
||||
|
||||
struct {
|
||||
char* string;
|
||||
@@ -213,15 +215,7 @@ typedef struct _GLFWlibraryX11
|
||||
Window source;
|
||||
} xdnd;
|
||||
|
||||
struct {
|
||||
int present;
|
||||
int fd;
|
||||
float* axes;
|
||||
int axisCount;
|
||||
unsigned char* buttons;
|
||||
int buttonCount;
|
||||
char* name;
|
||||
} joystick[GLFW_JOYSTICK_LAST + 1];
|
||||
_GLFWjoystickLinux joystick;
|
||||
|
||||
} _GLFWlibraryX11;
|
||||
|
||||
@@ -251,9 +245,6 @@ typedef struct _GLFWcursorX11
|
||||
// Prototypes for platform specific internal functions
|
||||
//========================================================================
|
||||
|
||||
// Time
|
||||
void _glfwInitTimer(void);
|
||||
|
||||
// Gamma
|
||||
void _glfwInitGammaRamp(void);
|
||||
|
||||
@@ -261,10 +252,6 @@ void _glfwInitGammaRamp(void);
|
||||
GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired);
|
||||
void _glfwRestoreVideoMode(_GLFWmonitor* monitor);
|
||||
|
||||
// Joystick input
|
||||
void _glfwInitJoysticks(void);
|
||||
void _glfwTerminateJoysticks(void);
|
||||
|
||||
// Unicode support
|
||||
long _glfwKeySym2Unicode(KeySym keysym);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user