Commit Graph

20 Commits

Author SHA1 Message Date
Camilla Löwy
c812b9d87c Add conditional compilation for platform units
This is a step towards being able to compile GLFW manually without
needing to duplicate a lot of platform- or OS-specific logic.
2022-09-15 22:24:39 +02:00
Camilla Löwy
56a4cb0a3a Add runtime platform selection
This adds compile-time support for multiple platforms and runtime
detection of them.  Window system related platform functions 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 platforms are now enabled via CMake dependent options following the
GLFW_BUILD_<platform> pattern instead of a mix of automagic and ad-hoc
option names.  There is no longer any option for the Null backend as it
is now always enabled.

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

Every platform function related to windows, contexts, monitors, input,
event processing and Vulkan have been renamed so that multiple sets of
them can exist without colliding.  Calls to these are now routed through
the _glfw.platform struct member.  These changes makes up most of this
commit.

For Wayland and X11 the client library loading and display creation is
used to detect a running compositor/server.  The XDG_SESSION_TYPE
environment variable is ignored for now, as X11 is still by far the more
complete implementation.

Closes #1655
Closes #1958
2021-10-13 21:47:11 +02:00
Camilla Löwy
6d51b39106 Select mapping platform name at runtime
This is done in preparation for runtime platform selection.
2021-10-12 12:54:35 +02:00
Camilla Löwy
0c90e1a33f Add gamepad mapping filtering by backend
This fixes gamepad mappings being included in GLFW binaries that would
then never use them because they were for a different platform.
2021-08-01 20:17:21 +02:00
Camilla Löwy
782e6b6cef Make joystick platform code init on demand
This makes joystick support initialize the first time a joystick
function is called, including those gamepad functions that are layered
on top of joystick functions.

Related to #1284.
Related to #1646.
2020-07-21 17:38:56 +02:00
Corentin Wallez
3a37a08998 Fix -Wextra-semi warnings
Closes #1440.
2019-10-17 20:09:38 +02:00
Camilla Löwy
a337c56848 Start 3.4 2019-04-16 23:08:39 +02:00
Camilla Löwy
ab118b2529 Fix copyright years (somewhat) 2019-04-15 20:50:00 +02:00
Camilla Löwy
953106e74d Add support for SDL_GameControllerDB
This adds support for importing and applying mappings from the
SDL_GameControllerDB database.

Related to #900.
2017-07-07 15:52:33 +02:00
Camilla Löwy
372e908682 Remove internal header inclusion guards
Inclusion of internal headers is already both centralized and follows
strict rules.  Inclusion guards are both an unneccessary maintenance
burden and may hide inclusion order bugs.
2017-05-25 19:35:13 +02:00
Camilla Löwy
bfd564f257 Move internals to shared joystick objects
Preparation for gamecontrollerdb support and the gamepad API.
2017-01-30 16:52:49 +01:00
Camilla Löwy
f4d0c83181 Paperwork done 2016-11-30 14:00:41 +01:00
Camilla Berglund
53fafad915 Start 3.3 2016-08-18 23:55:49 +02:00
Camilla Berglund
df5dcf5162 Win32: Fix stub comment 2016-06-15 01:35:07 +02:00
Camilla Berglund
757eea2779 Update email address 2016-06-01 21:25:20 +02:00
Camilla Berglund
6a8e169001 Update copyright notice year 2016-06-01 21:25:19 +02:00
Camilla Berglund
7cbdae1bed Add initial DirectInput 8 support
Fixes #232.
2016-03-31 12:24:01 +02:00
Camilla Berglund
eb3577c1eb Add initial XInput support 2016-03-31 12:12:04 +02:00
Camilla Berglund
f079d0625d Platform affix cleanup
Fixes #659.
2015-12-15 22:37:24 +01:00
Camilla Berglund
7fec7a0569 Make source file names more consistent
Use platform prefix for files specific to that platform AND that have no
credible alternative API on that platform.

The exception is WinMM, which will be replaced before 3.2.
2015-12-13 14:51:44 +01:00