This changes the default platform for Unix-like systems (other than
macOS) from only X11 to Wayland and X11. It also removes the backward
compatibility with the older GLFW_USE_WAYLAND CMake option.
If a bisect took you here because your build broke, hello, sorry, set
the GLFW_BUILD_WAYLAND or GLFW_BUILD_X11 CMake option to disable the
associated platform.
This can be done when configuring GLFW with CMake, from a higher-level
CMakeLists.txt if GLFW is part of your project, or at any point after
configuration by updating the CMake cache with the command-line tool or
the GUI.
The next step is to make Wayland the run-time default when enabled, but
that will hopefully not break any builds.
Related to #2439
The list of compile-time dependencies on FreeBSD lacked evdev-proto.
Unlike on Linux, the input-event-codes.h header file was not implicitly
included on FreeBSD.
Fixes#2445
This brings the latest released versions of all used Wayland protocol
files into this repository, removing the need for the user to arrange
a sufficiently new version of wayland-protocols.
The wayland.xml protocol file was copied from wayland 1.22.0.
The additional protocol files were copied from wayland-protocols 1.32.
Because of how files are moved and renamed inside the wayland-protocols
repository, it will not always be possible to update all our protocol
files from a single release without also potentially updating related
code (acceptable) and prematurely breaking compatibility with
compositors that still only support an earlier incompatible version
(unacceptable).
The macro in src/CMakeLists.txt has been modified to hopefully make it
easier to add new protocol files. This made it necessary to change the
name of a few of the generated header files.
Closes#2053
This fixes spelling, grammar and punctuation issues, missing words and
stray words across the documentation. A confusing sentence was removed
from the tutorial.
Closes#2085
This removes the GLFW_VULKAN_STATIC CMake option and the
_GLFW_VULKAN_STATIC configuration macro and replaces them with the
glfwInitVulkanLoader function, allowing a single library binary to
provide both behaviors.
This is based on the design from PR #1374 by @pmuetschard.
Closes#1374Closes#1890
This more or less restores the original custom layout where the TOC is
on the right side, with a CSS workaround added for portrait orientation.
The indentation of sub-lists in the TOC has been decreased.
The sizes of HTML headings and the "h0" div generated for each Doxygen
page have been adjusted to look better together now that they can meet.
A few headings have been shortened to fit better in the narrower TOC.
This was especially bad in the window guide, where the TOC ended up
having "Window related hints" and "Windows specific window hints" close
to one another.
This commit only fixes headings. There are likely issues in the actual
text as well.
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#1655Closes#1958
This adds the GLFW_LIBRARY_TYPE CMake cache variable, which allows users
and higher-level projects to set what type of library GLFW is built as.
When not empty, this value overrides the standard BUILD_SHARED_LIBS
option for GLFW while still allowing it to control the type of other
libraries in a larger project.
This also allows building GLFW as an object library without adding dummy
source files (as required by Xcode) or producing unused library
binaries.
Projects using CMake 3.12 or later can link the resulting GLFW object
library normally using target_link_libraries.
Fixes#279.
Related to #1307.
Closes#1497.
Closes#1574.
Closes#1928.
In the compile guide, the "Dependencies for Linux and OSMesa" section
looks to be one level too high in the hierarchy. I've moved it to be in
line with the similarly-named sub-sub-sections.
Closes#1923.
This makes USE_MSVC_RUNTIME_LIBRARY_DLL update the directory scope
CMAKE_MSVC_RUNTIME_LIBRARY variable instead of CMAKE_C_FLAGS on CMake
3.15 and later.
Solution proposed by @moritz-h.
Fixes#1783.
Closes#1796.
This changes the default value of the GLFW_BUILD_EXAMPLES and
GLFW_BUILD_TESTS CMake options to false when GLFW is being added as
a subdirectory by another CMake project.
If you want the previous behavior, force these options to true before
adding the GLFW subdirectory:
set(GLFW_BUILD_EXAMPLES ON CACHE BOOL "" FORCE)
set(GLFW_BUILD_TESTS ON CACHE BOOL "" FORCE)
add_subdirectory(path/to/glfw)
Doing this is backward compatible with earlier versions of GLFW.
The GLFW_BUILD_DOCS option is left enabled as it also requires Doxygen
to have any effect, is quicker to build and is more likely to be useful
when GLFW is a subproject.
This removes all dependencies from the GLFW test programs on the Vulkan
SDK.
It also removes support for linking the GLFW shared library (dynamic
library, DLL) against the Vulkan loader static library.
This has the advantage that the user may override e.g. the include
location, and the correct libdir (lib, lib64, lib/something) is
automatically determined.
Closes#1367.
As of the release of Mir 1.0, libmirclient has been deprecated[1] and
its developers recommend clients using it to switch to Wayland. This
patch removes support for libmirclient and instruct users to use the
experimental Wayland backend instead.
[1] https://discourse.ubuntu.com/t/mir-news-28th-september-2018/8184
Look, a can of worms! I wonder what's inside.
This adds the first platform specific window hint, transforming
a compile-time option to a run-time per-window one.
Fixes formatting, semantics and documentation. Adds
glfwGetOSMesaContext. Adds support for OSMesa context attributes.
Updates changelog and credits. Adds license and copyright headers.
Removes superfluous code (the shared code provides many conveniences).
Removes loading of unused OSMesa functions. Removes empty platform
structs. Fixes version string format. Removes build dependency on
the OSMesa header and library (only the library is needed and only at
runtime).
Closes#850.
Cleanup of 8bdb105897.
Add build macro to configuration header and documentation. Add
corresponding CMake option. Add change log entry and credit. Add
loader static library to link dependencies and add detection to
FindVulkan.cmake.