Commit Graph

4601 Commits

Author SHA1 Message Date
Camilla Löwy
399c2a1fad Clarify docs on default GL header inclusion
The documentation claims that any extension loader library header
included before the GLFW one will prevent the inclusion of the
default OpenGL header.  In reality this only worked if the loader
defined the canonical desktop OpenGL __gl_h_ inclusion guard and even
then relied on the OpenGL header to detect this.

This is the companion to 105cf32e0b, which
added the preprocessor logic to check for many known OpenGL and OpenGL
ES inclusion guards and not even attempt to include the default header
if any are present.

Some clarification of the language around header inclusion has also been
attempted, including making GLFW_INCLUDE_NONE more prominent.

Fixes #1695.
2020-06-02 18:04:49 +02:00
Camilla Löwy
9a87c2a4b4 Add feature available/implemented errors
This adds two new error codes: GLFW_FEATURE_UNAVAILABLE for when
a GLFW feature cannot be reasonably implemented on that platform, and
GLFW_FEATURE_UNIMPLEMENTED for when it can be but has not been yet.

This replaces the current situation where the Wayland code emitted
GLFW_PLATFORM_ERROR in both cases while the macOS code silently did
nothing.

If your application exits on any GLFW error, these error codes should at
least be easy to filter out from that behavior.

Ideally, GLFW_FEATURE_UNAVAILABLE should be rare and
GLFW_FEATURE_UNIMPLEMENTED should never be emitted at all.

Fixes #1692.
2020-06-02 17:18:18 +02:00
Camilla Löwy
fbf8aae44f Fix typo in header option macro docs 2020-05-31 15:28:57 +02:00
A. Tombs
7486e12f88 Add statement to docs for glfwTerminate
It is safe to call glfwTerminate both before initialization and after
termination.

Closes #1698.
2020-05-27 23:19:52 +02:00
Camilla Löwy
105cf32e0b Fix desktop GL header not always being suppressed
If an OpenGL ES header or the glcorearb header is included before the
GLFW header (with no options defined), the legacy OpenGL header will be
implicitly included and the compilation will fail.

This disables the default behavior if we detect any known OpenGL, OpenGL
ES or extension loader inclusion guard macro.

Sources:
 - Khronos headers
 - Windows SDK
 - MinGW
 - MinGW-w64
 - flextGL
 - glad
 - glad2
 - GLEW
 - Galogen
 - gl3w
 - GLXW
 - glbinding
 - Epoxy
 - Glatter
 - glLoadGen
 - Regal
 - GLee
 - OpenGL.framework
 - Debian
 - FreeBSD
 - ANGLE
 - SwiftShader

Related to #1695.
2020-05-27 20:21:01 +02:00
ben1
a84a30ab63 Win32: Fix VS /W4 compile warnings
These are harmless errors but the code was worth fixing just to reduce
confusion and be more explicit.  E.g. using a different variable name
for a new variable of a different type in win32_joystick.c.

Closes #1700.
2020-05-26 21:37:20 +02:00
Luflosi
250b94cd03 Use the correct type in a for loop
The `atomCount` variable has the type `unsigned long`,
so the `for` loop iterating over it should use the same type.

Closes #1701.
2020-05-26 20:19:14 +02:00
Luflosi
d4f5074535 Replace %m conversion specifier with %s and strerror()
When compiling with `-Wall` and `-pedantic-errors`, gcc complains with
```
warning: ISO C does not support the '%m' gnu_printf format [-Wformat=]
```
because the `%m` conversion specifier is a GNU extension.

Closes #1702.
2020-05-25 16:05:49 +02:00
Corentin Wallez
91eebe922d Use CALayer instead of NSView for EGLNativeWindowType
The only two EGL implementations on macOS are Swiftshader and ANGLE.
While Swiftshader supports both `NSView` and `CALayer` as
`EGLNativeWindowType`, ANGLE supports only `CALayer`. Furthermore
Swiftshader's OpenGL ES frontend is deprecated in favor of using ANGLE's
Vulkan backend on top of Swiftshader's Vulkan frontend.

