diff --git a/.gitignore b/.gitignore index 266019f3..84636a0a 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/.travis.yml b/.travis.yml index c5978469..ff675629 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/CMake/modules/FindWaylandProtocols.cmake b/CMake/modules/FindWaylandProtocols.cmake deleted file mode 100644 index 8eb83f27..00000000 --- a/CMake/modules/FindWaylandProtocols.cmake +++ /dev/null @@ -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}) diff --git a/CMake/modules/FindXKBCommon.cmake b/CMake/modules/FindXKBCommon.cmake deleted file mode 100644 index 0f571eea..00000000 --- a/CMake/modules/FindXKBCommon.cmake +++ /dev/null @@ -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) - diff --git a/CMakeLists.txt b/CMakeLists.txt index a3a884b7..39482752 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/README.md b/README.md index 0fde759f..26e88828 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/deps/linmath.h b/deps/linmath.h index 8b2a8c2e..be37caf6 100644 --- a/deps/linmath.h +++ b/deps/linmath.h @@ -1,13 +1,8 @@ #ifndef LINMATH_H #define LINMATH_H +#include #include - -/* 2020-03-02 Camilla Löwy - * - Added inclusion of string.h for memcpy - * - Replaced tan and acos with tanf and acosf - * - Replaced double constants with float equivalents - */ #include #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; ib[i] ? a[i] : b[i]; \ +} \ +LINMATH_H_FUNC void vec##n##_dup(vec##n r, vec##n const src) \ +{ \ + int i; \ + for(i=0; ili:last-child{margin:0 0 0 auto}.contents{min-height:590px}div.contents,div.header{max-width:920px;margin:0 auto;padding:0 32px;background:#fff none}table.doxtable th,table.markdownTable th,dl.reflist dt{background:linear-gradient(to bottom, #ffa733 0, #f60 100%);box-shadow:inset 0 0 32px #f60;text-shadow:0 -1px 1px #b34700;text-align:left;color:#fff}dl.reflist dt a.el{color:#f60;padding:.2em;border-radius:4px;background-color:#ffe0cc}div.toc{float:none;width:auto}div.toc h3{font-size:1.17em}div.toc ul{padding-left:1.5em}div.toc li{font-size:1em;padding-left:0;list-style-type:disc}div.toc,.memproto,div.qindex,div.ah{background:linear-gradient(to bottom, #f2f2f2 0, #e6e6e6 100%);box-shadow:inset 0 0 32px #e6e6e6;text-shadow:0 1px 1px #fff;color:#1a1a1a;border:2px solid #e6e6e6;border-radius:4px}.paramname{color:#803300}dl.reflist dt{border:2px solid #f60;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom:none}dl.reflist dd{border:2px solid #f60;border-bottom-right-radius:4px;border-bottom-left-radius:4px;border-top:none}table.doxtable,table.markdownTable{border-collapse:inherit;border-spacing:0;border:2px solid #f60;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:#f60;text-decoration:none}div.directory{border-collapse:inherit;border-spacing:0;border:2px solid #f60;border-radius:4px}hr,.memSeparator{height:2px;background:linear-gradient(to right, #f2f2f2 0, #d9d9d9 50%, #f2f2f2 100%)}dl.note,dl.pre,dl.post,dl.invariant{background:linear-gradient(to bottom, #ddfad1 0, #cbf7ba 100%);box-shadow:inset 0 0 32px #baf5a3;color:#1e5309;border:2px solid #afe599}dl.warning,dl.attention{background:linear-gradient(to bottom, #fae8d1 0, #f7ddba 100%);box-shadow:inset 0 0 32px #f5d1a3;color:#533309;border:2px solid #e5c499}dl.deprecated,dl.bug{background:linear-gradient(to bottom, #fad1e3 0, #f7bad6 100%);box-shadow:inset 0 0 32px #f5a3c8;color:#53092a;border:2px solid #e599bb}dl.todo,dl.test{background:linear-gradient(to bottom, #d1ecfa 0, #bae3f7 100%);box-shadow:inset 0 0 32px #a3daf5;color:#093a53;border:2px solid #99cce5}dl.note,dl.pre,dl.post,dl.invariant,dl.warning,dl.attention,dl.deprecated,dl.bug,dl.todo,dl.test{border-radius:4px;padding:1em;text-shadow:0 1px 1px #fff;margin:1em 0}.note a,.pre a,.post a,.invariant a,.warning a,.attention a,.deprecated a,.bug a,.todo a,.test a,.note a:visited,.pre a:visited,.post a:visited,.invariant a:visited,.warning a:visited,.attention a:visited,.deprecated a:visited,.bug a:visited,.todo a:visited,.test a:visited{color:inherit}div.line{line-height:inherit}div.fragment,pre.fragment{background:#f2f2f2;border-radius:4px;border:none;padding:1em;overflow:auto;border-left:4px solid #ccc;margin:1em 0}.lineno a,.lineno a:visited,.line,pre.fragment{color:#4d4d4d}span.preprocessor,span.comment{color:#007899}a.code,a.code:visited{color:#e64500}span.keyword,span.keywordtype,span.keywordflow{color:#404040;font-weight:bold}span.stringliteral{color:#360099}code{padding:.1em;border-radius:4px} +.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}.sm-dox a span.sub-arrow{border-color:#f2f2f2 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:#f60 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 #f60}.sm-dox ul a:hover{background:#666;text-shadow:none}.sm-dox ul.sm-nowrap a{color:#4d4d4d;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{background:none}#titlearea,.footer,.contents,div.header,.memdoc,table.doxtable td,table.doxtable th,table.markdownTable td,table.markdownTable th,hr,.memSeparator{border:none}#main-menu a,#main-menu a:visited,#main-menu a:hover,#main-menu li,.reflist dt a.el,.levels span,.directory .levels span{text-shadow:none}.memdoc,dl.reflist dd{box-shadow:none}div.headertitle,.note code,.pre code,.post code,.invariant code,.warning code,.attention code,.deprecated code,.bug code,.todo code,.test code,table.doxtable code,table.markdownTable code{padding:0}#nav-path,.directory .levels,span.lineno{display:none}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:#f2f2f2}body{color:#4d4d4d}h1,h2,h2.groupheader,h3,div.toc h3,h4,h5,h6,strong,em{color:#1a1a1a;border-bottom:none}h1{padding-top:.5em;font-size:180%}h2{padding-top:.5em;margin-bottom:0;font-size:140%}h3{padding-top:.5em;margin-bottom:0;font-size:110%}.glfwheader{font-size:16px;min-height:64px;max-width:920px;padding:0 32px;margin:0 auto;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start;align-items:center;align-content:stretch}#glfwhome{line-height:64px;padding-right:48px;color:#666;font-size:2.5em;background:url("https://www.glfw.org/css/arrow.png") no-repeat right}.glfwnavbar{list-style-type:none;margin:0 0 0 auto;float:right}#glfwhome,.glfwnavbar li{float:left}.glfwnavbar a,.glfwnavbar a:visited{line-height:64px;margin-left:2em;display:block;color:#666}.glfwnavbar{padding-left:0}#glfwhome,.glfwnavbar a,.glfwnavbar a:visited{transition:.35s ease}#titlearea,.footer{color:#666}address.footer{text-align:center;padding:2em;margin-top:3em}#top{background:#666}#main-nav{max-width:960px;margin:0 auto;font-size:13px}#main-menu{max-width:920px;margin:0 auto;font-size:13px}.memtitle{display:none}.memproto,.memname{font-weight:bold;text-shadow:none}#main-menu{min-height:36px;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start;align-items:center;align-content:stretch}#main-menu a,#main-menu a:visited,#main-menu a:hover,#main-menu li{color:#f2f2f2}#main-menu li ul.sm-nowrap li a{color:#4d4d4d}#main-menu li ul.sm-nowrap li a:hover{color:#f60}#main-menu>li:last-child{margin:0 0 0 auto}.contents{min-height:590px}div.contents,div.header{max-width:920px;margin:0 auto;padding:0 32px;background:#fff none}table.doxtable th,table.markdownTable th,dl.reflist dt{background:linear-gradient(to bottom, #ffa733 0%, #ff6600 100%);box-shadow:inset 0 0 32px #f60;text-shadow:0 -1px 1px #b34700;text-align:left;color:#fff}dl.reflist dt a.el{color:#f60;padding:.2em;border-radius:4px;background-color:#ffe0cc}div.toc{float:none;width:auto}div.toc h3{font-size:1.17em}div.toc ul{padding-left:1.5em}div.toc li{font-size:1em;padding-left:0;list-style-type:disc}div.toc,.memproto,div.qindex,div.ah{background:linear-gradient(to bottom, #f2f2f2 0%, #e6e6e6 100%);box-shadow:inset 0 0 32px #e6e6e6;text-shadow:0 1px 1px #fff;color:#1a1a1a;border:2px solid #e6e6e6;border-radius:4px}.paramname{color:#803300}dl.reflist dt{border:2px solid #f60;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom:none}dl.reflist dd{border:2px solid #f60;border-bottom-right-radius:4px;border-bottom-left-radius:4px;border-top:none}table.doxtable,table.markdownTable{border-collapse:inherit;border-spacing:0;border:2px solid #f60;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:#f60;text-decoration:none}div.directory{border-collapse:inherit;border-spacing:0;border:2px solid #f60;border-radius:4px}hr,.memSeparator{height:2px;background:linear-gradient(to right, #f2f2f2 0%, #d9d9d9 50%, #f2f2f2 100%)}dl.note,dl.pre,dl.post,dl.invariant{background:linear-gradient(to bottom, #ddfad1 0%, #cbf7ba 100%);box-shadow:inset 0 0 32px #baf5a3;color:#1e5309;border:2px solid #afe699}dl.warning,dl.attention{background:linear-gradient(to bottom, #fae8d1 0%, #f7ddba 100%);box-shadow:inset 0 0 32px #f5d1a3;color:#533309;border:2px solid #e6c499}dl.deprecated,dl.bug{background:linear-gradient(to bottom, #fad1e3 0%, #f7bad6 100%);box-shadow:inset 0 0 32px #f5a3c8;color:#53092a;border:2px solid #e699bb}dl.todo,dl.test{background:linear-gradient(to bottom, #d1ecfa 0%, #bae3f7 100%);box-shadow:inset 0 0 32px #a3daf5;color:#093a53;border:2px solid #99cce6}dl.note,dl.pre,dl.post,dl.invariant,dl.warning,dl.attention,dl.deprecated,dl.bug,dl.todo,dl.test{border-radius:4px;padding:1em;text-shadow:0 1px 1px #fff;margin:1em 0}.note a,.pre a,.post a,.invariant a,.warning a,.attention a,.deprecated a,.bug a,.todo a,.test a,.note a:visited,.pre a:visited,.post a:visited,.invariant a:visited,.warning a:visited,.attention a:visited,.deprecated a:visited,.bug a:visited,.todo a:visited,.test a:visited{color:inherit}div.line{line-height:inherit}div.fragment,pre.fragment{background:#f2f2f2;border-radius:4px;border:none;padding:1em;overflow:auto;border-left:4px solid #ccc;margin:1em 0}.lineno a,.lineno a:visited,.line,pre.fragment{color:#4d4d4d}span.preprocessor,span.comment{color:#007899}a.code,a.code:visited{color:#e64500}span.keyword,span.keywordtype,span.keywordflow{color:#404040;font-weight:bold}span.stringliteral{color:#360099}code{padding:.1em;border-radius:4px}/*# sourceMappingURL=extra.css.map */ diff --git a/docs/extra.css.map b/docs/extra.css.map new file mode 100644 index 00000000..7d10c5e2 --- /dev/null +++ b/docs/extra.css.map @@ -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"} \ No newline at end of file diff --git a/docs/extra.less b/docs/extra.scss similarity index 64% rename from docs/extra.less rename to docs/extra.scss index 8972c113..6c5f3c25 100644 --- a/docs/extra.less +++ b/docs/extra.scss @@ -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; } diff --git a/docs/vulkan.dox b/docs/vulkan.dox index 2585c2bb..68e3d5fe 100644 --- a/docs/vulkan.dox +++ b/docs/vulkan.dox @@ -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. diff --git a/include/GLFW/glfw3.h b/include/GLFW/glfw3.h index 18c186c0..6540cf38 100644 --- a/include/GLFW/glfw3.h +++ b/include/GLFW/glfw3.h @@ -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 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2f2bdd88..2e6a1fa2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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) diff --git a/src/cocoa_init.m b/src/cocoa_init.m index 7cad8b8e..626d95c2 100644 --- a/src/cocoa_init.m +++ b/src/cocoa_init.m @@ -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 diff --git a/src/cocoa_monitor.m b/src/cocoa_monitor.m index 2bb83738..8eb3f70d 100644 --- a/src/cocoa_monitor.m +++ b/src/cocoa_monitor.m @@ -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)++; diff --git a/src/cocoa_window.m b/src/cocoa_window.m index dc3161e7..936779f0 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -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) diff --git a/src/internal.h b/src/internal.h index a30e98ee..72cf15be 100644 --- a/src/internal.h +++ b/src/internal.h @@ -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 diff --git a/src/win32_init.c b/src/win32_init.c index f6995e51..970da06e 100644 --- a/src/win32_init.c +++ b/src/win32_init.c @@ -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" diff --git a/src/win32_monitor.c b/src/win32_monitor.c index 5f91c579..b4c53e4c 100644 --- a/src/win32_monitor.c +++ b/src/win32_monitor.c @@ -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; } } diff --git a/src/win32_platform.h b/src/win32_platform.h index 260a77ff..6c81d4b5 100644 --- a/src/win32_platform.h +++ b/src/win32_platform.h @@ -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 diff --git a/src/win32_window.c b/src/win32_window.c index 30d9b444..83af4103 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -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, diff --git a/src/window.c b/src/window.c index efcb4125..d2196e2f 100644 --- a/src/window.c +++ b/src/window.c @@ -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); } diff --git a/src/wl_monitor.c b/src/wl_monitor.c index a6356de0..d722beaa 100644 --- a/src/wl_monitor.c +++ b/src/wl_monitor.c @@ -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); } diff --git a/src/wl_window.c b/src/wl_window.c index 2e0d18a7..c077bd1c 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -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); diff --git a/src/x11_window.c b/src/x11_window.c index f7455785..6e155a00 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -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); diff --git a/tests/triangle-vulkan.c b/tests/triangle-vulkan.c index 33442968..7f783694 100644 --- a/tests/triangle-vulkan.c +++ b/tests/triangle-vulkan.c @@ -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 {