Commit Graph

3988 Commits

Author SHA1 Message Date
Emmanuel Gil Peyrot
8e51c4a577 Tests: Add damage tracking to MSAA
This lets compositors avoid re-rendering the entire buffer when only the
outside of the squares changed.

If glfwGetBufferAge() returns 0 for any reason (the buffer was just
created, there was an error, or the underlying API doesn’t track buffer
age), we swap the entire buffer again.
2019-12-08 18:40:19 +01:00
Emmanuel Gil Peyrot
c8233ce7d3 EGL: Implement glfwGetBufferAge()
This feature is provided by the EGL_EXT_buffer_age extension, otherwise
always return 0.
2019-12-08 18:40:19 +01:00
Emmanuel Gil Peyrot
0d2ce23071 Add a glfwGetBufferAge() symbol
This new API lets the application know when the current buffer was last
written to.  If it returns 0, it means the user shouldn’t rely on what
was last present in this buffer and should draw everything again, as
usual.

This provides a significant boost in efficiency, especially on tiling
GPUs, by letting the application avoid to clear and redraw everything at
every frame.
2019-12-08 18:40:19 +01:00
Emmanuel Gil Peyrot
a94b96c954 Wayland: Bump wl_compositor for damage_buffer
wl_surface supports a damage_buffer request since its version 4, which
requires wl_compositor to have been bound at that version too.

damage_buffer can then be used by the EGL implementation to optimise
eglSwapBuffersWithDamageKHR().
2019-12-08 18:40:19 +01:00
Emmanuel Gil Peyrot
8e354c2259 EGL: Implement glfwSwapBufferWithDamage()
This is provided by the EGL_KHR_swap_buffers_with_damage extension.
2019-12-08 18:40:19 +01:00
Emmanuel Gil Peyrot
e0b1f518cf Add a glfwSwapBuffersWithDamage() symbol
This new API helps the user’s compositor reduce memory bandwidth and
thus power usage by only re-rendering a bunch of dirty rectangles
instead of the entire application buffer.

There is no guarantee that it will effectively get used, it is perfectly
valid to continue damaging the entire buffer instead like with
glfwSwapBuffers() in some cases.
2019-12-08 18:40:19 +01:00
Camilla Löwy
7dbdd2e6a5 Add more standard cursors
This adds the standard cursors for diagonal and omnidirectional
resize/move and operation-not-allowed.  It also adds new (better?) names
for the horizontal and vertical resize/move and pointing hand cursors.

References:
 - https://developer.apple.com/documentation/appkit/nscursor
 - https://stackoverflow.com/questions/10733228/
 - https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setsystemcursor
 - https://freedesktop.org/wiki/Specifications/cursor-spec/
 - https://tronche.com/gui/x/xlib/appendix/b/

Related to #427.
2019-11-28 22:24:00 +01:00
Camilla Löwy
80fde12fda Wayland: Fix pointing hand cursor shape
Related to #1432.
2019-11-25 18:55:50 +01:00
Emmanuel Gil Peyrot
a80788c17f Wayland: Don’t update cursor position in the frame
That way the application only sees the cursor moving when it is inside
of its area, it won’t go back to the top or left side when trying to
resize the window or just hovering the fallback decorations.
2019-11-21 13:53:08 +01:00
Emmanuel Gil Peyrot
a9f674e719 Wayland: Don’t reload the cursor on every pointer motion
Previously, any pointer motion in the window decorations when using the
fallback implementation would obtain the wl_cursor again, and do the
attach danse for no benefit.