This means that on macOS `EGLNativeWindowType` should be a `CALayer` for
compatibility with ANGLE.

Fixes #1169.
Closes #1680.
2020-05-22 17:37:44 +02:00
Camilla Löwy
51a465ee2b Win32: Remove checks for pre-XP Windows
Windows XP is the oldest version supported by GLFW 3.4.
2020-05-20 17:59:10 +02:00
Camilla Löwy
5f9dfe3d83 X11: Clarify function name and comment 2020-05-19 22:36:44 +02:00
Camilla Löwy
27295b508f Note removal of wl_shell support in release notes 2020-05-19 18:56:25 +02:00
Camilla Löwy
ef5220d6b1 X11: Clarify code flow for Clang static analysis 2020-05-19 17:59:18 +02:00
Camilla Löwy
a17a1b2011 X11: Fix XKB events being passed on to core path 2020-05-19 17:55:28 +02:00
Camilla Löwy
e07925c404 X11: Fix XKB state event bits being overwritten
This limits the update to the XKB group state event bit without clearing
all other state event bits.
2020-05-19 17:49:02 +02:00
Camilla Löwy
cf3a03a85d X11: Remove duplicate XKB group initialization
The XKB group is already set to zero during initialization.
2020-05-19 17:47:58 +02:00
Camilla Löwy
0c403c8ca6 X11: Fix XKB group event depending on state query
This fixes XKB group change events not being enabled if the initial
XKB keyboard state query fails.
2020-05-19 17:44:59 +02:00
Camilla Löwy
844bc8031c Add null platform to Travis CI 2020-05-19 14:14:41 +02:00
gre-42
67c720d117 Correct sign in mat4x4_rotate_Y
Signs were incorrect in mat4x4_rotate_Y.

Closes #1673.
2020-05-14 16:17:04 +02:00
Camilla Löwy
d7ae90a790 Update community resource links 2020-05-05 00:38:14 +02:00
Camilla Löwy
41a19ed49c Disambiguate Vulkan support reference link 2020-05-05 00:38:14 +02:00
Camilla Löwy
949275bbed Cocoa: Fix call to NSWindow from non-main threads
glfwSwapBuffers may be called by any thread but NSWindow may not.

Bug introduced by c3ca88055f and reported
by @crujose.
2020-04-30 22:44:54 +02:00
Camilla Löwy
cab41529da X11: Improve non-XKB fallback for key mapping
A regression introduced by b889aa7841
broke the special handling of numpad keys for the non-XKB fallback path.
The non-functional remains were later removed.  This restores the
original behavior.
2020-04-23 22:13:18 +02:00
Camilla Löwy
318e08d914 X11: Add additional XKB key names for Right Alt 2020-04-23 17:42:36 +02:00
Camilla Löwy
560304e0f4 X11: Use XKB key name MENU for Menu key 2020-03-31 17:31:01 +02:00
Camilla Löwy
9ecacf1d7f X11: Check XKB key aliases in addition to names 2020-03-31 17:31:01 +02:00
Camilla Löwy
ee45b58647 X11: Fix X keycode ranges for XKB and core
This replaces the hardcoded keycode ranges and various kludgy range
checks with the actual ranges reported by Xlib and XKB.
2020-03-31 17:31:01 +02:00
Camilla Löwy
215a05af3d Update changelog and add credit
Related to #1598.
2020-03-31 17:30:51 +02:00
Ali Sherief
a41a58a95e X11: Fix function keys mapped to GLFW_KEY_UNKNOWN
This fixes the issue where function keys would be reported as
GLFW_KEY_UNKNOWN if XKB was available and one of the configured keyboard
layouts was Arabic.

This is only part of #1598, because the full patch removed parts of the
fallback path for when XKB is unavailable.

Closes #1598.
2020-03-31 17:03:29 +02:00
Camilla Löwy
e65de2941c X11: Improve window handle race condition
The non-root parent window owned by the WM could be destroyed before we
process the ConfigureNotify event using the cached parent handle.

Bug was found by unmapping a decorated window.

