Merge branch 'master' into merge

This commit is contained in:
Doug Binks 2021-03-22 15:33:40 +00:00
commit ab4b4e95f6
29 changed files with 616 additions and 646 deletions

6
.gitignore vendored
View File

@ -52,10 +52,6 @@ src/glfw_config.h
src/glfw3.pc
src/glfw3Config.cmake
src/glfw3ConfigVersion.cmake
src/wayland-pointer-constraints-unstable-v1-client-protocol.h
src/wayland-pointer-constraints-unstable-v1-protocol.c
src/wayland-relative-pointer-unstable-v1-client-protocol.h
src/wayland-relative-pointer-unstable-v1-protocol.c
# Compiled binaries
src/libglfw.so
@ -81,6 +77,7 @@ examples/splitview
examples/sharing
examples/triangle-opengl
examples/wave
examples/windows
tests/*.app
tests/*.exe
tests/clipboard
@ -91,6 +88,7 @@ tests/gamma
tests/glfwinfo
tests/icon
tests/iconify
tests/inputlag
tests/joysticks
tests/monitors
tests/msaa

View File

@ -41,7 +41,6 @@ matrix:
addons:
apt:
packages:
- extra-cmake-modules
- wayland-protocols
- libwayland-dev
- libxkbcommon-dev
@ -56,7 +55,6 @@ matrix:
addons:
apt:
packages:
- extra-cmake-modules
- wayland-protocols
- libwayland-dev
- libxkbcommon-dev

View File

@ -1,26 +0,0 @@
find_package(PkgConfig)
pkg_check_modules(WaylandProtocols QUIET wayland-protocols>=${WaylandProtocols_FIND_VERSION})
execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=pkgdatadir wayland-protocols
OUTPUT_VARIABLE WaylandProtocols_PKGDATADIR
RESULT_VARIABLE _pkgconfig_failed)
if (_pkgconfig_failed)
message(FATAL_ERROR "Missing wayland-protocols pkgdatadir")
endif()
string(REGEX REPLACE "[\r\n]" "" WaylandProtocols_PKGDATADIR "${WaylandProtocols_PKGDATADIR}")
find_package_handle_standard_args(WaylandProtocols
FOUND_VAR
WaylandProtocols_FOUND
REQUIRED_VARS
WaylandProtocols_PKGDATADIR
VERSION_VAR
WaylandProtocols_VERSION
HANDLE_COMPONENTS
)
set(WAYLAND_PROTOCOLS_FOUND ${WaylandProtocols_FOUND})
set(WAYLAND_PROTOCOLS_PKGDATADIR ${WaylandProtocols_PKGDATADIR})
set(WAYLAND_PROTOCOLS_VERSION ${WaylandProtocols_VERSION})

View File

@ -1,34 +0,0 @@
# - Try to find XKBCommon
# Once done, this will define
#
# XKBCOMMON_FOUND - System has XKBCommon
# XKBCOMMON_INCLUDE_DIRS - The XKBCommon include directories
# XKBCOMMON_LIBRARIES - The libraries needed to use XKBCommon
# XKBCOMMON_DEFINITIONS - Compiler switches required for using XKBCommon
find_package(PkgConfig)
pkg_check_modules(PC_XKBCOMMON QUIET xkbcommon)
set(XKBCOMMON_DEFINITIONS ${PC_XKBCOMMON_CFLAGS_OTHER})
find_path(XKBCOMMON_INCLUDE_DIR
NAMES xkbcommon/xkbcommon.h
HINTS ${PC_XKBCOMMON_INCLUDE_DIR} ${PC_XKBCOMMON_INCLUDE_DIRS}
)
find_library(XKBCOMMON_LIBRARY
NAMES xkbcommon
HINTS ${PC_XKBCOMMON_LIBRARY} ${PC_XKBCOMMON_LIBRARY_DIRS}
)
set(XKBCOMMON_LIBRARIES ${XKBCOMMON_LIBRARY})
set(XKBCOMMON_LIBRARY_DIRS ${XKBCOMMON_LIBRARY_DIRS})
set(XKBCOMMON_INCLUDE_DIRS ${XKBCOMMON_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(XKBCommon DEFAULT_MSG
XKBCOMMON_LIBRARY
XKBCOMMON_INCLUDE_DIR
)
mark_as_advanced(XKBCOMMON_LIBRARY XKBCOMMON_INCLUDE_DIR)

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.1...3.17 FATAL_ERROR)
project(GLFW VERSION 3.4.0 LANGUAGES C)
@ -191,20 +191,18 @@ endif()
# Use Wayland for window creation
#--------------------------------------------------------------------
if (_GLFW_WAYLAND)
find_package(ECM REQUIRED NO_MODULE)
list(APPEND CMAKE_MODULE_PATH "${ECM_MODULE_PATH}")
find_package(Wayland REQUIRED Client Cursor Egl)
find_package(WaylandScanner REQUIRED)
find_package(WaylandProtocols 1.15 REQUIRED)
include(FindPkgConfig)
pkg_check_modules(Wayland REQUIRED
wayland-client>=0.2.7
wayland-cursor>=0.2.7
wayland-egl>=0.2.7
xkbcommon)
list(APPEND glfw_PKG_DEPS "wayland-client")
list(APPEND glfw_INCLUDE_DIRS "${Wayland_INCLUDE_DIRS}")
list(APPEND glfw_LIBRARIES "${Wayland_LIBRARIES}")
find_package(XKBCommon REQUIRED)
list(APPEND glfw_INCLUDE_DIRS "${XKBCOMMON_INCLUDE_DIRS}")
list(APPEND glfw_LIBRARIES "${Wayland_LINK_LIBRARIES}")
include(CheckIncludeFiles)
include(CheckFunctionExists)

View File

@ -88,9 +88,6 @@ in the documentation for more information.
GLFW itself needs only CMake 3.1 or later and the headers and libraries for your
OS and window system.
The (experimental) Wayland backend also depends on the `extra-cmake-modules`
package, which is used to generate Wayland protocol headers.
The examples and test programs depend on a number of tiny libraries. These are
located in the `deps/` directory.
@ -102,7 +99,7 @@ located in the `deps/` directory.
functions
- [linmath.h](https://github.com/datenwolf/linmath.h) for linear algebra in
examples
- [Nuklear](https://github.com/vurtun/nuklear) for test and example UI
- [Nuklear](https://github.com/Immediate-Mode-UI/Nuklear) for test and example UI
- [stb\_image\_write](https://github.com/nothings/stb) for writing images to disk
The documentation is generated with [Doxygen](http://doxygen.org/) if CMake can
@ -158,10 +155,20 @@ information on what to include when reporting a bug.
- [Win32] Bugfix: Some synthetic key events were reported as `GLFW_KEY_UNKNOWN`
(#1623)
- [Win32] Bugfix: Non-BMP Unicode codepoint input was reported as UTF-16
- [Win32] Bugfix: Monitor functions could return invalid values after
configuration change (#1761)
- [Win32] Bugfix: Initialization would segfault on Windows 8 (not 8.1) (#1775)
- [Win32] Bugfix: Duplicate size events were not filtered (#1610)
- [Win32] Bugfix: Full screen windows were incorrectly resized by DPI changes
(#1582)
- [Win32] Bugfix: `GLFW_SCALE_TO_MONITOR` had no effect on systems older than
Windows 10 version 1703 (#1511)
- [Cocoa] Added support for `VK_EXT_metal_surface` (#1619)
- [Cocoa] Added locating the Vulkan loader at runtime in an application bundle
- [Cocoa] Moved main menu creation to GLFW initialization time (#1649)
- [Cocoa] Changed `EGLNativeWindowType` from `NSView` to `CALayer` (#1169)
- [Cocoa] Changed F13 key to report Print Screen for cross-platform consistency
(#1786)
- [Cocoa] Removed dependency on the CoreVideo framework
- [Cocoa] Bugfix: `glfwSetWindowSize` used a bottom-left anchor point (#1553)
- [Cocoa] Bugfix: Window remained on screen after destruction until event poll
@ -174,6 +181,12 @@ information on what to include when reporting a bug.
(#1635)
- [Cocoa] Bugfix: Failing to retrieve the refresh rate of built-in displays
could leak memory
- [Cocoa] Bugfix: Objective-C files were compiled as C with CMake 3.19 (#1787)
- [Cocoa] Bugfix: Duplicate video modes were not filtered out (#1830)
- [Cocoa] Bugfix: Menubar was not clickable on macOS 10.15+ until it lost and
regained focus (#1648,#1802)
- [Cocoa] Bugfix: Monitor name query could segfault on macOS 11 (#1809,#1833)
- [Cocoa] Bugfix: The install name of the installed dylib was relative (#1504)
- [X11] Bugfix: The CMake files did not check for the XInput headers (#1480)
- [X11] Bugfix: Key names were not updated when the keyboard layout changed
(#1462,#1528)
@ -199,6 +212,8 @@ information on what to include when reporting a bug.
combinaitons (#1598)
- [X11] Bugfix: Keys pressed simultaneously with others were not always
reported (#1112,#1415,#1472,#1616)
- [X11] Bugfix: Some window attributes were not applied on leaving fullscreen
(#1863)
- [Wayland] Removed support for `wl_shell` (#1443)
- [Wayland] Bugfix: The `GLFW_HAND_CURSOR` shape used the wrong image (#1432)
- [Wayland] Bugfix: `CLOCK_MONOTONIC` was not correctly enabled
@ -206,6 +221,9 @@ information on what to include when reporting a bug.
- [Wayland] Bugfix: Retrieving partial framebuffer size would segfault
- [Wayland] Bugfix: Scrolling offsets were inverted compared to other platforms
(#1463)
- [Wayland] Bugfix: Client-Side Decorations were destroyed in the wrong worder
(#1798)
- [Wayland] Bugfix: Monitors physical size could report zero (#1784,#1792)
- [POSIX] Bugfix: `CLOCK_MONOTONIC` was not correctly tested for or enabled
- [NSGL] Removed enforcement of forward-compatible flag for core contexts
- [NSGL] Bugfix: `GLFW_COCOA_RETINA_FRAMEBUFFER` had no effect on newer
@ -240,13 +258,16 @@ GLFW exists because people around the world donated their time and lent their
skills.
- Bobyshev Alexander
- Laurent Aphecetche
- Matt Arsenault
- ashishgamedev
- David Avedissian
- Keith Bauer
- John Bartholomew
- Coşku Baş
- Niklas Behrens
- Andrew Belt
- Nevyn Bengtsson
- Niklas Bergström
- Denis Bernard
- Doug Binks
@ -255,6 +276,7 @@ skills.
- Rok Breulj
- Kai Burjack
- Martin Capitanio
- Nicolas Caramelli
- David Carlier
- Arturo Castro
- Chi-kwan Chan
@ -293,6 +315,7 @@ skills.
- Eloi Marín Gratacós
- Stefan Gustavson
- Jonathan Hale
- hdf89shfdfs
- Sylvain Hellegouarch
- Matthew Henry
- heromyth
@ -317,11 +340,13 @@ skills.
- Konstantin Käfer
- Eric Larson
- Francis Lecavalier
- Jong Won Lee
- Robin Leffmann
- Glenn Lewis
- Shane Liesegang
- Anders Lindqvist
- Leon Linhart
- Marco Lizza
- Eyal Lotem
- Aaron Loucks
- Luflosi
@ -361,6 +386,7 @@ skills.
- Braden Pellett
- Christopher Pelloux
- Arturo J. Pérez
- Vladimir Perminov
- Anthony Pesch
- Orson Peters
- Emmanuel Gil Peyrot
@ -426,6 +452,9 @@ skills.
- Waris
- Jay Weisskopf
- Frank Wille
- Andy Williams
- Joel Winarske
- Richard A. Wilkes
- Tatsuya Yatagawa
- Ryogo Yoshimura
- Lukas Zanner
@ -434,6 +463,7 @@ skills.
- Santi Zupancic
- Jonas Ådahl
- Lasse Öörni
- Leonard König
- All the unmentioned and anonymous contributors in the GLFW community, for bug
reports, patches, feedback, testing and encouragement

151
deps/linmath.h vendored
View File

@ -1,13 +1,8 @@
#ifndef LINMATH_H
#define LINMATH_H
#include <string.h>
#include <math.h>
/* 2020-03-02 Camilla Löwy <elmindreda@elmindreda.org>
* - Added inclusion of string.h for memcpy
* - Replaced tan and acos with tanf and acosf
* - Replaced double constants with float equivalents
*/
#include <string.h>
#ifdef LINMATH_NO_INLINE
@ -38,7 +33,7 @@ LINMATH_H_FUNC void vec##n##_scale(vec##n r, vec##n const v, float const s) \
} \
LINMATH_H_FUNC float vec##n##_mul_inner(vec##n const a, vec##n const b) \
{ \
float p = 0.; \
float p = 0.f; \
int i; \
for(i=0; i<n; ++i) \
p += b[i]*a[i]; \
@ -64,6 +59,12 @@ LINMATH_H_FUNC void vec##n##_max(vec##n r, vec##n const a, vec##n const b) \
int i; \
for(i=0; i<n; ++i) \
r[i] = a[i]>b[i] ? a[i] : b[i]; \
} \
LINMATH_H_FUNC void vec##n##_dup(vec##n r, vec##n const src) \
{ \
int i; \
for(i=0; i<n; ++i) \
r[i] = src[i]; \
}
LINMATH_H_DEFINE_VEC(2)
@ -79,13 +80,13 @@ LINMATH_H_FUNC void vec3_mul_cross(vec3 r, vec3 const a, vec3 const b)
LINMATH_H_FUNC void vec3_reflect(vec3 r, vec3 const v, vec3 const n)
{
float p = 2.f*vec3_mul_inner(v, n);
float p = 2.f * vec3_mul_inner(v, n);
int i;
for(i=0;i<3;++i)
r[i] = v[i] - p*n[i];
}
LINMATH_H_FUNC void vec4_mul_cross(vec4 r, vec4 a, vec4 b)
LINMATH_H_FUNC void vec4_mul_cross(vec4 r, vec4 const a, vec4 const b)
{
r[0] = a[1]*b[2] - a[2]*b[1];
r[1] = a[2]*b[0] - a[0]*b[2];
@ -93,7 +94,7 @@ LINMATH_H_FUNC void vec4_mul_cross(vec4 r, vec4 a, vec4 b)
r[3] = 1.f;
}
LINMATH_H_FUNC void vec4_reflect(vec4 r, vec4 v, vec4 n)
LINMATH_H_FUNC void vec4_reflect(vec4 r, vec4 const v, vec4 const n)
{
float p = 2.f*vec4_mul_inner(v, n);
int i;
@ -109,61 +110,59 @@ LINMATH_H_FUNC void mat4x4_identity(mat4x4 M)
for(j=0; j<4; ++j)
M[i][j] = i==j ? 1.f : 0.f;
}
LINMATH_H_FUNC void mat4x4_dup(mat4x4 M, mat4x4 N)
LINMATH_H_FUNC void mat4x4_dup(mat4x4 M, mat4x4 const N)
{
int i, j;
int i;
for(i=0; i<4; ++i)
for(j=0; j<4; ++j)
M[i][j] = N[i][j];
vec4_dup(M[i], N[i]);
}
LINMATH_H_FUNC void mat4x4_row(vec4 r, mat4x4 M, int i)
LINMATH_H_FUNC void mat4x4_row(vec4 r, mat4x4 const M, int i)
{
int k;
for(k=0; k<4; ++k)
r[k] = M[k][i];
}
LINMATH_H_FUNC void mat4x4_col(vec4 r, mat4x4 M, int i)
LINMATH_H_FUNC void mat4x4_col(vec4 r, mat4x4 const M, int i)
{
int k;
for(k=0; k<4; ++k)
r[k] = M[i][k];
}
LINMATH_H_FUNC void mat4x4_transpose(mat4x4 M, mat4x4 N)
LINMATH_H_FUNC void mat4x4_transpose(mat4x4 M, mat4x4 const N)
{
// Note: if M and N are the same, the user has to
// explicitly make a copy of M and set it to N.
int i, j;
for(j=0; j<4; ++j)
for(i=0; i<4; ++i)
M[i][j] = N[j][i];
}
LINMATH_H_FUNC void mat4x4_add(mat4x4 M, mat4x4 a, mat4x4 b)
LINMATH_H_FUNC void mat4x4_add(mat4x4 M, mat4x4 const a, mat4x4 const b)
{
int i;
for(i=0; i<4; ++i)
vec4_add(M[i], a[i], b[i]);
}
LINMATH_H_FUNC void mat4x4_sub(mat4x4 M, mat4x4 a, mat4x4 b)
LINMATH_H_FUNC void mat4x4_sub(mat4x4 M, mat4x4 const a, mat4x4 const b)
{
int i;
for(i=0; i<4; ++i)
vec4_sub(M[i], a[i], b[i]);
}
LINMATH_H_FUNC void mat4x4_scale(mat4x4 M, mat4x4 a, float k)
LINMATH_H_FUNC void mat4x4_scale(mat4x4 M, mat4x4 const a, float k)
{
int i;
for(i=0; i<4; ++i)
vec4_scale(M[i], a[i], k);
}
LINMATH_H_FUNC void mat4x4_scale_aniso(mat4x4 M, mat4x4 a, float x, float y, float z)
LINMATH_H_FUNC void mat4x4_scale_aniso(mat4x4 M, mat4x4 const a, float x, float y, float z)
{
int i;
vec4_scale(M[0], a[0], x);
vec4_scale(M[1], a[1], y);
vec4_scale(M[2], a[2], z);
for(i = 0; i < 4; ++i) {
M[3][i] = a[3][i];
}
vec4_dup(M[3], a[3]);
}
LINMATH_H_FUNC void mat4x4_mul(mat4x4 M, mat4x4 a, mat4x4 b)
LINMATH_H_FUNC void mat4x4_mul(mat4x4 M, mat4x4 const a, mat4x4 const b)
{
mat4x4 temp;
int k, r, c;
@ -174,7 +173,7 @@ LINMATH_H_FUNC void mat4x4_mul(mat4x4 M, mat4x4 a, mat4x4 b)
}
mat4x4_dup(M, temp);
}
LINMATH_H_FUNC void mat4x4_mul_vec4(vec4 r, mat4x4 M, vec4 v)
LINMATH_H_FUNC void mat4x4_mul_vec4(vec4 r, mat4x4 const M, vec4 const v)
{
int i, j;
for(j=0; j<4; ++j) {
@ -200,13 +199,13 @@ LINMATH_H_FUNC void mat4x4_translate_in_place(mat4x4 M, float x, float y, float
M[3][i] += vec4_mul_inner(r, t);
}
}
LINMATH_H_FUNC void mat4x4_from_vec3_mul_outer(mat4x4 M, vec3 a, vec3 b)
LINMATH_H_FUNC void mat4x4_from_vec3_mul_outer(mat4x4 M, vec3 const a, vec3 const b)
{
int i, j;
for(i=0; i<4; ++i) for(j=0; j<4; ++j)
M[i][j] = i<3 && j<3 ? a[i] * b[j] : 0.f;
}
LINMATH_H_FUNC void mat4x4_rotate(mat4x4 R, mat4x4 M, float x, float y, float z, float angle)
LINMATH_H_FUNC void mat4x4_rotate(mat4x4 R, mat4x4 const M, float x, float y, float z, float angle)
{
float s = sinf(angle);
float c = cosf(angle);
@ -234,13 +233,13 @@ LINMATH_H_FUNC void mat4x4_rotate(mat4x4 R, mat4x4 M, float x, float y, float z,
mat4x4_add(T, T, C);
mat4x4_add(T, T, S);
T[3][3] = 1.;
T[3][3] = 1.f;
mat4x4_mul(R, M, T);
} else {
mat4x4_dup(R, M);
}
}
LINMATH_H_FUNC void mat4x4_rotate_X(mat4x4 Q, mat4x4 M, float angle)
LINMATH_H_FUNC void mat4x4_rotate_X(mat4x4 Q, mat4x4 const M, float angle)
{
float s = sinf(angle);
float c = cosf(angle);
@ -252,7 +251,7 @@ LINMATH_H_FUNC void mat4x4_rotate_X(mat4x4 Q, mat4x4 M, float angle)
};
mat4x4_mul(Q, M, R);
}
LINMATH_H_FUNC void mat4x4_rotate_Y(mat4x4 Q, mat4x4 M, float angle)
LINMATH_H_FUNC void mat4x4_rotate_Y(mat4x4 Q, mat4x4 const M, float angle)
{
float s = sinf(angle);
float c = cosf(angle);
@ -264,7 +263,7 @@ LINMATH_H_FUNC void mat4x4_rotate_Y(mat4x4 Q, mat4x4 M, float angle)
};
mat4x4_mul(Q, M, R);
}
LINMATH_H_FUNC void mat4x4_rotate_Z(mat4x4 Q, mat4x4 M, float angle)
LINMATH_H_FUNC void mat4x4_rotate_Z(mat4x4 Q, mat4x4 const M, float angle)
{
float s = sinf(angle);
float c = cosf(angle);
@ -276,7 +275,7 @@ LINMATH_H_FUNC void mat4x4_rotate_Z(mat4x4 Q, mat4x4 M, float angle)
};
mat4x4_mul(Q, M, R);
}
LINMATH_H_FUNC void mat4x4_invert(mat4x4 T, mat4x4 M)
LINMATH_H_FUNC void mat4x4_invert(mat4x4 T, mat4x4 const M)
{
float s[6];
float c[6];
@ -317,10 +316,10 @@ LINMATH_H_FUNC void mat4x4_invert(mat4x4 T, mat4x4 M)
T[3][2] = (-M[3][0] * s[3] + M[3][1] * s[1] - M[3][2] * s[0]) * idet;
T[3][3] = ( M[2][0] * s[3] - M[2][1] * s[1] + M[2][2] * s[0]) * idet;
}
LINMATH_H_FUNC void mat4x4_orthonormalize(mat4x4 R, mat4x4 M)
LINMATH_H_FUNC void mat4x4_orthonormalize(mat4x4 R, mat4x4 const M)
{
mat4x4_dup(R, M);
float s = 1.;
float s = 1.f;
vec3 h;
vec3_norm(R[2], R[2]);
@ -398,7 +397,7 @@ LINMATH_H_FUNC void mat4x4_perspective(mat4x4 m, float y_fov, float aspect, floa
m[3][2] = -((2.f * f * n) / (f - n));
m[3][3] = 0.f;
}
LINMATH_H_FUNC void mat4x4_look_at(mat4x4 m, vec3 eye, vec3 center, vec3 up)
LINMATH_H_FUNC void mat4x4_look_at(mat4x4 m, vec3 const eye, vec3 const center, vec3 const up)
{
/* Adapted from Android's OpenGL Matrix.java. */
/* See the OpenGL GLUT documentation for gluLookAt for a description */
@ -441,24 +440,18 @@ LINMATH_H_FUNC void mat4x4_look_at(mat4x4 m, vec3 eye, vec3 center, vec3 up)
}
typedef float quat[4];
#define quat_add vec4_add
#define quat_sub vec4_sub
#define quat_norm vec4_norm
#define quat_scale vec4_scale
#define quat_mul_inner vec4_mul_inner
LINMATH_H_FUNC void quat_identity(quat q)
{
q[0] = q[1] = q[2] = 0.f;
q[3] = 1.f;
}
LINMATH_H_FUNC void quat_add(quat r, quat a, quat b)
{
int i;
for(i=0; i<4; ++i)
r[i] = a[i] + b[i];
}
LINMATH_H_FUNC void quat_sub(quat r, quat a, quat b)
{
int i;
for(i=0; i<4; ++i)
r[i] = a[i] - b[i];
}
LINMATH_H_FUNC void quat_mul(quat r, quat p, quat q)
LINMATH_H_FUNC void quat_mul(quat r, quat const p, quat const q)
{
vec3 w;
vec3_mul_cross(r, p, q);
@ -468,37 +461,22 @@ LINMATH_H_FUNC void quat_mul(quat r, quat p, quat q)
vec3_add(r, r, w);
r[3] = p[3]*q[3] - vec3_mul_inner(p, q);
}
LINMATH_H_FUNC void quat_scale(quat r, quat v, float s)
{
int i;
for(i=0; i<4; ++i)
r[i] = v[i] * s;
}
LINMATH_H_FUNC float quat_inner_product(quat a, quat b)
{
float p = 0.f;
int i;
for(i=0; i<4; ++i)
p += b[i]*a[i];
return p;
}
LINMATH_H_FUNC void quat_conj(quat r, quat q)
LINMATH_H_FUNC void quat_conj(quat r, quat const q)
{
int i;
for(i=0; i<3; ++i)
r[i] = -q[i];
r[3] = q[3];
}
LINMATH_H_FUNC void quat_rotate(quat r, float angle, vec3 axis) {
vec3 v;
vec3_scale(v, axis, sinf(angle / 2));
int i;
for(i=0; i<3; ++i)
r[i] = v[i];
r[3] = cosf(angle / 2);
LINMATH_H_FUNC void quat_rotate(quat r, float angle, vec3 const axis) {
vec3 axis_norm;
vec3_norm(axis_norm, axis);
float s = sinf(angle / 2);
float c = cosf(angle / 2);
vec3_scale(r, axis_norm, s);
r[3] = c;
}
#define quat_norm vec4_norm
LINMATH_H_FUNC void quat_mul_vec3(vec3 r, quat q, vec3 v)
LINMATH_H_FUNC void quat_mul_vec3(vec3 r, quat const q, vec3 const v)
{
/*
* Method by Fabian 'ryg' Giessen (of Farbrausch)
@ -518,7 +496,7 @@ v' = v + q.w * t + cross(q.xyz, t)
vec3_add(r, v, t);
vec3_add(r, r, u);
}
LINMATH_H_FUNC void mat4x4_from_quat(mat4x4 M, quat q)
LINMATH_H_FUNC void mat4x4_from_quat(mat4x4 M, quat const q)
{
float a = q[3];
float b = q[0];
@ -548,18 +526,21 @@ LINMATH_H_FUNC void mat4x4_from_quat(mat4x4 M, quat q)
M[3][3] = 1.f;
}
LINMATH_H_FUNC void mat4x4o_mul_quat(mat4x4 R, mat4x4 M, quat q)
LINMATH_H_FUNC void mat4x4o_mul_quat(mat4x4 R, mat4x4 const M, quat const q)
{
/* XXX: The way this is written only works for othogonal matrices. */
/* XXX: The way this is written only works for orthogonal matrices. */
/* TODO: Take care of non-orthogonal case. */
quat_mul_vec3(R[0], q, M[0]);
quat_mul_vec3(R[1], q, M[1]);
quat_mul_vec3(R[2], q, M[2]);
R[3][0] = R[3][1] = R[3][2] = 0.f;
R[3][3] = 1.f;
R[0][3] = M[0][3];
R[1][3] = M[1][3];
R[2][3] = M[2][3];
R[3][3] = M[3][3]; // typically 1.0, but here we make it general
}
LINMATH_H_FUNC void quat_from_mat4x4(quat q, mat4x4 M)
LINMATH_H_FUNC void quat_from_mat4x4(quat q, mat4x4 const M)
{
float r=0.f;
int i;
@ -589,7 +570,7 @@ LINMATH_H_FUNC void quat_from_mat4x4(quat q, mat4x4 M)
q[3] = (M[p[2]][p[1]] - M[p[1]][p[2]])/(2.f*r);
}
LINMATH_H_FUNC void mat4x4_arcball(mat4x4 R, mat4x4 M, vec2 _a, vec2 _b, float s)
LINMATH_H_FUNC void mat4x4_arcball(mat4x4 R, mat4x4 const M, vec2 const _a, vec2 const _b, float s)
{
vec2 a; memcpy(a, _a, sizeof(a));
vec2 b; memcpy(b, _b, sizeof(b));
@ -597,14 +578,14 @@ LINMATH_H_FUNC void mat4x4_arcball(mat4x4 R, mat4x4 M, vec2 _a, vec2 _b, float s
float z_a = 0.;
float z_b = 0.;
if(vec2_len(a) < 1.f) {
z_a = sqrtf(1.f - vec2_mul_inner(a, a));
if(vec2_len(a) < 1.) {
z_a = sqrtf(1. - vec2_mul_inner(a, a));
} else {
vec2_norm(a, a);
}
if(vec2_len(b) < 1.f) {
z_b = sqrtf(1.f - vec2_mul_inner(b, b));
if(vec2_len(b) < 1.) {
z_b = sqrtf(1. - vec2_mul_inner(b, b));
} else {
vec2_norm(b, b);
}
@ -615,7 +596,7 @@ LINMATH_H_FUNC void mat4x4_arcball(mat4x4 R, mat4x4 M, vec2 _a, vec2 _b, float s
vec3 c_;
vec3_mul_cross(c_, a_, b_);
float const angle = acosf(vec3_mul_inner(a_, b_)) * s;
float const angle = acos(vec3_mul_inner(a_, b_)) * s;
mat4x4_rotate(R, M, c_[0], c_[1], c_[2], angle);
}
#endif

View File

@ -4,7 +4,7 @@
src/wl_* @linkmauve
docs/*.css @glfw/webdev
docs/*.less @glfw/webdev
docs/*.scss @glfw/webdev
docs/*.html @glfw/webdev
docs/*.xml @glfw/webdev

View File

@ -1074,13 +1074,6 @@ VERBATIM_HEADERS = YES
ALPHABETICAL_INDEX = YES
# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
# which the alphabetical index list will be split.
# Minimum value: 1, maximum value: 20, default value: 5.
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
COLS_IN_ALPHA_INDEX = 5
# In case all classes in a project start with a common prefix, all classes will
# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
# can be used to specify a prefix (or a list of prefixes) that should be ignored

View File

@ -103,8 +103,7 @@ To compile GLFW for Wayland, you need to have the Wayland packages installed,
as well as the basic development tools like GCC and make. For example, on
Ubuntu and other distributions based on Debian GNU/Linux, you need to install
the `libwayland-dev` package, which contains all Wayland headers and pulls in
wayland-scanner, as well as the `wayland-protocols` and `extra-cmake-modules`
packages.
wayland-scanner, as well as the `wayland-protocols` package.
Once you have installed the necessary packages, move on to @ref
compile_generate.

File diff suppressed because one or more lines are too long

1
docs/extra.css.map Normal file
View File

@ -0,0 +1 @@
{"version":3,"sourceRoot":"","sources":["extra.scss"],"names":[],"mappings":"AA8EA,4GACI,gBACA,iBAGJ,yBACC,yDAGD,6HACC,sDAGD,yIACC,sDAGD,mBACI,WA9EuB,KA+EvB,iBAGJ,uBACC,MAzFoB,QA0FjB,iBAGJ,6UACC,gBAGD,mJACC,YAGD,yHACC,iBAGD,sBACC,gBAGD,4LACC,UAGD,yCACC,aAGD,kMACC,WAnHgC,QAsHjC,KACC,MA1HoB,QA6HrB,sDACC,MA/Ge,QAgHf,mBAGD,GACE,iBACA,eAGF,GACE,iBACA,gBACA,eAGF,GACE,iBACA,gBACA,eAGF,YACC,eACA,gBACA,gBACA,eACA,cAEA,aACA,mBACA,eACA,2BACA,mBACA,sBAGD,UACC,iBACA,mBACA,MA/J0B,KAgK1B,gBACA,qEAGD,YACC,qBACA,kBACA,YAGD,yBACC,WAGD,oCACC,iBACA,gBACA,cACA,MAlL0B,KAqL3B,YACC,eAGD,8CACC,qBAGD,mBACC,MA9L0B,KAiM3B,eACC,kBACA,YACA,eAGD,KACC,WAxM0B,KA2M3B,UACC,gBACA,cACA,eAGD,WACC,gBACA,cACA,eAGD,UACI,aAGJ,mBACI,iBACA,iBAGJ,WACC,gBACA,aACA,mBACA,eACA,2BACA,mBACA,sBAGD,mEACC,MA9OgC,QAiPjC,gCACC,MArPoB,QAwPrB,sCACC,MAjOoB,KAoOrB,yBACC,kBAGD,UACC,iBAGD,wBACC,gBACA,cACA,eACA,qBAGD,uDACC,gEACA,+BACA,+BACA,gBACA,MArPgB,KAwPjB,mBACC,MA5PoB,KA6PpB,aACA,kBACA,yBAGD,QACC,WACA,WAGD,WACC,iBAGD,WACC,mBAGD,WACC,cACA,eACA,qBAGD,oCACC,gEACA,kCACA,2BACA,MAlSe,QAmSf,yBACA,kBAGD,WACC,MA3QuB,QA8QxB,cACC,sBACA,2BACA,4BACA,mBAGD,cACC,sBACA,+BACA,8BACA,gBAGD,mCACC,wBACA,iBACA,sBACA,kBAGD,gIACC,MAxToB,KAyTpB,qBAGD,cACC,wBACA,iBACA,sBACA,kBAGD,iBACC,WACA,4EAGD,oCApSC,gEACA,kCACA,cACA,yBAqSD,wBAxSC,gEACA,kCACA,cACA,yBAySD,qBA5SC,gEACA,kCACA,cACA,yBA6SD,gBAhTC,gEACA,kCACA,cACA,yBAiTD,iGACC,kBACA,YACA,2BACA,aAGD,kRACC,cAGD,SACC,oBAGD,0BACC,mBACA,kBACA,YACA,YACA,cACA,2BACA,aAGD,+CACC,MA1YoB,QA6YrB,+BACC,cAGD,sBACC,cAGD,+CACC,cACA,iBAGD,mBACC,cAGD,KACC,aACA","file":"extra.css"}

View File

@ -1,106 +1,106 @@
// NOTE: Please use this file to perform modifications on default style sheets.
//
// You need to install a few Ruby gems to generate extra.css from this file:
// gem install less therubyracer
// You need to install the official Sass CLI tool:
// npm install -g sass
//
// Run this command to regenerate extra.css after you're finished with changes:
// lessc --compress extra.less > extra.css
// sass --style=compressed extra.scss extra.css
//
// Alternatively you can use online services to regenerate extra.css.
// Default text color for page contents
@default-text-color: hsl(0,0%,30%);
$default-text-color: hsl(0,0%,30%);
// Page header, footer, table rows, inline codes and definition lists
@header-footer-background-color: hsl(0,0%,95%);
$header-footer-background-color: hsl(0,0%,95%);
// Page header, footer links and navigation bar background
@header-footer-link-color: hsl(0,0%,40%);
$header-footer-link-color: hsl(0,0%,40%);
// Doxygen navigation bar links
@navbar-link-color: @header-footer-background-color;
$navbar-link-color: $header-footer-background-color;
// Page content background color
@content-background-color: hsl(0,0%,100%);
$content-background-color: hsl(0,0%,100%);
// Bold, italic, h1, h2, ... and table of contents
@heading-color: hsl(0,0%,10%);
$heading-color: hsl(0,0%,10%);
// Function, enum and macro definition separator
@def-separator-color: @header-footer-background-color;
$def-separator-color: $header-footer-background-color;
// Base color hue
@base-hue: 24;
$base-hue: 24;
// Default color used for links
@default-link-color: hsl(@base-hue,100%,50%);
$default-link-color: hsl($base-hue,100%,50%);
// Doxygen navigation bar active tab
@tab-text-color: hsl(0,0%,100%);
@tab-background-color1: @default-link-color;
@tab-background-color2: lighten(spin(@tab-background-color1, 10), 10%);
$tab-text-color: hsl(0,0%,100%);
$tab-background-color1: $default-link-color;
$tab-background-color2: lighten(adjust-hue($tab-background-color1, 10), 10%);
// Table borders
@default-border-color: @default-link-color;
$default-border-color: $default-link-color;
// Table header
@table-text-color: @tab-text-color;
@table-background-color1: @tab-background-color1;
@table-background-color2: @tab-background-color2;
$table-text-color: $tab-text-color;
$table-background-color1: $tab-background-color1;
$table-background-color2: $tab-background-color2;
// Table of contents, data structure index and prototypes
@toc-background-color1: hsl(0,0%,90%);
@toc-background-color2: lighten(@toc-background-color1, 5%);
$toc-background-color1: hsl(0,0%,90%);
$toc-background-color2: lighten($toc-background-color1, 5%);
// Function prototype parameters color
@prototype-param-color: darken(@default-link-color, 25%);
$prototype-param-color: darken($default-link-color, 25%);
// Message box color: note, pre, post and invariant
@box-note-color: hsl(103,80%,85%);
$box-note-color: hsl(103,80%,85%);
// Message box color: warning and attention
@box-warning-color: hsl(34,80%,85%);
$box-warning-color: hsl(34,80%,85%);
// Message box color: deprecated and bug
@box-bug-color: hsl(333,80%,85%);
$box-bug-color: hsl(333,80%,85%);
// Message box color: todo and test
@box-todo-color: hsl(200,80%,85%);
$box-todo-color: hsl(200,80%,85%);
// Message box helper function
.message-box(@base-color) {
background:linear-gradient(to bottom,lighten(@base-color, 5%) 0%,@base-color 100%);
box-shadow:inset 0 0 32px darken(@base-color, 5%);
color:darken(@base-color, 67%);
border:2px solid desaturate(darken(@base-color, 10%), 20%);
@mixin message-box($base-color){
background:linear-gradient(to bottom,lighten($base-color, 5%) 0%,$base-color 100%);
box-shadow:inset 0 0 32px darken($base-color, 5%);
color:darken($base-color, 67%);
border:2px solid desaturate(darken($base-color, 10%), 20%);
}
.sm-dox,.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted,.sm-dox ul a:hover {
background:none;
text-shadow:none;
background:none;
text-shadow:none;
}
.sm-dox a span.sub-arrow {
border-color:@navbar-link-color transparent transparent transparent;
border-color:$navbar-link-color transparent transparent transparent;
}
.sm-dox a span.sub-arrow:active,.sm-dox a span.sub-arrow:focus,.sm-dox a span.sub-arrow:hover,.sm-dox a:hover span.sub-arrow {
border-color:@default-link-color transparent transparent transparent;
border-color:$default-link-color transparent transparent transparent;
}
.sm-dox ul a span.sub-arrow:active,.sm-dox ul a span.sub-arrow:focus,.sm-dox ul a span.sub-arrow:hover,.sm-dox ul a:hover span.sub-arrow {
border-color:transparent transparent transparent @default-link-color;
border-color:transparent transparent transparent $default-link-color;
}
.sm-dox ul a:hover {
background:@header-footer-link-color;
text-shadow:none;
background:$header-footer-link-color;
text-shadow:none;
}
.sm-dox ul.sm-nowrap a {
color:@default-text-color;
text-shadow:none;
color:$default-text-color;
text-shadow:none;
}
#main-nav,#main-menu,#main-menu a,#main-menu a:visited,#main-menu a:hover,#main-menu li,.memdoc,dl.reflist dd,div.toc li,.ah,span.lineno,span.lineno a,span.lineno a:hover,.note code,.pre code,.post code,.invariant code,.warning code,.attention code,.deprecated code,.bug code,.todo code,.test code,.doxtable code,.markdownTable code {
@ -128,33 +128,33 @@ div.headertitle,.note code,.pre code,.post code,.invariant code,.warning code,.a
}
html,#titlearea,.footer,tr.even,.directory tr.even,.doxtable tr:nth-child(even),tr.markdownTableBody:nth-child(even),.mdescLeft,.mdescRight,.memItemLeft,.memItemRight,code,.markdownTableRowEven {
background:@header-footer-background-color;
background:$header-footer-background-color;
}
body {
color:@default-text-color;
color:$default-text-color;
}
h1,h2,h2.groupheader,h3,div.toc h3,h4,h5,h6,strong,em {
color:@heading-color;
color:$heading-color;
border-bottom:none;
}
h1 {
padding-top:0.5em;
font-size:180%;
padding-top:0.5em;
font-size:180%;
}
h2 {
padding-top:0.5em;
margin-bottom:0;
font-size:140%;
padding-top:0.5em;
margin-bottom:0;
font-size:140%;
}
h3 {
padding-top:0.5em;
margin-bottom:0;
font-size:110%;
padding-top:0.5em;
margin-bottom:0;
font-size:110%;
}
.glfwheader {
@ -175,7 +175,7 @@ h3 {
#glfwhome {
line-height:64px;
padding-right:48px;
color:@header-footer-link-color;
color:$header-footer-link-color;
font-size:2.5em;
background:url("https://www.glfw.org/css/arrow.png") no-repeat right;
}
@ -194,7 +194,7 @@ h3 {
line-height:64px;
margin-left:2em;
display:block;
color:@header-footer-link-color;
color:$header-footer-link-color;
}
.glfwnavbar {
@ -206,7 +206,7 @@ h3 {
}
#titlearea,.footer {
color:@header-footer-link-color;
color:$header-footer-link-color;
}
address.footer {
@ -216,7 +216,7 @@ address.footer {
}
#top {
background:@header-footer-link-color;
background:$header-footer-link-color;
}
#main-nav {
@ -232,12 +232,12 @@ address.footer {
}
.memtitle {
display:none;
display:none;
}
.memproto,.memname {
font-weight:bold;
text-shadow:none;
font-weight:bold;
text-shadow:none;
}
#main-menu {
@ -251,15 +251,15 @@ address.footer {
}
#main-menu a,#main-menu a:visited,#main-menu a:hover,#main-menu li {
color:@navbar-link-color;
color:$navbar-link-color;
}
#main-menu li ul.sm-nowrap li a {
color:@default-text-color;
color:$default-text-color;
}
#main-menu li ul.sm-nowrap li a:hover {
color:@default-link-color;
color:$default-link-color;
}
#main-menu > li:last-child {
@ -274,22 +274,22 @@ div.contents,div.header {
max-width:920px;
margin:0 auto;
padding:0 32px;
background:@content-background-color none;
background:$content-background-color none;
}
table.doxtable th,table.markdownTable th,dl.reflist dt {
background:linear-gradient(to bottom,@table-background-color2 0%,@table-background-color1 100%);
box-shadow:inset 0 0 32px @table-background-color1;
text-shadow:0 -1px 1px darken(@table-background-color1, 15%);
background:linear-gradient(to bottom,$table-background-color2 0%,$table-background-color1 100%);
box-shadow:inset 0 0 32px $table-background-color1;
text-shadow:0 -1px 1px darken($table-background-color1, 15%);
text-align:left;
color:@table-text-color;
color:$table-text-color;
}
dl.reflist dt a.el {
color:@default-link-color;
color:$default-link-color;
padding:.2em;
border-radius:4px;
background-color:lighten(@default-link-color, 40%);
background-color:lighten($default-link-color, 40%);
}
div.toc {
@ -312,27 +312,27 @@ div.toc li {
}
div.toc,.memproto,div.qindex,div.ah {
background:linear-gradient(to bottom,@toc-background-color2 0%,@toc-background-color1 100%);
box-shadow:inset 0 0 32px @toc-background-color1;
text-shadow:0 1px 1px lighten(@toc-background-color2, 10%);
color:@heading-color;
border:2px solid @toc-background-color1;
background:linear-gradient(to bottom,$toc-background-color2 0%,$toc-background-color1 100%);
box-shadow:inset 0 0 32px $toc-background-color1;
text-shadow:0 1px 1px lighten($toc-background-color2, 10%);
color:$heading-color;
border:2px solid $toc-background-color1;
border-radius:4px;
}
.paramname {
color:@prototype-param-color;
color:$prototype-param-color;
}
dl.reflist dt {
border:2px solid @default-border-color;
border:2px solid $default-border-color;
border-top-left-radius:4px;
border-top-right-radius:4px;
border-bottom:none;
}
dl.reflist dd {
border:2px solid @default-border-color;
border:2px solid $default-border-color;
border-bottom-right-radius:4px;
border-bottom-left-radius:4px;
border-top:none;
@ -341,41 +341,41 @@ dl.reflist dd {
table.doxtable,table.markdownTable {
border-collapse:inherit;
border-spacing:0;
border:2px solid @default-border-color;
border:2px solid $default-border-color;
border-radius:4px;
}
a,a:hover,a:visited,a:visited:hover,.contents a:visited,.el,a.el:visited,#glfwhome:hover,#main-menu a:hover,span.lineno a:hover {
color:@default-link-color;
color:$default-link-color;
text-decoration:none;
}
div.directory {
border-collapse:inherit;
border-spacing:0;
border:2px solid @default-border-color;
border:2px solid $default-border-color;
border-radius:4px;
}
hr,.memSeparator {
height:2px;
background:linear-gradient(to right,@def-separator-color 0%,darken(@def-separator-color, 10%) 50%,@def-separator-color 100%);
background:linear-gradient(to right,$def-separator-color 0%,darken($def-separator-color, 10%) 50%,$def-separator-color 100%);
}
dl.note,dl.pre,dl.post,dl.invariant {
.message-box(@box-note-color);
@include message-box($box-note-color);
}
dl.warning,dl.attention {
.message-box(@box-warning-color);
@include message-box($box-warning-color);
}
dl.deprecated,dl.bug {
.message-box(@box-bug-color);
@include message-box($box-bug-color);
}
dl.todo,dl.test {
.message-box(@box-todo-color);
@include message-box($box-todo-color);
}
dl.note,dl.pre,dl.post,dl.invariant,dl.warning,dl.attention,dl.deprecated,dl.bug,dl.todo,dl.test {
@ -404,7 +404,7 @@ div.fragment,pre.fragment {
}
.lineno a,.lineno a:visited,.line,pre.fragment {
color:@default-text-color;
color:$default-text-color;
}
span.preprocessor,span.comment {
@ -416,7 +416,7 @@ a.code,a.code:visited {
}
span.keyword,span.keywordtype,span.keywordflow {
color:darken(@default-text-color, 5%);
color:darken($default-text-color, 5%);
font-weight:bold;
}

View File

@ -93,7 +93,7 @@ if (glfwVulkanSupported())
This function returns `GLFW_TRUE` if the Vulkan loader and any minimally
functional ICD was found.
If if one or both were not found, calling any other Vulkan related GLFW function
If one or both were not found, calling any other Vulkan related GLFW function
will generate a @ref GLFW_API_UNAVAILABLE error.

View File

@ -1495,7 +1495,7 @@ typedef void (* GLFWwindowiconifyfun)(GLFWwindow*,int);
* @endcode
*
* @param[in] window The window that was maximized or restored.
* @param[in] iconified `GLFW_TRUE` if the window was maximized, or
* @param[in] maximized `GLFW_TRUE` if the window was maximized, or
* `GLFW_FALSE` if it was restored.
*
* @sa @ref window_maximize

View File

@ -37,7 +37,7 @@ elseif (_GLFW_OSMESA)
endif()
if (_GLFW_X11 OR _GLFW_WAYLAND)
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
target_sources(glfw PRIVATE linux_joystick.h linux_joystick.c)
else()
target_sources(glfw PRIVATE null_joystick.h null_joystick.c)
@ -45,31 +45,42 @@ if (_GLFW_X11 OR _GLFW_WAYLAND)
endif()
if (_GLFW_WAYLAND)
ecm_add_wayland_client_protocol(GLFW_WAYLAND_PROTOCOL_SOURCES
PROTOCOL
"${WAYLAND_PROTOCOLS_PKGDATADIR}/stable/xdg-shell/xdg-shell.xml"
BASENAME xdg-shell)
ecm_add_wayland_client_protocol(GLFW_WAYLAND_PROTOCOL_SOURCES
PROTOCOL
"${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml"
BASENAME xdg-decoration)
ecm_add_wayland_client_protocol(GLFW_WAYLAND_PROTOCOL_SOURCES
PROTOCOL
"${WAYLAND_PROTOCOLS_PKGDATADIR}/stable/viewporter/viewporter.xml"
BASENAME viewporter)
ecm_add_wayland_client_protocol(GLFW_WAYLAND_PROTOCOL_SOURCES
PROTOCOL
"${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/relative-pointer/relative-pointer-unstable-v1.xml"
BASENAME relative-pointer-unstable-v1)
ecm_add_wayland_client_protocol(GLFW_WAYLAND_PROTOCOL_SOURCES
PROTOCOL
"${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml"
BASENAME pointer-constraints-unstable-v1)
ecm_add_wayland_client_protocol(GLFW_WAYLAND_PROTOCOL_SOURCES
PROTOCOL
"${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml"
BASENAME idle-inhibit-unstable-v1)
target_sources(glfw PRIVATE ${GLFW_WAYLAND_PROTOCOL_SOURCES})
find_program(WAYLAND_SCANNER_EXECUTABLE NAMES wayland-scanner)
pkg_check_modules(WAYLAND_PROTOCOLS REQUIRED wayland-protocols>=1.15)
pkg_get_variable(WAYLAND_PROTOCOLS_BASE wayland-protocols pkgdatadir)
macro(wayland_generate protocol_file output_file)
add_custom_command(OUTPUT "${output_file}.h"
COMMAND "${WAYLAND_SCANNER_EXECUTABLE}" client-header "${protocol_file}" "${output_file}.h"
DEPENDS "${protocol_file}"
VERBATIM)
add_custom_command(OUTPUT "${output_file}.c"
COMMAND "${WAYLAND_SCANNER_EXECUTABLE}" private-code "${protocol_file}" "${output_file}.c"
DEPENDS "${protocol_file}"
VERBATIM)
target_sources(glfw PRIVATE "${output_file}.h" "${output_file}.c")
endmacro()
wayland_generate(
"${WAYLAND_PROTOCOLS_BASE}/stable/xdg-shell/xdg-shell.xml"
"${GLFW_BINARY_DIR}/src/wayland-xdg-shell-client-protocol")
wayland_generate(
"${WAYLAND_PROTOCOLS_BASE}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml"
"${GLFW_BINARY_DIR}/src/wayland-xdg-decoration-client-protocol")
wayland_generate(
"${WAYLAND_PROTOCOLS_BASE}/stable/viewporter/viewporter.xml"
"${GLFW_BINARY_DIR}/src/wayland-viewporter-client-protocol")
wayland_generate(
"${WAYLAND_PROTOCOLS_BASE}/unstable/relative-pointer/relative-pointer-unstable-v1.xml"
"${GLFW_BINARY_DIR}/src/wayland-relative-pointer-unstable-v1-client-protocol")
wayland_generate(
"${WAYLAND_PROTOCOLS_BASE}/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml"
"${GLFW_BINARY_DIR}/src/wayland-pointer-constraints-unstable-v1-client-protocol")
wayland_generate(
"${WAYLAND_PROTOCOLS_BASE}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml"
"${GLFW_BINARY_DIR}/src/wayland-idle-inhibit-unstable-v1-client-protocol")
endif()
if (WIN32 AND BUILD_SHARED_LIBS)
@ -101,27 +112,36 @@ target_include_directories(glfw PRIVATE
target_link_libraries(glfw PRIVATE Threads::Threads ${glfw_LIBRARIES})
# Workaround for CMake not knowing about .m files before version 3.16
if (APPLE)
if ("${CMAKE_VERSION}" VERSION_LESS "3.16" AND APPLE)
set_source_files_properties(cocoa_init.m cocoa_joystick.m cocoa_monitor.m
cocoa_window.m nsgl_context.m PROPERTIES
LANGUAGE C)
endif()
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR
"${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR
"${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang")
# Make GCC and Clang warn about declarations that VS 2010 and 2012 won't
# accept for all source files that VS will build
# Make GCC warn about declarations that VS 2010 and 2012 won't accept for all
# source files that VS will build (Clang ignores this because we set -std=c99)
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
set_source_files_properties(context.c init.c input.c monitor.c vulkan.c
window.c win32_init.c win32_joystick.c
win32_monitor.c win32_time.c win32_thread.c
win32_window.c wgl_context.c egl_context.c
osmesa_context.c PROPERTIES
COMPILE_FLAGS -Wdeclaration-after-statement)
endif()
# Enable a reasonable set of warnings (no, -Wextra is not reasonable)
target_compile_options(glfw PRIVATE "-Wall")
# Enable a reasonable set of warnings
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR
CMAKE_C_COMPILER_ID STREQUAL "Clang" OR
CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
if (CMAKE_C_SIMULATE_ID STREQUAL "MSVC")
# Tell Clang-CL that this is a Clang flag
target_compile_options(glfw PRIVATE "/clang:-Wall")
else()
target_compile_options(glfw PRIVATE "-Wall")
endif()
elseif (MSVC)
target_compile_options(glfw PRIVATE "/W3")
endif()
if (WIN32)
@ -183,9 +203,6 @@ if (BUILD_SHARED_LIBS)
endif()
target_compile_definitions(glfw INTERFACE GLFW_DLL)
elseif (APPLE)
set_target_properties(glfw PROPERTIES
INSTALL_NAME_DIR "${CMAKE_INSTALL_LIBDIR}")
endif()
if (MINGW)

View File

@ -251,7 +251,7 @@ static void createKeyTables(void)
_glfw.ns.keycodes[0x6D] = GLFW_KEY_F10;
_glfw.ns.keycodes[0x67] = GLFW_KEY_F11;
_glfw.ns.keycodes[0x6F] = GLFW_KEY_F12;
_glfw.ns.keycodes[0x69] = GLFW_KEY_F13;
_glfw.ns.keycodes[0x69] = GLFW_KEY_PRINT_SCREEN;
_glfw.ns.keycodes[0x6B] = GLFW_KEY_F14;
_glfw.ns.keycodes[0x71] = GLFW_KEY_F15;
_glfw.ns.keycodes[0x6A] = GLFW_KEY_F16;
@ -428,9 +428,6 @@ static GLFWbool initializeTIS(void)
{
if (_glfw.hints.init.ns.menubar)
{
// In case we are unbundled, make us a proper UI application
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
// Menu bar setup must go between sharedApplication and finishLaunching
// in order to properly emulate the behavior of NSApplicationMain
@ -557,6 +554,10 @@ int _glfwPlatformInit(void)
if (![[NSRunningApplication currentApplication] isFinishedLaunching])
[NSApp run];
// In case we are unbundled, make us a proper UI application
if (_glfw.hints.init.ns.menubar)
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
return GLFW_TRUE;
} // autoreleasepool

View File

@ -39,8 +39,21 @@
// Get the name of the specified display, or NULL
//
static char* getDisplayName(CGDirectDisplayID displayID)
static char* getMonitorName(CGDirectDisplayID displayID, NSScreen* screen)
{
// IOKit doesn't work on Apple Silicon anymore
// Luckily, 10.15 introduced -[NSScreen localizedName].
// Use it if available, and fall back to IOKit otherwise.
if (screen)
{
if ([screen respondsToSelector:@selector(localizedName)])
{
NSString* name = [screen valueForKey:@"localizedName"];
if (name)
return _glfw_strdup([name UTF8String]);
}
}
io_iterator_t it;
io_service_t service;
CFDictionaryRef info;
@ -209,31 +222,6 @@ static void endFadeReservation(CGDisplayFadeReservationToken token)
}
}
// Finds and caches the NSScreen corresponding to the specified monitor
//
static GLFWbool refreshMonitorScreen(_GLFWmonitor* monitor)
{
if (monitor->ns.screen)
return GLFW_TRUE;
for (NSScreen* screen in [NSScreen screens])
{
NSNumber* displayID = [screen deviceDescription][@"NSScreenNumber"];
// HACK: Compare unit numbers instead of display IDs to work around
// display replacement on machines with automatic graphics
// switching
if (monitor->ns.unitNumber == CGDisplayUnitNumber([displayID unsignedIntValue]))
{
monitor->ns.screen = screen;
return GLFW_TRUE;
}
}
_glfwInputError(GLFW_PLATFORM_ERROR, "Cocoa: Failed to find a screen for monitor");
return GLFW_FALSE;
}
// Returns the display refresh rate queried from the I/O registry
//
static double getFallbackRefreshRate(CGDirectDisplayID displayID)
@ -334,27 +322,46 @@ void _glfwPollMonitorsNS(void)
if (CGDisplayIsAsleep(displays[i]))
continue;
const uint32_t unitNumber = CGDisplayUnitNumber(displays[i]);
NSScreen* screen = nil;
for (screen in [NSScreen screens])
{
NSNumber* screenNumber = [screen deviceDescription][@"NSScreenNumber"];
// HACK: Compare unit numbers instead of display IDs to work around
// display replacement on machines with automatic graphics
// switching
if (CGDisplayUnitNumber([screenNumber unsignedIntValue]) == unitNumber)
break;
}
// HACK: Compare unit numbers instead of display IDs to work around
// display replacement on machines with automatic graphics
// switching
const uint32_t unitNumber = CGDisplayUnitNumber(displays[i]);
for (uint32_t j = 0; j < disconnectedCount; j++)
uint32_t j;
for (j = 0; j < disconnectedCount; j++)
{
if (disconnected[j] && disconnected[j]->ns.unitNumber == unitNumber)
{
disconnected[j]->ns.screen = screen;
disconnected[j] = NULL;
break;
}
}
if (j < disconnectedCount)
continue;
const CGSize size = CGDisplayScreenSize(displays[i]);
char* name = getDisplayName(displays[i]);
char* name = getMonitorName(displays[i], screen);
if (!name)
name = _glfw_strdup("Unknown");
_GLFWmonitor* monitor = _glfwAllocMonitor(name, size.width, size.height);
monitor->ns.displayID = displays[i];
monitor->ns.unitNumber = unitNumber;
monitor->ns.screen = screen;
free(name);
@ -463,8 +470,11 @@ void _glfwPlatformGetMonitorContentScale(_GLFWmonitor* monitor,
{
@autoreleasepool {
if (!refreshMonitorScreen(monitor))
return;
if (!monitor->ns.screen)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Cocoa: Cannot query content scale without screen");
}
const NSRect points = [monitor->ns.screen frame];
const NSRect pixels = [monitor->ns.screen convertRectToBacking:points];
@ -483,8 +493,11 @@ void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor,
{
@autoreleasepool {
if (!refreshMonitorScreen(monitor))
return;
if (!monitor->ns.screen)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Cocoa: Cannot query workarea without screen");
}
const NSRect frameRect = [monitor->ns.screen visibleFrame];
@ -527,7 +540,7 @@ GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count)
}
// Skip duplicate modes
if (i < *count)
if (j < *count)
continue;
(*count)++;

View File

@ -1635,14 +1635,21 @@ int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape)
SEL cursorSelector = NULL;
// HACK: Try to use a private message
if (shape == GLFW_RESIZE_EW_CURSOR)
cursorSelector = NSSelectorFromString(@"_windowResizeEastWestCursor");
else if (shape == GLFW_RESIZE_NS_CURSOR)
cursorSelector = NSSelectorFromString(@"_windowResizeNorthSouthCursor");
else if (shape == GLFW_RESIZE_NWSE_CURSOR)
cursorSelector = NSSelectorFromString(@"_windowResizeNorthWestSouthEastCursor");
else if (shape == GLFW_RESIZE_NESW_CURSOR)
cursorSelector = NSSelectorFromString(@"_windowResizeNorthEastSouthWestCursor");
switch (shape)
{
case GLFW_RESIZE_EW_CURSOR:
cursorSelector = NSSelectorFromString(@"_windowResizeEastWestCursor");
break;
case GLFW_RESIZE_NS_CURSOR:
cursorSelector = NSSelectorFromString(@"_windowResizeNorthSouthCursor");
break;
case GLFW_RESIZE_NWSE_CURSOR:
cursorSelector = NSSelectorFromString(@"_windowResizeNorthWestSouthEastCursor");
break;
case GLFW_RESIZE_NESW_CURSOR:
cursorSelector = NSSelectorFromString(@"_windowResizeNorthEastSouthWestCursor");
break;
}
if (cursorSelector && [NSCursor respondsToSelector:cursorSelector])
{
@ -1653,22 +1660,33 @@ int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape)
if (!cursor->ns.object)
{
if (shape == GLFW_ARROW_CURSOR)
cursor->ns.object = [NSCursor arrowCursor];
else if (shape == GLFW_IBEAM_CURSOR)
cursor->ns.object = [NSCursor IBeamCursor];
else if (shape == GLFW_CROSSHAIR_CURSOR)
cursor->ns.object = [NSCursor crosshairCursor];
else if (shape == GLFW_POINTING_HAND_CURSOR)
cursor->ns.object = [NSCursor pointingHandCursor];
else if (shape == GLFW_RESIZE_EW_CURSOR)
cursor->ns.object = [NSCursor resizeLeftRightCursor];
else if (shape == GLFW_RESIZE_NS_CURSOR)
cursor->ns.object = [NSCursor resizeUpDownCursor];
else if (shape == GLFW_RESIZE_ALL_CURSOR)
cursor->ns.object = [NSCursor closedHandCursor];
else if (shape == GLFW_NOT_ALLOWED_CURSOR)
cursor->ns.object = [NSCursor operationNotAllowedCursor];
switch (shape)
{
case GLFW_ARROW_CURSOR:
cursor->ns.object = [NSCursor arrowCursor];
break;
case GLFW_IBEAM_CURSOR:
cursor->ns.object = [NSCursor IBeamCursor];
break;
case GLFW_CROSSHAIR_CURSOR:
cursor->ns.object = [NSCursor crosshairCursor];
break;
case GLFW_POINTING_HAND_CURSOR:
cursor->ns.object = [NSCursor pointingHandCursor];
break;
case GLFW_RESIZE_EW_CURSOR:
cursor->ns.object = [NSCursor resizeLeftRightCursor];
break;
case GLFW_RESIZE_NS_CURSOR:
cursor->ns.object = [NSCursor resizeUpDownCursor];
break;
case GLFW_RESIZE_ALL_CURSOR:
cursor->ns.object = [NSCursor closedHandCursor];
break;
case GLFW_NOT_ALLOWED_CURSOR:
cursor->ns.object = [NSCursor operationNotAllowedCursor];
break;
}
}
if (!cursor->ns.object)

View File

@ -353,9 +353,9 @@ struct _GLFWcontext
int robustness;
int release;
PFNGLGETSTRINGIPROC GetStringi;
PFNGLGETSTRINGIPROC GetStringi;
PFNGLGETINTEGERVPROC GetIntegerv;
PFNGLGETSTRINGPROC GetString;
PFNGLGETSTRINGPROC GetString;
_GLFWmakecontextcurrentfun makeCurrent;
_GLFWswapbuffersfun swapBuffers;
@ -426,23 +426,23 @@ struct _GLFWwindow
_GLFWcontext context;
struct {
GLFWwindowposfun pos;
GLFWwindowsizefun size;
GLFWwindowclosefun close;
GLFWwindowrefreshfun refresh;
GLFWwindowfocusfun focus;
GLFWwindowiconifyfun iconify;
GLFWwindowmaximizefun maximize;
GLFWframebuffersizefun fbsize;
GLFWwindowposfun pos;
GLFWwindowsizefun size;
GLFWwindowclosefun close;
GLFWwindowrefreshfun refresh;
GLFWwindowfocusfun focus;
GLFWwindowiconifyfun iconify;
GLFWwindowmaximizefun maximize;
GLFWframebuffersizefun fbsize;
GLFWwindowcontentscalefun scale;
GLFWmousebuttonfun mouseButton;
GLFWcursorposfun cursorPos;
GLFWcursorenterfun cursorEnter;
GLFWscrollfun scroll;
GLFWkeyfun key;
GLFWcharfun character;
GLFWcharmodsfun charmods;
GLFWdropfun drop;
GLFWmousebuttonfun mouseButton;
GLFWcursorposfun cursorPos;
GLFWcursorenterfun cursorEnter;
GLFWscrollfun scroll;
GLFWkeyfun key;
GLFWcharfun character;
GLFWcharmodsfun charmods;
GLFWdropfun drop;
} callbacks;
// This is defined in the window API's platform.h

View File

@ -39,6 +39,10 @@ static const GUID _glfw_GUID_DEVINTERFACE_HID =
#if defined(_GLFW_USE_HYBRID_HPG) || defined(_GLFW_USE_OPTIMUS_HPG)
#if defined(_GLFW_BUILD_DLL)
#warning "These symbols must be exported by the executable and have no effect in a DLL"
#endif
// Executables (but not DLLs) exporting this symbol with this value will be
// automatically directed to the high-performance GPU on Nvidia Optimus systems
// with up-to-date drivers
@ -614,7 +618,9 @@ void _glfwPlatformTerminate(void)
const char* _glfwPlatformGetVersionString(void)
{
return _GLFW_VERSION_NUMBER " Win32 WGL EGL OSMesa"
#if defined(__MINGW32__)
#if defined(__MINGW64_VERSION_MAJOR)
" MinGW-w64"
#elif defined(__MINGW32__)
" MinGW"
#elif defined(_MSC_VER)
" VisualC"

View File

@ -185,6 +185,8 @@ void _glfwPollMonitorsWin32(void)
display.DeviceName) == 0)
{
disconnected[i] = NULL;
// handle may have changed, update
EnumDisplayMonitors(NULL, NULL, monitorCallback, (LPARAM) _glfw.monitors[i]);
break;
}
}

View File

@ -102,7 +102,7 @@
#define DISPLAY_DEVICE_ACTIVE 0x00000001
#endif
#ifndef _WIN32_WINNT_WINBLUE
#define _WIN32_WINNT_WINBLUE 0x0602
#define _WIN32_WINNT_WINBLUE 0x0603
#endif
#ifndef _WIN32_WINNT_WIN8
#define _WIN32_WINNT_WIN8 0x0602
@ -314,6 +314,9 @@ typedef struct _GLFWwindowWin32
GLFWbool scaleToMonitor;
GLFWbool keymenu;
// Cached size used to filter out duplicate events
int width, height;
// The last received cursor position, regardless of source
int lastCursorPosX, lastCursorPosY;
// The last recevied high surrogate when decoding pairs of UTF-16 messages

View File

@ -501,7 +501,17 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
case WM_NCCREATE:
{
if (_glfwIsWindows10AnniversaryUpdateOrGreaterWin32())
EnableNonClientDpiScaling(hWnd);
{
const CREATESTRUCTW* cs = (const CREATESTRUCTW*) lParam;
const _GLFWwndconfig* wndconfig = cs->lpCreateParams;
// On per-monitor DPI aware V1 systems, only enable
// non-client scaling for windows that scale the client area
// We need WM_GETDPISCALEDSIZE from V2 to keep the client
// area static when the non-client area is scaled
if (wndconfig && wndconfig->scaleToMonitor)
EnableNonClientDpiScaling(hWnd);
}
break;
}
@ -961,6 +971,8 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
case WM_SIZE:
{
const int width = LOWORD(lParam);
const int height = HIWORD(lParam);
const GLFWbool iconified = wParam == SIZE_MINIMIZED;
const GLFWbool maximized = wParam == SIZE_MAXIMIZED ||
(window->win32.maximized &&
@ -975,8 +987,14 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
if (window->win32.maximized != maximized)
_glfwInputWindowMaximize(window, maximized);
_glfwInputFramebufferSize(window, LOWORD(lParam), HIWORD(lParam));
_glfwInputWindowSize(window, LOWORD(lParam), HIWORD(lParam));
if (width != window->win32.width || height != window->win32.height)
{
window->win32.width = width;
window->win32.height = height;
_glfwInputFramebufferSize(window, width, height);
_glfwInputWindowSize(window, width, height);
}
if (window->monitor && window->win32.iconified != iconified)
{
@ -1130,9 +1148,11 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
const float xscale = HIWORD(wParam) / (float) USER_DEFAULT_SCREEN_DPI;
const float yscale = LOWORD(wParam) / (float) USER_DEFAULT_SCREEN_DPI;
// Only apply the suggested size if the OS is new enough to have
// sent a WM_GETDPISCALEDSIZE before this
if (_glfwIsWindows10CreatorsUpdateOrGreaterWin32())
// Resize windowed mode windows that either permit rescaling or that
// need it to compensate for non-client area scaling
if (!window->monitor &&
(window->win32.scaleToMonitor ||
_glfwIsWindows10CreatorsUpdateOrGreaterWin32()))
{
RECT* suggested = (RECT*) lParam;
SetWindowPos(window->win32.handle, HWND_TOP,
@ -1247,7 +1267,7 @@ static int createNativeWindow(_GLFWwindow* window,
NULL, // No parent window
NULL, // No window menu
GetModuleHandleW(NULL),
NULL);
(LPVOID) wndconfig);
free(wideTitle);
@ -1315,6 +1335,8 @@ static int createNativeWindow(_GLFWwindow* window,
window->win32.transparent = GLFW_TRUE;
}
_glfwPlatformGetWindowSize(window, &window->win32.width, &window->win32.height);
return GLFW_TRUE;
}
@ -2113,30 +2135,41 @@ int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape)
{
int id = 0;
if (shape == GLFW_ARROW_CURSOR)
id = OCR_NORMAL;
else if (shape == GLFW_IBEAM_CURSOR)
id = OCR_IBEAM;
else if (shape == GLFW_CROSSHAIR_CURSOR)
id = OCR_CROSS;
else if (shape == GLFW_POINTING_HAND_CURSOR)
id = OCR_HAND;
else if (shape == GLFW_RESIZE_EW_CURSOR)
id = OCR_SIZEWE;
else if (shape == GLFW_RESIZE_NS_CURSOR)
id = OCR_SIZENS;
else if (shape == GLFW_RESIZE_NWSE_CURSOR)
id = OCR_SIZENWSE;
else if (shape == GLFW_RESIZE_NESW_CURSOR)
id = OCR_SIZENESW;
else if (shape == GLFW_RESIZE_ALL_CURSOR)
id = OCR_SIZEALL;
else if (shape == GLFW_NOT_ALLOWED_CURSOR)
id = OCR_NO;
else
switch (shape)
{
_glfwInputError(GLFW_PLATFORM_ERROR, "Win32: Unknown standard cursor");
return GLFW_FALSE;
case GLFW_ARROW_CURSOR:
id = OCR_NORMAL;
break;
case GLFW_IBEAM_CURSOR:
id = OCR_IBEAM;
break;
case GLFW_CROSSHAIR_CURSOR:
id = OCR_CROSS;
break;
case GLFW_POINTING_HAND_CURSOR:
id = OCR_HAND;
break;
case GLFW_RESIZE_EW_CURSOR:
id = OCR_SIZEWE;
break;
case GLFW_RESIZE_NS_CURSOR:
id = OCR_SIZENS;
break;
case GLFW_RESIZE_NWSE_CURSOR:
id = OCR_SIZENWSE;
break;
case GLFW_RESIZE_NESW_CURSOR:
id = OCR_SIZENESW;
break;
case GLFW_RESIZE_ALL_CURSOR:
id = OCR_SIZEALL;
break;
case GLFW_NOT_ALLOWED_CURSOR:
id = OCR_NO;
break;
default:
_glfwInputError(GLFW_PLATFORM_ERROR, "Win32: Unknown standard cursor");
return GLFW_FALSE;
}
cursor->win32.handle = LoadImageW(NULL,

View File

@ -882,27 +882,18 @@ GLFWAPI void glfwSetWindowAttrib(GLFWwindow* handle, int attrib, int value)
window->autoIconify = value;
else if (attrib == GLFW_RESIZABLE)
{
if (window->resizable == value)
return;
window->resizable = value;
if (!window->monitor)
_glfwPlatformSetWindowResizable(window, value);
}
else if (attrib == GLFW_DECORATED)
{
if (window->decorated == value)
return;
window->decorated = value;
if (!window->monitor)
_glfwPlatformSetWindowDecorated(window, value);
}
else if (attrib == GLFW_FLOATING)
{
if (window->floating == value)
return;
window->floating = value;
if (!window->monitor)
_glfwPlatformSetWindowFloating(window, value);
@ -911,9 +902,6 @@ GLFWAPI void glfwSetWindowAttrib(GLFWwindow* handle, int attrib, int value)
window->focusOnShow = value;
else if (attrib == GLFW_MOUSE_PASSTHROUGH)
{
if (window->mousePassthrough == value)
return;
window->mousePassthrough = value;
_glfwPlatformSetWindowMousePassthrough(window, value);
}

View File

@ -88,6 +88,14 @@ static void outputHandleDone(void* data, struct wl_output* output)
{
struct _GLFWmonitor *monitor = data;
if (monitor->widthMM <= 0 || monitor->heightMM <= 0)
{
// If Wayland does not provide a physical size, assume the default 96 DPI
const GLFWvidmode* mode = &monitor->modes[monitor->wl.currentMode];
monitor->widthMM = (int) (mode->width * 25.4f / 96.f);
monitor->heightMM = (int) (mode->height * 25.4f / 96.f);
}
_glfwInputMonitor(monitor, GLFW_CONNECTED, _GLFW_INSERT_LAST);
}

View File

@ -246,10 +246,10 @@ static void createDecorations(_GLFWwindow* window)
static void destroyDecoration(_GLFWdecorationWayland* decoration)
{
if (decoration->surface)
wl_surface_destroy(decoration->surface);
if (decoration->subsurface)
wl_subsurface_destroy(decoration->subsurface);
if (decoration->surface)
wl_surface_destroy(decoration->surface);
if (decoration->viewport)
wp_viewport_destroy(decoration->viewport);
decoration->surface = NULL;
@ -1242,26 +1242,39 @@ int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape)
const char* name = NULL;
// Try the XDG names first
if (shape == GLFW_ARROW_CURSOR)
name = "default";
else if (shape == GLFW_IBEAM_CURSOR)
name = "text";
else if (shape == GLFW_CROSSHAIR_CURSOR)
name = "crosshair";
else if (shape == GLFW_POINTING_HAND_CURSOR)
name = "pointer";
else if (shape == GLFW_RESIZE_EW_CURSOR)
name = "ew-resize";
else if (shape == GLFW_RESIZE_NS_CURSOR)
name = "ns-resize";
else if (shape == GLFW_RESIZE_NWSE_CURSOR)
name = "nwse-resize";
else if (shape == GLFW_RESIZE_NESW_CURSOR)
name = "nesw-resize";
else if (shape == GLFW_RESIZE_ALL_CURSOR)
name = "all-scroll";
else if (shape == GLFW_NOT_ALLOWED_CURSOR)
name = "not-allowed";
switch (shape)
{
case GLFW_ARROW_CURSOR:
name = "default";
break;
case GLFW_IBEAM_CURSOR:
name = "text";
break;
case GLFW_CROSSHAIR_CURSOR:
name = "crosshair";
break;
case GLFW_POINTING_HAND_CURSOR:
name = "pointer";
break;
case GLFW_RESIZE_EW_CURSOR:
name = "ew-resize";
break;
case GLFW_RESIZE_NS_CURSOR:
name = "ns-resize";
break;
case GLFW_RESIZE_NWSE_CURSOR:
name = "nwse-resize";
break;
case GLFW_RESIZE_NESW_CURSOR:
name = "nesw-resize";
break;
case GLFW_RESIZE_ALL_CURSOR:
name = "all-scroll";
break;
case GLFW_NOT_ALLOWED_CURSOR:
name = "not-allowed";
break;
}
cursor->wl.cursor = wl_cursor_theme_get_cursor(_glfw.wl.cursorTheme, name);
@ -1274,25 +1287,26 @@ int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape)
if (!cursor->wl.cursor)
{
// Fall back to the core X11 names
if (shape == GLFW_ARROW_CURSOR)
name = "left_ptr";
else if (shape == GLFW_IBEAM_CURSOR)
name = "xterm";
else if (shape == GLFW_CROSSHAIR_CURSOR)
name = "crosshair";
else if (shape == GLFW_POINTING_HAND_CURSOR)
name = "hand2";
else if (shape == GLFW_RESIZE_EW_CURSOR)
name = "sb_h_double_arrow";
else if (shape == GLFW_RESIZE_NS_CURSOR)
name = "sb_v_double_arrow";
else if (shape == GLFW_RESIZE_ALL_CURSOR)
name = "fleur";
else
switch (shape)
{
_glfwInputError(GLFW_CURSOR_UNAVAILABLE,
"Wayland: Standard cursor shape unavailable");
return GLFW_FALSE;
case GLFW_ARROW_CURSOR:
name = "left_ptr";
case GLFW_IBEAM_CURSOR:
name = "xterm";
case GLFW_CROSSHAIR_CURSOR:
name = "crosshair";
case GLFW_POINTING_HAND_CURSOR:
name = "hand2";
case GLFW_RESIZE_EW_CURSOR:
name = "sb_h_double_arrow";
case GLFW_RESIZE_NS_CURSOR:
name = "sb_v_double_arrow";
case GLFW_RESIZE_ALL_CURSOR:
name = "fleur";
default:
_glfwInputError(GLFW_CURSOR_UNAVAILABLE,
"Wayland: Standard cursor shape unavailable");
return GLFW_FALSE;
}
cursor->wl.cursor = wl_cursor_theme_get_cursor(_glfw.wl.cursorTheme, name);

View File

@ -2485,7 +2485,11 @@ void _glfwPlatformSetWindowMonitor(_GLFWwindow* window,
}
if (window->monitor)
{
_glfwPlatformSetWindowDecorated(window, window->decorated);
_glfwPlatformSetWindowFloating(window, window->floating);
releaseMonitor(window);
}
_glfwInputWindowMonitor(window, monitor);
updateNormalHints(window, width, height);
@ -2935,26 +2939,39 @@ int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape)
const int size = XcursorGetDefaultSize(_glfw.x11.display);
const char* name = NULL;
if (shape == GLFW_ARROW_CURSOR)
name = "default";
else if (shape == GLFW_IBEAM_CURSOR)
name = "text";
else if (shape == GLFW_CROSSHAIR_CURSOR)
name = "crosshair";
else if (shape == GLFW_POINTING_HAND_CURSOR)
name = "pointer";
else if (shape == GLFW_RESIZE_EW_CURSOR)
name = "ew-resize";
else if (shape == GLFW_RESIZE_NS_CURSOR)
name = "ns-resize";
else if (shape == GLFW_RESIZE_NWSE_CURSOR)
name = "nwse-resize";
else if (shape == GLFW_RESIZE_NESW_CURSOR)
name = "nesw-resize";
else if (shape == GLFW_RESIZE_ALL_CURSOR)
name = "all-scroll";
else if (shape == GLFW_NOT_ALLOWED_CURSOR)
name = "not-allowed";
switch (shape)
{
case GLFW_ARROW_CURSOR:
name = "default";
break;
case GLFW_IBEAM_CURSOR:
name = "text";
break;
case GLFW_CROSSHAIR_CURSOR:
name = "crosshair";
break;
case GLFW_POINTING_HAND_CURSOR:
name = "pointer";
break;
case GLFW_RESIZE_EW_CURSOR:
name = "ew-resize";
break;
case GLFW_RESIZE_NS_CURSOR:
name = "ns-resize";
break;
case GLFW_RESIZE_NWSE_CURSOR:
name = "nwse-resize";
break;
case GLFW_RESIZE_NESW_CURSOR:
name = "nesw-resize";
break;
case GLFW_RESIZE_ALL_CURSOR:
name = "all-scroll";
break;
case GLFW_NOT_ALLOWED_CURSOR:
name = "not-allowed";
break;
}
XcursorImage* image = XcursorLibraryLoadImage(name, theme, size);
if (image)
@ -2969,25 +2986,33 @@ int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape)
{
unsigned int native = 0;
if (shape == GLFW_ARROW_CURSOR)
native = XC_left_ptr;
else if (shape == GLFW_IBEAM_CURSOR)
native = XC_xterm;
else if (shape == GLFW_CROSSHAIR_CURSOR)
native = XC_crosshair;
else if (shape == GLFW_POINTING_HAND_CURSOR)
native = XC_hand2;
else if (shape == GLFW_RESIZE_EW_CURSOR)
native = XC_sb_h_double_arrow;
else if (shape == GLFW_RESIZE_NS_CURSOR)
native = XC_sb_v_double_arrow;
else if (shape == GLFW_RESIZE_ALL_CURSOR)
native = XC_fleur;
else
switch (shape)
{
_glfwInputError(GLFW_CURSOR_UNAVAILABLE,
"X11: Standard cursor shape unavailable");
return GLFW_FALSE;
case GLFW_ARROW_CURSOR:
native = XC_left_ptr;
break;
case GLFW_IBEAM_CURSOR:
native = XC_xterm;
break;
case GLFW_CROSSHAIR_CURSOR:
native = XC_crosshair;
break;
case GLFW_POINTING_HAND_CURSOR:
native = XC_hand2;
break;
case GLFW_RESIZE_EW_CURSOR:
native = XC_sb_h_double_arrow;
break;
case GLFW_RESIZE_NS_CURSOR:
native = XC_sb_v_double_arrow;
break;
case GLFW_RESIZE_ALL_CURSOR:
native = XC_fleur;
break;
default:
_glfwInputError(GLFW_CURSOR_UNAVAILABLE,
"X11: Standard cursor shape unavailable");
return GLFW_FALSE;
}
cursor->x11.handle = XCreateFontCursor(_glfw.x11.display, native);

View File

@ -70,150 +70,54 @@ static GLADapiproc glad_vulkan_callback(const char* name, void* user)
return glfwGetInstanceProcAddress((VkInstance) user, name);
}
static const char fragShaderCode[] = {
0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x08, 0x00,
0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00,
0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00,
0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30,
0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00,
0x09, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00,
0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00,
0x02, 0x00, 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, 0x04, 0x00, 0x09, 0x00,
0x47, 0x4c, 0x5f, 0x41, 0x52, 0x42, 0x5f, 0x73, 0x65, 0x70, 0x61, 0x72,
0x61, 0x74, 0x65, 0x5f, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x6f,
0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x00, 0x00, 0x04, 0x00, 0x09, 0x00,
0x47, 0x4c, 0x5f, 0x41, 0x52, 0x42, 0x5f, 0x73, 0x68, 0x61, 0x64, 0x69,
0x6e, 0x67, 0x5f, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x5f,
0x34, 0x32, 0x30, 0x70, 0x61, 0x63, 0x6b, 0x00, 0x05, 0x00, 0x04, 0x00,
0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x05, 0x00, 0x09, 0x00, 0x00, 0x00, 0x75, 0x46, 0x72, 0x61,
0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00,
0x0d, 0x00, 0x00, 0x00, 0x74, 0x65, 0x78, 0x00, 0x05, 0x00, 0x05, 0x00,
0x11, 0x00, 0x00, 0x00, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64,
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00,
0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
0x0d, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x47, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x11, 0x00, 0x00, 0x00,
0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00,
0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00,
0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
0x08, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
0x3b, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00,
0x03, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x0a, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x0b, 0x00, 0x00, 0x00,
0x0a, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00,
0x0c, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x17, 0x00, 0x04, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00,
0x10, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00,
0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00,
0x0e, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
0x0f, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00,
0x57, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
0x0e, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00,
0x09, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00,
0x38, 0x00, 0x01, 0x00
static const uint32_t fragShaderCode[] = {
0x07230203,0x00010000,0x00080007,0x00000014,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000009,0x00000011,0x00030010,
0x00000004,0x00000007,0x00030003,0x00000002,0x00000190,0x00090004,0x415f4c47,0x735f4252,
0x72617065,0x5f657461,0x64616873,0x6f5f7265,0x63656a62,0x00007374,0x00090004,0x415f4c47,
0x735f4252,0x69646168,0x6c5f676e,0x75676e61,0x5f656761,0x70303234,0x006b6361,0x00040005,
0x00000004,0x6e69616d,0x00000000,0x00050005,0x00000009,0x61724675,0x6c6f4367,0x0000726f,
0x00030005,0x0000000d,0x00786574,0x00050005,0x00000011,0x63786574,0x64726f6f,0x00000000,
0x00040047,0x00000009,0x0000001e,0x00000000,0x00040047,0x0000000d,0x00000022,0x00000000,
0x00040047,0x0000000d,0x00000021,0x00000000,0x00040047,0x00000011,0x0000001e,0x00000000,
0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,0x00000020,
0x00040017,0x00000007,0x00000006,0x00000004,0x00040020,0x00000008,0x00000003,0x00000007,
0x0004003b,0x00000008,0x00000009,0x00000003,0x00090019,0x0000000a,0x00000006,0x00000001,
0x00000000,0x00000000,0x00000000,0x00000001,0x00000000,0x0003001b,0x0000000b,0x0000000a,
0x00040020,0x0000000c,0x00000000,0x0000000b,0x0004003b,0x0000000c,0x0000000d,0x00000000,
0x00040017,0x0000000f,0x00000006,0x00000002,0x00040020,0x00000010,0x00000001,0x0000000f,
0x0004003b,0x00000010,0x00000011,0x00000001,0x00050036,0x00000002,0x00000004,0x00000000,
0x00000003,0x000200f8,0x00000005,0x0004003d,0x0000000b,0x0000000e,0x0000000d,0x0004003d,
0x0000000f,0x00000012,0x00000011,0x00050057,0x00000007,0x00000013,0x0000000e,0x00000012,
0x0003003e,0x00000009,0x00000013,0x000100fd,0x00010038
};
static const char vertShaderCode[] = {
0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x08, 0x00,
0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00,
0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00,
0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30,
0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00,
0x09, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
0x17, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00,
0x03, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x01, 0x00, 0x00,
0x04, 0x00, 0x09, 0x00, 0x47, 0x4c, 0x5f, 0x41, 0x52, 0x42, 0x5f, 0x73,
0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x68, 0x61, 0x64,
0x65, 0x72, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x00, 0x00,
0x04, 0x00, 0x09, 0x00, 0x47, 0x4c, 0x5f, 0x41, 0x52, 0x42, 0x5f, 0x73,
0x68, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x61, 0x6e, 0x67, 0x75,
0x61, 0x67, 0x65, 0x5f, 0x34, 0x32, 0x30, 0x70, 0x61, 0x63, 0x6b, 0x00,
0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e,
0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x09, 0x00, 0x00, 0x00,
0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72,
0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x11, 0x00, 0x00, 0x00,
0x67, 0x6c, 0x5f, 0x50, 0x65, 0x72, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78,
0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x11, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74,
0x69, 0x6f, 0x6e, 0x00, 0x06, 0x00, 0x07, 0x00, 0x11, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x69, 0x6e, 0x74,
0x53, 0x69, 0x7a, 0x65, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x07, 0x00,
0x11, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x43,
0x6c, 0x69, 0x70, 0x44, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x00,
0x05, 0x00, 0x03, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x03, 0x00, 0x17, 0x00, 0x00, 0x00, 0x70, 0x6f, 0x73, 0x00,
0x05, 0x00, 0x05, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x56,
0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x44, 0x00, 0x05, 0x00, 0x06, 0x00,
0x1d, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x49, 0x6e, 0x73, 0x74, 0x61,
0x6e, 0x63, 0x65, 0x49, 0x44, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
0x09, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x47, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x11, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x48, 0x00, 0x05, 0x00, 0x11, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x0b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00,
0x11, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00,
0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x11, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x17, 0x00, 0x00, 0x00,
0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
0x1c, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
0x47, 0x00, 0x04, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00,
0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x17, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00,
0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00,
0x08, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
0x20, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x00, 0x00,
0x0b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00,
0x0d, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x15, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00,
0x0f, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, 0x00,
0x10, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00,
0x1e, 0x00, 0x05, 0x00, 0x11, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
0x12, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00,
0x3b, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
0x03, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00,
0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00,
0x14, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x20, 0x00, 0x04, 0x00, 0x16, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x16, 0x00, 0x00, 0x00,
0x17, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
0x19, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00,
0x20, 0x00, 0x04, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x14, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x1b, 0x00, 0x00, 0x00,
0x1c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00,
0x1b, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00,
0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00,
0x0c, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00,
0x09, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
0x0d, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00,
0x41, 0x00, 0x05, 0x00, 0x19, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00,
0x13, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00,
0x1a, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00,
0x38, 0x00, 0x01, 0x00
static const uint32_t vertShaderCode[] = {
0x07230203,0x00010000,0x00080007,0x00000018,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x0009000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x00000009,0x0000000b,0x00000010,
0x00000014,0x00030003,0x00000002,0x00000190,0x00090004,0x415f4c47,0x735f4252,0x72617065,
0x5f657461,0x64616873,0x6f5f7265,0x63656a62,0x00007374,0x00090004,0x415f4c47,0x735f4252,
0x69646168,0x6c5f676e,0x75676e61,0x5f656761,0x70303234,0x006b6361,0x00040005,0x00000004,
0x6e69616d,0x00000000,0x00050005,0x00000009,0x63786574,0x64726f6f,0x00000000,0x00040005,
0x0000000b,0x72747461,0x00000000,0x00060005,0x0000000e,0x505f6c67,0x65567265,0x78657472,
0x00000000,0x00060006,0x0000000e,0x00000000,0x505f6c67,0x7469736f,0x006e6f69,0x00030005,
0x00000010,0x00000000,0x00030005,0x00000014,0x00736f70,0x00040047,0x00000009,0x0000001e,
0x00000000,0x00040047,0x0000000b,0x0000001e,0x00000001,0x00050048,0x0000000e,0x00000000,
0x0000000b,0x00000000,0x00030047,0x0000000e,0x00000002,0x00040047,0x00000014,0x0000001e,
0x00000000,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,
0x00000020,0x00040017,0x00000007,0x00000006,0x00000002,0x00040020,0x00000008,0x00000003,
0x00000007,0x0004003b,0x00000008,0x00000009,0x00000003,0x00040020,0x0000000a,0x00000001,
0x00000007,0x0004003b,0x0000000a,0x0000000b,0x00000001,0x00040017,0x0000000d,0x00000006,
0x00000004,0x0003001e,0x0000000e,0x0000000d,0x00040020,0x0000000f,0x00000003,0x0000000e,
0x0004003b,0x0000000f,0x00000010,0x00000003,0x00040015,0x00000011,0x00000020,0x00000001,
0x0004002b,0x00000011,0x00000012,0x00000000,0x00040020,0x00000013,0x00000001,0x0000000d,
0x0004003b,0x00000013,0x00000014,0x00000001,0x00040020,0x00000016,0x00000003,0x0000000d,
0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003d,
0x00000007,0x0000000c,0x0000000b,0x0003003e,0x00000009,0x0000000c,0x0004003d,0x0000000d,
0x00000015,0x00000014,0x00050041,0x00000016,0x00000017,0x00000010,0x00000012,0x0003003e,
0x00000017,0x00000015,0x000100fd,0x00010038
};
struct texture_object {