This will ultimately allow animated cursors to not reset to the first
frame on motion, once these will be implemented.
2019-11-21 13:52:37 +01:00
Camilla Löwy
b5d4f24f74 Move CMake uninstall template file to CMake subdir 2019-11-14 21:49:14 +01:00
Camilla Löwy
d861d7bffe Update .gitignore file
This adds missing entries for Ninja and the unavoidable clutter of the
modern Doxygen CMake module.
2019-11-14 19:50:19 +01:00
Camilla Löwy
c42d8f3e5b Cleanup .gitignore file somewhat 2019-11-14 19:50:19 +01:00
Camilla Löwy
50a6270e55 Add initial CODEOWNERS file 2019-11-14 19:50:14 +01:00
Camilla Löwy
b804379463 Add initial GH support file 2019-11-14 19:50:14 +01:00
Camilla Löwy
359758bb53 Add initial .mailmap file 2019-11-14 19:50:03 +01:00
Camilla Löwy
e96dc5d219 X11: Assume 96 DPI if RandR monitor size is zero
This falls back to calculating the monitor physical size from the
current resolution and the default X11 DPI when the physical size
returned by RandR is zero.
2019-11-14 19:49:23 +01:00
Camilla Löwy
2c519709be Cocoa: Fix full screen window iconification
Iconification (miniaturization) of undecorated windows stopped working
unless the window has the NSWindowStyleMaskMiniaturizable style.
2019-11-13 14:08:28 +01:00
Camilla Löwy
bd452016be Cocoa: Cleanup
Readability fix, does not affect generated code.
2019-11-11 22:49:00 +01:00
Camilla Löwy
bac15f9449 Cocoa: Fix multiple methods warning
This fixes a warning due to us using bare ids and
NSCollectionLayoutAnchor having a message with the same name.
2019-11-11 22:49:00 +01:00
Camilla Löwy
c819f27ce3 Cocoa: Process events after window destruction
On macOS a destroyed window remained on screen until the next time
events were processed.  This makes the behavior more consistent with
other platforms.

Fixes #1412.
2019-11-11 22:49:00 +01:00
Camilla Löwy
94cb0347ab Cocoa: Add comments for Cocoa symbol macros 2019-11-11 22:49:00 +01:00
Camilla Löwy
953a1c3f8b Cleanup 2019-11-11 22:37:18 +01:00
Guillaume Racicot
70a3104c49 Set C standard at 99 for all example targets
Closes #1593.
2019-11-11 22:37:18 +01:00
Guillaume Racicot
bc5523e994 Set C standard at 99 for all test targets
Related to #1593.
2019-11-11 22:37:18 +01:00
Camilla Löwy
8e288dc94c Win32: Add GLFW_WIN32_KEYBOARD_MENU
This platform specific window hint enables access to the Windows window
menu via the keyboard shortcuts.
2019-11-11 22:37:18 +01:00
Camilla Löwy
de23429455 Add reminder for why events test is not closing 2019-11-11 22:37:18 +01:00
Camilla Löwy
08f01c31a0 Add gamepad information to events test output 2019-11-11 22:37:18 +01:00
Camilla Löwy
20e522cdf4 Make events test output only UTF-8 in C locale 2019-11-11 22:37:18 +01:00
thewoz
c5f1ca3e41 Add canonical build directory to .gitignore
Closes #1595.
2019-11-11 22:37:18 +01:00
Camilla Löwy
b69fb99031 Remove mappings for GUID used by different devices
The SDL2 2.0.5+ controller GUID 03000000790000000600000000000000 matches
many devices with different layouts and element counts but with the same
chipset.  This issue is still being resolved upstream.  In the meantime
this removes those mappings from GLFW to avoid confusion and errors.

SDL upstream issue: https://bugzilla.libsdl.org/show_bug.cgi?id=4545

Related to #1583.
2019-11-11 22:37:18 +01:00
Camilla Löwy
c88ee1c9d3 Win32: Change transparent framebuffer key color
This is a temporary fix while we determine if the color key workaround
should be removed completely.  See issue thread for discussion.

Related to #1512.
2019-11-11 22:37:13 +01:00
Camilla Löwy
28d8507700 Fix order of words in window guide
Fixes #1571.
2019-11-01 13:43:47 +01:00
Camilla Löwy
75294462b3 X11: Fix content scale fallback value on KDE
KDE sometimes removes the Xft.dpi resource when it would be set to the
X11 default value of 96, causing GLFW to fall back to a value calculated
from the core display sizes in pixels and mm in a desktop environment
that supports Xft.dpi.

