glfw/include
Camilla Löwy 7e50f85b47 Add runtime platform selection
Enable compile-time support for multiple platforms and runtime detection
of them.  Most platform functions (but not all) are now called from
shared code via the function pointer struct _GLFWplatform.

The timer, thread and module loading platform functions are still called
directly by name and the implementation chosen at link-time.  These
functions are the same for any backend on a given OS, including the Null
backend.

The backends are now chosen via CMake dependent options following the
GLFW_BUILD_<platform> pattern instead of a mix of automagic and ad-hoc
option names.  There is no option for the Null backend as it is always
enabled.

Much of the struct stitching work in platform.h was based on an earlier
experimental branch for runtime platform selection by @ronchaine.

NOTE: This is not its final form.

- The detection logic for X11 and Wayland is still placeholder.
- There is no guide documentation.
- The new functions have not been reviewed for thread safety.
- The changelog entries are incomplete.
- The automatic platform selection logic in CMake is unchanged from 3.3
  so by default non-macOS Unices will not include support for Wayland.
- There are potentially more aspects of this change that can be
  extracted into separate commits.
- The joystick implementation selection on non-macOS Unices is kludgy.
- Probably more things.

Related to #1655.
2021-08-30 21:32:32 +02:00
..
GLFW Add runtime platform selection 2021-08-30 21:32:32 +02:00