This like all uses of the Xlib error handler is not thread safe and
there is nothing we can do about that short of moving to XCB.

Fixes #1633.
2020-03-31 17:03:29 +02:00
Camilla Löwy
2c8e0512dd X11: Filter out Xlib errors from other connections 2020-03-16 17:15:07 +01:00
Camilla Löwy
44b5d06583 X11: Add support for XIM callbacks
This adds support for the XIM instantiate and destroy callbacks, letting
GLFW detect both when the current input method disappears and when a new
one is started.

Tested with ibus.
2020-03-12 21:05:54 +01:00
Camilla Löwy
350ba73267 Update linmath.h
This updates our linmath.h to the latest version plus minor local fixes
for MSVC and Clang.

Fixes #1653.
2020-03-12 02:17:17 +01:00
Camilla Löwy
9516df52a4 Fix unclear language in build guide
Fixes #1658.
2020-03-12 01:57:58 +01:00
Camilla Löwy
72366ac9a9 Cocoa: Finish launching NSApp in glfwInit
This moves the remaining bits of NSApplication initialization into
_glfwPlatformInit.  As a side-effect of this, any command-line program
initializing GLFW will get a menu bar, which is not ideal.

If this has happened to you and a bisect led you here, please see the
GLFW_COCOA_MENUBAR init hint introduced in GLFW 3.3.

If this patch is a terrible idea, please get in touch in the 3.4 release
timeframe.

This is a replacement for 6e6805000a,
which attempts to preserve the existing menu bar creation behavior for
the 3.3-stable branch.

Fixes #1649.
2020-03-12 01:56:35 +01:00
Camilla Löwy
6aca3e99f0 Wayland: Remove unused link-time dependency
The wayland-egl library is now loaded dynamically at init.  This narrows
the pkgconfig dependencies to the link-time depdendencies.
2020-02-12 19:02:46 +01:00
Camilla Löwy
4381b86b6b X11: Fix CJK IME input when locale CTYPE is "C"
Fixes #1587.
Fixes #1636.
2020-02-12 19:01:16 +01:00
Camilla Löwy
27d19d06ca WGL: Remove unused constants 2020-02-10 17:44:57 +01:00
Camilla Löwy
4b8ac11aa3 Fix rendering race in offscreen example 2020-02-10 17:44:57 +01:00
Camilla Löwy
a0a5cc57df X11: Make libX11 dynamically loaded
This completes the dynamic loading of all X11 libraries in preparation
for run-time platform selection.
2020-02-10 17:44:56 +01:00
Camilla Löwy
0c27ed1d0e X11: Fix setting the clipboard string to itself 2020-02-10 17:44:56 +01:00
Camilla Löwy
d1ae7bac60 Put docs target in GLFW3 folder 2020-02-10 17:44:34 +01:00
Camilla Löwy
40c7e471e3 Move more non-source template files to CMake dir 2020-02-08 17:42:53 +01:00
Emmanuel Gil Peyrot
76406c7894 Mention that xdg-shell is mandatory on Wayland 2020-02-06 09:02:16 +01:00
Camilla Löwy
d973acc123 Update OpenGL bits of build documentation slightly
This removes most references to GLU, replaces the legacy CMake cache
variables for OpenGL with the modern namespaced target and switches to
$() for command substitution.

Fixes #1580.
2020-01-19 23:35:59 +01:00
Camilla Löwy
46c7c1cdff Remove AppVeyor skip commits setting 2020-01-16 23:52:39 +01:00
Camilla Löwy
13479ed27d Update changelog and add credit
Related to #1602.
2020-01-16 23:52:39 +01:00
Kovid Goyal
a5e5b782c7 X11: Fix queries crashing if monitor disconnected
Merged from downstream kovidgoyal/glfw.  First of many.

Related to #1602.
2020-01-16 23:52:39 +01:00
Camilla Löwy
65cfe743af Add credit
Related to #1624.
2020-01-16 23:52:39 +01:00
Crunkle
d862d56acb Fix docs install condition
Closes #1624.
2020-01-16 23:52:38 +01:00