This moves to a hardcoded fallback value of 96 on the assumption that
there are more people running KDE with 96 DPI than there are people
running desktop environments that do not support Xft.dpi.

All of this is terrible please send help.

Fixes #1578.
2019-10-29 12:04:47 +01:00
Camilla Löwy
5fc4c01302 X11: Fix decoration enabling after window creation
This fixes the enabling of window decorations after creation.  Instead
of removing the _MOTIF_WM_HINTS property, we now set or unset the
MWM_DECOR_ALL bit of the decorations field.

Fixes #1566.
2019-10-29 12:04:47 +01:00
Camilla Löwy
33683ec60e Remove stray characters from hardcoded CFLAGS
The additional '>' characters were appended to the compiler option.

Related to #1576.
2019-10-29 12:04:47 +01:00
Camilla Löwy
04f7f55f07 Cleanup
Related to #1585.
2019-10-29 12:04:47 +01:00
Pablo Prietz
4d0ae4ffa7 Fix CMake 3.0 - 3.6 support regression
Replaces `VERSION_GREATER_EQUAL` with `VERSION_EQUAL OR
VERSION_GREATER`.  `VERSION_GREATER_EQUAL` was only added in CMake 3.7.

Fixes #1584.
Closes #1585.
2019-10-29 12:04:46 +01:00
Camilla Löwy
82978bb3af Documentation work
This is the documentation update for the change introduced with
0b01d850ed, removing the requirement for
the forward-compatibility flag on macOS.
2019-10-29 12:04:22 +01:00
Camilla Löwy
376897a344 Replace notes for previous releases with links
The news / release notes page was getting a bit long.
2019-10-28 20:02:12 +01:00
Camilla Löwy
36c547875c Update changelog 2019-10-17 20:09:38 +02:00
Camilla Löwy
692754a2c5 Allow AppVeyor to skip pure documentation updates 2019-10-17 20:09:38 +02:00
Corentin Wallez
3a37a08998 Fix -Wextra-semi warnings
Closes #1440.
2019-10-17 20:09:38 +02:00
Luflosi
7749aac50d
Use the correct type in a for loop
The `monitorCount` member in the `_GLFWlibrary` struct is of type `int`, so the `for` loop iterating over it should also use the type `int`.

Closes #1572.
2019-10-17 13:47:28 +02:00
Camilla Löwy
1e20218b3d Use HTTPS for Discourse forum 2019-10-16 02:33:12 +02:00
Camilla Löwy
545f409592 Add credit
Related to #1576.
2019-10-16 02:33:12 +02:00
Guillaume Racicot
8f852e0833 Enable C99 explicitly with CMake where available
This enables compilation as C99 where supported by the compiler.
A workaround with per-compiler hardcoded flags is used for CMake 3.0,
which does not support the C_STANDARD target property.

Fixes #1560.
Closes #1576.
2019-10-16 02:33:12 +02:00
Camilla Löwy
f71b55f83d Clean up monitors tool output 2019-10-16 02:33:12 +02:00
Luflosi
d25248343e Use the correct type for a struct member
The `name` member in the `_GLFWmonitorWayland` struct is used in two places. It is assigned the value from a variable of type `uint32_t` and is compared to another variable of type `uint32_t`, so `name` should also have the same type.

Closes #1569.
2019-10-06 17:36:46 +02:00
Camilla Löwy
1bd0a55aa7 Add VS 2010 and MinGW to AppVeyor build matrix
VS 2010 and MinGW are the two trickiest Windows environments so this
should hopefully catch more mistakes.  This is probably not the right
way to set up any of this, but it works for now.

This is also a first step towards building our release binaries with CI.

[skip travis]
2019-10-03 21:05:49 +02:00