mirror of
https://github.com/glfw/glfw.git
synced 2026-09-19 23:43:15 +00:00
Compare commits
101 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 814b7929c5 | |||
| b39c02b118 | |||
| 0f46d089e8 | |||
| b8202d9ca3 | |||
| 901d30b973 | |||
| 0c22ebac36 | |||
| 900dda7e89 | |||
| 56230ca173 | |||
| c6fa2c8cfb | |||
| 860d9deceb | |||
| 5a15d8a784 | |||
| 8270081334 | |||
| 15b0c43e2d | |||
| 903c0ebfd1 | |||
| 8746f68d61 | |||
| 14921d1e24 | |||
| eda12dd949 | |||
| 01c362ba37 | |||
| 078e8fcf55 | |||
| be56132c02 | |||
| 294b08dcc8 | |||
| cdd5ee8d36 | |||
| 0d7acffd47 | |||
| edb6f674cd | |||
| b31d7ddc8c | |||
| baf26a6ea7 | |||
| 395ab660d5 | |||
| 7dee4e05f9 | |||
| e0b3361683 | |||
| 0b56adb721 | |||
| db66a0f028 | |||
| 0a16464f5e | |||
| 5e807a029b | |||
| 41ad058ce3 | |||
| 214c76a3ad | |||
| c3250be690 | |||
| e341080489 | |||
| 77dffb341b | |||
| cb8aee8437 | |||
| bbc4caf04c | |||
| c0704e4a63 | |||
| 92f80daf4a | |||
| 111c8ecea6 | |||
| 7728a6a3aa | |||
| 0ab31db9c0 | |||
| 8363179eee | |||
| b8a6254a26 | |||
| 2a5ac9a6d6 | |||
| 114704262c | |||
| bd2fb9ebaf | |||
| 85a169ff50 | |||
| 539f4bdca2 | |||
| 606c0fc03e | |||
| d858e48860 | |||
| e6646c8508 | |||
| 9cae95faa3 | |||
| 26aaa007e0 | |||
| f921caf4a6 | |||
| 9aefb67358 | |||
| 1730184971 | |||
| 325b4186d3 | |||
| 92c6209530 | |||
| 307ce3aa1a | |||
| d7b67a2eb4 | |||
| 5dbca2e2c9 | |||
| 63af05c419 | |||
| e336288eeb | |||
| fb0c8d4662 | |||
| 78ad4e8f36 | |||
| 37a86f24f0 | |||
| 11e5102d83 | |||
| a8e5c530ee | |||
| 8b63ca53de | |||
| ca2cd2f796 | |||
| 0a7c24e48c | |||
| 48bc089e9e | |||
| 3df4ebeaac | |||
| dff64496d6 | |||
| 117f7694b2 | |||
| d0c0997528 | |||
| e145d89a96 | |||
| 10c01512f2 | |||
| 8216a148cf | |||
| 6e01359e36 | |||
| 404c28df3d | |||
| b0c79896a3 | |||
| 4aaf8ba1d2 | |||
| cf87e6549c | |||
| 27d7fc098d | |||
| ec5610deda | |||
| b25ee390c1 | |||
| a6d022c257 | |||
| 2d4c4b7949 | |||
| aee62d3c16 | |||
| c4b4476d78 | |||
| 0ac013381b | |||
| d99249337e | |||
| 750b1c5365 | |||
| 1d711057a1 | |||
| 3604cc72fc | |||
| 64c7aa50d0 |
+27
-19
@@ -9,7 +9,6 @@ matrix:
|
|||||||
include:
|
include:
|
||||||
- os: linux
|
- os: linux
|
||||||
dist: xenial
|
dist: xenial
|
||||||
sudo: false
|
|
||||||
name: "X11 shared library"
|
name: "X11 shared library"
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
@@ -23,7 +22,6 @@ matrix:
|
|||||||
- CFLAGS=-Werror
|
- CFLAGS=-Werror
|
||||||
- os: linux
|
- os: linux
|
||||||
dist: xenial
|
dist: xenial
|
||||||
sudo: false
|
|
||||||
name: "X11 static library"
|
name: "X11 static library"
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
@@ -36,15 +34,13 @@ matrix:
|
|||||||
- BUILD_SHARED_LIBS=OFF
|
- BUILD_SHARED_LIBS=OFF
|
||||||
- CFLAGS=-Werror
|
- CFLAGS=-Werror
|
||||||
- os: linux
|
- os: linux
|
||||||
dist: xenial
|
dist: focal
|
||||||
sudo: required
|
|
||||||
name: "Wayland shared library"
|
name: "Wayland shared library"
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources:
|
|
||||||
- ppa:kubuntu-ppa/backports
|
|
||||||
packages:
|
packages:
|
||||||
- extra-cmake-modules
|
- extra-cmake-modules
|
||||||
|
- wayland-protocols
|
||||||
- libwayland-dev
|
- libwayland-dev
|
||||||
- libxkbcommon-dev
|
- libxkbcommon-dev
|
||||||
- libegl1-mesa-dev
|
- libegl1-mesa-dev
|
||||||
@@ -53,15 +49,13 @@ matrix:
|
|||||||
- BUILD_SHARED_LIBS=ON
|
- BUILD_SHARED_LIBS=ON
|
||||||
- CFLAGS=-Werror
|
- CFLAGS=-Werror
|
||||||
- os: linux
|
- os: linux
|
||||||
dist: xenial
|
dist: focal
|
||||||
sudo: required
|
|
||||||
name: "Wayland static library"
|
name: "Wayland static library"
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources:
|
|
||||||
- ppa:kubuntu-ppa/backports
|
|
||||||
packages:
|
packages:
|
||||||
- extra-cmake-modules
|
- extra-cmake-modules
|
||||||
|
- wayland-protocols
|
||||||
- libwayland-dev
|
- libwayland-dev
|
||||||
- libxkbcommon-dev
|
- libxkbcommon-dev
|
||||||
- libegl1-mesa-dev
|
- libegl1-mesa-dev
|
||||||
@@ -69,15 +63,35 @@ matrix:
|
|||||||
- USE_WAYLAND=ON
|
- USE_WAYLAND=ON
|
||||||
- BUILD_SHARED_LIBS=OFF
|
- BUILD_SHARED_LIBS=OFF
|
||||||
- CFLAGS=-Werror
|
- CFLAGS=-Werror
|
||||||
|
- os: linux
|
||||||
|
dist: bionic
|
||||||
|
name: "Null shared library"
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- libosmesa6-dev
|
||||||
|
env:
|
||||||
|
- BUILD_SHARED_LIBS=ON
|
||||||
|
- USE_OSMESA=ON
|
||||||
|
- CFLAGS=-Werror
|
||||||
|
- os: linux
|
||||||
|
dist: bionic
|
||||||
|
name: "Null static library"
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- libosmesa6-dev
|
||||||
|
env:
|
||||||
|
- BUILD_SHARED_LIBS=OFF
|
||||||
|
- USE_OSMESA=ON
|
||||||
|
- CFLAGS=-Werror
|
||||||
- os: osx
|
- os: osx
|
||||||
sudo: false
|
|
||||||
name: "Cocoa shared library"
|
name: "Cocoa shared library"
|
||||||
env:
|
env:
|
||||||
- BUILD_SHARED_LIBS=ON
|
- BUILD_SHARED_LIBS=ON
|
||||||
- CFLAGS=-Werror
|
- CFLAGS=-Werror
|
||||||
- MACOSX_DEPLOYMENT_TARGET=10.8
|
- MACOSX_DEPLOYMENT_TARGET=10.8
|
||||||
- os: osx
|
- os: osx
|
||||||
sudo: false
|
|
||||||
name: "Cocoa static library"
|
name: "Cocoa static library"
|
||||||
env:
|
env:
|
||||||
- BUILD_SHARED_LIBS=OFF
|
- BUILD_SHARED_LIBS=OFF
|
||||||
@@ -90,13 +104,7 @@ script:
|
|||||||
fi
|
fi
|
||||||
- mkdir build
|
- mkdir build
|
||||||
- cd build
|
- cd build
|
||||||
- if test -n "${USE_WAYLAND}"; then
|
- cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} -DGLFW_USE_WAYLAND=${USE_WAYLAND} -DGLFW_USE_OSMESA=${USE_OSMESA} ..
|
||||||
git clone git://anongit.freedesktop.org/wayland/wayland-protocols;
|
|
||||||
pushd wayland-protocols;
|
|
||||||
git checkout 1.15 && ./autogen.sh --prefix=/usr && make && sudo make install;
|
|
||||||
popd;
|
|
||||||
fi
|
|
||||||
- cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} -DGLFW_USE_WAYLAND=${USE_WAYLAND} ..
|
|
||||||
- cmake --build .
|
- cmake --build .
|
||||||
notifications:
|
notifications:
|
||||||
email:
|
email:
|
||||||
|
|||||||
+9
-2
@@ -1,6 +1,6 @@
|
|||||||
cmake_minimum_required(VERSION 3.0)
|
cmake_minimum_required(VERSION 3.0)
|
||||||
|
|
||||||
project(GLFW VERSION 3.3.2 LANGUAGES C)
|
project(GLFW VERSION 3.3.4 LANGUAGES C)
|
||||||
|
|
||||||
set(CMAKE_LEGACY_CYGWIN_WIN32 OFF)
|
set(CMAKE_LEGACY_CYGWIN_WIN32 OFF)
|
||||||
|
|
||||||
@@ -8,6 +8,10 @@ if (POLICY CMP0054)
|
|||||||
cmake_policy(SET CMP0054 NEW)
|
cmake_policy(SET CMP0054 NEW)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (POLICY CMP0069)
|
||||||
|
cmake_policy(SET CMP0069 NEW)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (POLICY CMP0077)
|
if (POLICY CMP0077)
|
||||||
cmake_policy(SET CMP0077 NEW)
|
cmake_policy(SET CMP0077 NEW)
|
||||||
endif()
|
endif()
|
||||||
@@ -128,6 +132,9 @@ if (MINGW)
|
|||||||
if (_GLFW_HAS_64ASLR)
|
if (_GLFW_HAS_64ASLR)
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--high-entropy-va ${CMAKE_SHARED_LINKER_FLAGS}")
|
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--high-entropy-va ${CMAKE_SHARED_LINKER_FLAGS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Clear flags again to avoid breaking later tests
|
||||||
|
set(CMAKE_REQUIRED_FLAGS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
@@ -244,7 +251,7 @@ if (_GLFW_WAYLAND)
|
|||||||
find_package(WaylandScanner REQUIRED)
|
find_package(WaylandScanner REQUIRED)
|
||||||
find_package(WaylandProtocols 1.15 REQUIRED)
|
find_package(WaylandProtocols 1.15 REQUIRED)
|
||||||
|
|
||||||
list(APPEND glfw_PKG_DEPS "wayland-egl")
|
list(APPEND glfw_PKG_DEPS "wayland-client")
|
||||||
|
|
||||||
list(APPEND glfw_INCLUDE_DIRS "${Wayland_INCLUDE_DIRS}")
|
list(APPEND glfw_INCLUDE_DIRS "${Wayland_INCLUDE_DIRS}")
|
||||||
list(APPEND glfw_LIBRARIES "${Wayland_LIBRARIES}" "${CMAKE_THREAD_LIBS_INIT}")
|
list(APPEND glfw_LIBRARIES "${Wayland_LIBRARIES}" "${CMAKE_THREAD_LIBS_INIT}")
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ located in the `deps/` directory.
|
|||||||
functions
|
functions
|
||||||
- [linmath.h](https://github.com/datenwolf/linmath.h) for linear algebra in
|
- [linmath.h](https://github.com/datenwolf/linmath.h) for linear algebra in
|
||||||
examples
|
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
|
- [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
|
The documentation is generated with [Doxygen](http://doxygen.org/) if CMake can
|
||||||
@@ -118,16 +118,8 @@ information on what to include when reporting a bug.
|
|||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
- [Win32] Bugfix: Super key was not released after Win+V hotkey (#1622)
|
- [X11] Bugfix: Some window attributes were not applied on leaving fullscreen
|
||||||
- [Win32] Bugfix: `glfwGetKeyName` could access out of bounds and return an
|
(#1863)
|
||||||
invalid pointer
|
|
||||||
- [Win32] Bugfix: Some synthetic key events were reported as `GLFW_KEY_UNKNOWN`
|
|
||||||
(#1623)
|
|
||||||
- [Cocoa] Added support for `VK_EXT_metal_surface` (#1619)
|
|
||||||
- [Cocoa] Added locating the Vulkan loader at runtime in an application bundle
|
|
||||||
- [X11] Bugfix: `glfwFocusWindow` could terminate on older WMs or without a WM
|
|
||||||
- [X11] Bugfix: Creating an undecorated window could fail with BadMatch (#1620)
|
|
||||||
- [X11] Bugfix: Querying a disconnected monitor could segfault (#1602)
|
|
||||||
|
|
||||||
|
|
||||||
## Contact
|
## Contact
|
||||||
@@ -153,13 +145,16 @@ GLFW exists because people around the world donated their time and lent their
|
|||||||
skills.
|
skills.
|
||||||
|
|
||||||
- Bobyshev Alexander
|
- Bobyshev Alexander
|
||||||
|
- Laurent Aphecetche
|
||||||
- Matt Arsenault
|
- Matt Arsenault
|
||||||
|
- ashishgamedev
|
||||||
- David Avedissian
|
- David Avedissian
|
||||||
- Keith Bauer
|
- Keith Bauer
|
||||||
- John Bartholomew
|
- John Bartholomew
|
||||||
- Coşku Baş
|
- Coşku Baş
|
||||||
- Niklas Behrens
|
- Niklas Behrens
|
||||||
- Andrew Belt
|
- Andrew Belt
|
||||||
|
- Nevyn Bengtsson
|
||||||
- Niklas Bergström
|
- Niklas Bergström
|
||||||
- Denis Bernard
|
- Denis Bernard
|
||||||
- Doug Binks
|
- Doug Binks
|
||||||
@@ -168,6 +163,7 @@ skills.
|
|||||||
- Rok Breulj
|
- Rok Breulj
|
||||||
- Kai Burjack
|
- Kai Burjack
|
||||||
- Martin Capitanio
|
- Martin Capitanio
|
||||||
|
- Nicolas Caramelli
|
||||||
- David Carlier
|
- David Carlier
|
||||||
- Arturo Castro
|
- Arturo Castro
|
||||||
- Chi-kwan Chan
|
- Chi-kwan Chan
|
||||||
@@ -206,6 +202,7 @@ skills.
|
|||||||
- Eloi Marín Gratacós
|
- Eloi Marín Gratacós
|
||||||
- Stefan Gustavson
|
- Stefan Gustavson
|
||||||
- Jonathan Hale
|
- Jonathan Hale
|
||||||
|
- hdf89shfdfs
|
||||||
- Sylvain Hellegouarch
|
- Sylvain Hellegouarch
|
||||||
- Matthew Henry
|
- Matthew Henry
|
||||||
- heromyth
|
- heromyth
|
||||||
@@ -230,11 +227,13 @@ skills.
|
|||||||
- Konstantin Käfer
|
- Konstantin Käfer
|
||||||
- Eric Larson
|
- Eric Larson
|
||||||
- Francis Lecavalier
|
- Francis Lecavalier
|
||||||
|
- Jong Won Lee
|
||||||
- Robin Leffmann
|
- Robin Leffmann
|
||||||
- Glenn Lewis
|
- Glenn Lewis
|
||||||
- Shane Liesegang
|
- Shane Liesegang
|
||||||
- Anders Lindqvist
|
- Anders Lindqvist
|
||||||
- Leon Linhart
|
- Leon Linhart
|
||||||
|
- Marco Lizza
|
||||||
- Eyal Lotem
|
- Eyal Lotem
|
||||||
- Aaron Loucks
|
- Aaron Loucks
|
||||||
- Luflosi
|
- Luflosi
|
||||||
@@ -266,6 +265,7 @@ skills.
|
|||||||
- ndogxj
|
- ndogxj
|
||||||
- Kristian Nielsen
|
- Kristian Nielsen
|
||||||
- Kamil Nowakowski
|
- Kamil Nowakowski
|
||||||
|
- onox
|
||||||
- Denis Ovod
|
- Denis Ovod
|
||||||
- Ozzy
|
- Ozzy
|
||||||
- Andri Pálsson
|
- Andri Pálsson
|
||||||
@@ -273,6 +273,7 @@ skills.
|
|||||||
- Braden Pellett
|
- Braden Pellett
|
||||||
- Christopher Pelloux
|
- Christopher Pelloux
|
||||||
- Arturo J. Pérez
|
- Arturo J. Pérez
|
||||||
|
- Vladimir Perminov
|
||||||
- Anthony Pesch
|
- Anthony Pesch
|
||||||
- Orson Peters
|
- Orson Peters
|
||||||
- Emmanuel Gil Peyrot
|
- Emmanuel Gil Peyrot
|
||||||
@@ -290,8 +291,10 @@ skills.
|
|||||||
- Eddie Ringle
|
- Eddie Ringle
|
||||||
- Max Risuhin
|
- Max Risuhin
|
||||||
- Jorge Rodriguez
|
- Jorge Rodriguez
|
||||||
|
- Luca Rood
|
||||||
- Ed Ropple
|
- Ed Ropple
|
||||||
- Aleksey Rybalkin
|
- Aleksey Rybalkin
|
||||||
|
- Mikko Rytkönen
|
||||||
- Riku Salminen
|
- Riku Salminen
|
||||||
- Brandon Schaefer
|
- Brandon Schaefer
|
||||||
- Sebastian Schuberth
|
- Sebastian Schuberth
|
||||||
@@ -299,6 +302,7 @@ skills.
|
|||||||
- Matt Sealey
|
- Matt Sealey
|
||||||
- Steve Sexton
|
- Steve Sexton
|
||||||
- Arkady Shapkin
|
- Arkady Shapkin
|
||||||
|
- Ali Sherief
|
||||||
- Yoshiki Shibukawa
|
- Yoshiki Shibukawa
|
||||||
- Dmitri Shuralyov
|
- Dmitri Shuralyov
|
||||||
- Daniel Skorupski
|
- Daniel Skorupski
|
||||||
@@ -331,14 +335,19 @@ skills.
|
|||||||
- Torsten Walluhn
|
- Torsten Walluhn
|
||||||
- Patrick Walton
|
- Patrick Walton
|
||||||
- Xo Wang
|
- Xo Wang
|
||||||
|
- Waris
|
||||||
- Jay Weisskopf
|
- Jay Weisskopf
|
||||||
- Frank Wille
|
- Frank Wille
|
||||||
|
- Richard A. Wilkes
|
||||||
|
- Tatsuya Yatagawa
|
||||||
- Ryogo Yoshimura
|
- Ryogo Yoshimura
|
||||||
- Lukas Zanner
|
- Lukas Zanner
|
||||||
- Andrey Zholos
|
- Andrey Zholos
|
||||||
|
- Aihui Zhu
|
||||||
- Santi Zupancic
|
- Santi Zupancic
|
||||||
- Jonas Ådahl
|
- Jonas Ådahl
|
||||||
- Lasse Öörni
|
- Lasse Öörni
|
||||||
|
- Leonard König
|
||||||
- All the unmentioned and anonymous contributors in the GLFW community, for bug
|
- All the unmentioned and anonymous contributors in the GLFW community, for bug
|
||||||
reports, patches, feedback, testing and encouragement
|
reports, patches, feedback, testing and encouragement
|
||||||
|
|
||||||
|
|||||||
Vendored
+2
-2
@@ -237,9 +237,9 @@ static inline void mat4x4_rotate_Y(mat4x4 Q, mat4x4 M, float angle)
|
|||||||
float s = sinf(angle);
|
float s = sinf(angle);
|
||||||
float c = cosf(angle);
|
float c = cosf(angle);
|
||||||
mat4x4 R = {
|
mat4x4 R = {
|
||||||
{ c, 0.f, s, 0.f},
|
{ c, 0.f, -s, 0.f},
|
||||||
{ 0.f, 1.f, 0.f, 0.f},
|
{ 0.f, 1.f, 0.f, 0.f},
|
||||||
{ -s, 0.f, c, 0.f},
|
{ s, 0.f, c, 0.f},
|
||||||
{ 0.f, 0.f, 0.f, 1.f}
|
{ 0.f, 0.f, 0.f, 1.f}
|
||||||
};
|
};
|
||||||
mat4x4_mul(Q, M, R);
|
mat4x4_mul(Q, M, R);
|
||||||
|
|||||||
@@ -30,3 +30,5 @@ add_custom_target(docs ALL "${DOXYGEN_EXECUTABLE}"
|
|||||||
WORKING_DIRECTORY "${GLFW_BINARY_DIR}/docs"
|
WORKING_DIRECTORY "${GLFW_BINARY_DIR}/docs"
|
||||||
COMMENT "Generating HTML documentation" VERBATIM)
|
COMMENT "Generating HTML documentation" VERBATIM)
|
||||||
|
|
||||||
|
set_target_properties(docs PROPERTIES FOLDER "GLFW3")
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@
|
|||||||
src/wl_* @linkmauve
|
src/wl_* @linkmauve
|
||||||
|
|
||||||
docs/*.css @glfw/webdev
|
docs/*.css @glfw/webdev
|
||||||
docs/*.less @glfw/webdev
|
docs/*.scss @glfw/webdev
|
||||||
docs/*.html @glfw/webdev
|
docs/*.html @glfw/webdev
|
||||||
docs/*.xml @glfw/webdev
|
docs/*.xml @glfw/webdev
|
||||||
|
|
||||||
|
|||||||
+28
-22
@@ -25,39 +25,41 @@ GLFW.
|
|||||||
#include <GLFW/glfw3.h>
|
#include <GLFW/glfw3.h>
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
This header declares the GLFW API and by default also includes the OpenGL header
|
This header defines all the constants and declares all the types and function
|
||||||
from your development environment. See below for how to control this.
|
prototypes of the GLFW API. By default it also includes the OpenGL header from
|
||||||
|
your development environment. See [option macros](@ref build_macros) below for
|
||||||
|
how to select OpenGL ES headers and more.
|
||||||
|
|
||||||
The GLFW header also defines any platform-specific macros needed by your OpenGL
|
The GLFW header also defines any platform-specific macros needed by your OpenGL
|
||||||
header, so it can be included without needing any window system headers.
|
header, so that it can be included without needing any window system headers.
|
||||||
|
|
||||||
For example, under Windows you are normally required to include `windows.h`
|
It does this only when needed, so if window system headers are included, the
|
||||||
before the OpenGL header, which would bring in the whole Win32 API. The GLFW
|
GLFW header does not try to redefine those symbols. The reverse is not true,
|
||||||
header duplicates the small number of macros needed.
|
i.e. `windows.h` cannot cope if any Win32 symbols have already been defined.
|
||||||
|
|
||||||
It does this only when needed, so if `windows.h` _is_ included, the GLFW header
|
|
||||||
does not try to redefine those symbols. The reverse is not true, i.e.
|
|
||||||
`windows.h` cannot cope if any of its symbols have already been defined.
|
|
||||||
|
|
||||||
In other words:
|
In other words:
|
||||||
|
|
||||||
- Do _not_ include the OpenGL headers yourself, as GLFW does this for you
|
- Use the GLFW header to include OpenGL or OpenGL ES headers portably
|
||||||
- Do _not_ include `windows.h` or other platform-specific headers unless you
|
- Do not include window system headers unless you will use those APIs directly
|
||||||
plan on using those APIs directly
|
- If you do need such headers, include them before the GLFW header
|
||||||
- If you _do_ need to include such headers, do it _before_ including
|
|
||||||
the GLFW header and it will handle this
|
|
||||||
|
|
||||||
If you are using an OpenGL extension loading library such as
|
If you are using an OpenGL extension loading library such as
|
||||||
[glad](https://github.com/Dav1dde/glad), the extension loader header should
|
[glad](https://github.com/Dav1dde/glad), the extension loader header should
|
||||||
be included _before_ the GLFW one.
|
be included before the GLFW one. GLFW attempts to detect any OpenGL or OpenGL
|
||||||
|
ES header or extension loader header included before it and will then disable
|
||||||
|
the inclusion of the default OpenGL header. Most extension loaders also define
|
||||||
|
macros that disable similar headers below it.
|
||||||
|
|
||||||
@code
|
@code
|
||||||
#include <glad/gl.h>
|
#include <glad/gl.h>
|
||||||
#include <GLFW/glfw3.h>
|
#include <GLFW/glfw3.h>
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
Alternatively the @ref GLFW_INCLUDE_NONE macro (described below) can be used to
|
Both of these mechanisms depend on the extension loader header defining a known
|
||||||
prevent the GLFW header from including the OpenGL header.
|
macro. If yours doesn't or you don't know which one your users will pick, the
|
||||||
|
@ref GLFW_INCLUDE_NONE macro will explicitly to prevent the GLFW header from
|
||||||
|
including the OpenGL header. This will also allow you to include the two
|
||||||
|
headers in any order.
|
||||||
|
|
||||||
@code
|
@code
|
||||||
#define GLFW_INCLUDE_NONE
|
#define GLFW_INCLUDE_NONE
|
||||||
@@ -105,7 +107,7 @@ __GLFW_INCLUDE_ES31__ makes the GLFW header include the OpenGL ES 3.1
|
|||||||
`GLES3/gl31.h` header instead of the regular OpenGL header.
|
`GLES3/gl31.h` header instead of the regular OpenGL header.
|
||||||
|
|
||||||
@anchor GLFW_INCLUDE_ES32
|
@anchor GLFW_INCLUDE_ES32
|
||||||
__GLFW_INCLUDE_ES31__ makes the GLFW header include the OpenGL ES 3.2
|
__GLFW_INCLUDE_ES32__ makes the GLFW header include the OpenGL ES 3.2
|
||||||
`GLES3/gl32.h` header instead of the regular OpenGL header.
|
`GLES3/gl32.h` header instead of the regular OpenGL header.
|
||||||
|
|
||||||
@anchor GLFW_INCLUDE_NONE
|
@anchor GLFW_INCLUDE_NONE
|
||||||
@@ -113,7 +115,8 @@ __GLFW_INCLUDE_NONE__ makes the GLFW header not include any OpenGL or OpenGL ES
|
|||||||
API header. This is useful in combination with an extension loading library.
|
API header. This is useful in combination with an extension loading library.
|
||||||
|
|
||||||
If none of the above inclusion macros are defined, the standard OpenGL `GL/gl.h`
|
If none of the above inclusion macros are defined, the standard OpenGL `GL/gl.h`
|
||||||
header (`OpenGL/gl.h` on macOS) is included.
|
header (`OpenGL/gl.h` on macOS) is included, unless GLFW detects the inclusion
|
||||||
|
guards of any OpenGL, OpenGL ES or extension loader header it knows about.
|
||||||
|
|
||||||
The following macros control the inclusion of additional API headers. Any
|
The following macros control the inclusion of additional API headers. Any
|
||||||
number of these may be defined simultaneously, and/or together with one of the
|
number of these may be defined simultaneously, and/or together with one of the
|
||||||
@@ -219,12 +222,15 @@ find_package(OpenGL REQUIRED)
|
|||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
If OpenGL is found, the `OpenGL::GL` target is added to your project, containing
|
If OpenGL is found, the `OpenGL::GL` target is added to your project, containing
|
||||||
library and include directory paths. Link against this like above.
|
library and include directory paths. Link against this like any other library.
|
||||||
|
|
||||||
@code{.cmake}
|
@code{.cmake}
|
||||||
target_link_libraries(myapp OpenGL::GL)
|
target_link_libraries(myapp OpenGL::GL)
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
|
For a minimal example of a program and GLFW sources built with CMake, see the
|
||||||
|
[GLFW CMake Starter](https://github.com/juliettef/GLFW-CMake-starter) on GitHub.
|
||||||
|
|
||||||
|
|
||||||
@subsection build_link_cmake_package With CMake and installed GLFW binaries
|
@subsection build_link_cmake_package With CMake and installed GLFW binaries
|
||||||
|
|
||||||
@@ -258,7 +264,7 @@ find_package(OpenGL REQUIRED)
|
|||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
If OpenGL is found, the `OpenGL::GL` target is added to your project, containing
|
If OpenGL is found, the `OpenGL::GL` target is added to your project, containing
|
||||||
library and include directory paths. Link against this like above.
|
library and include directory paths. Link against this like any other library.
|
||||||
|
|
||||||
@code{.cmake}
|
@code{.cmake}
|
||||||
target_link_libraries(myapp OpenGL::GL)
|
target_link_libraries(myapp OpenGL::GL)
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -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"}
|
||||||
@@ -1,79 +1,79 @@
|
|||||||
// NOTE: Please use this file to perform modifications on default style sheets.
|
// 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:
|
// You need to install the official Sass CLI tool:
|
||||||
// gem install less therubyracer
|
// npm install -g sass
|
||||||
//
|
//
|
||||||
// Run this command to regenerate extra.css after you're finished with changes:
|
// 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.
|
// Alternatively you can use online services to regenerate extra.css.
|
||||||
|
|
||||||
|
|
||||||
// Default text color for page contents
|
// 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
|
// 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
|
// 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
|
// Doxygen navigation bar links
|
||||||
@navbar-link-color: @header-footer-background-color;
|
$navbar-link-color: $header-footer-background-color;
|
||||||
|
|
||||||
// Page content 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
|
// 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
|
// Function, enum and macro definition separator
|
||||||
@def-separator-color: @header-footer-background-color;
|
$def-separator-color: $header-footer-background-color;
|
||||||
|
|
||||||
// Base color hue
|
// Base color hue
|
||||||
@base-hue: 24;
|
$base-hue: 24;
|
||||||
|
|
||||||
// Default color used for links
|
// 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
|
// Doxygen navigation bar active tab
|
||||||
@tab-text-color: hsl(0,0%,100%);
|
$tab-text-color: hsl(0,0%,100%);
|
||||||
@tab-background-color1: @default-link-color;
|
$tab-background-color1: $default-link-color;
|
||||||
@tab-background-color2: lighten(spin(@tab-background-color1, 10), 10%);
|
$tab-background-color2: lighten(adjust-hue($tab-background-color1, 10), 10%);
|
||||||
|
|
||||||
// Table borders
|
// Table borders
|
||||||
@default-border-color: @default-link-color;
|
$default-border-color: $default-link-color;
|
||||||
|
|
||||||
// Table header
|
// Table header
|
||||||
@table-text-color: @tab-text-color;
|
$table-text-color: $tab-text-color;
|
||||||
@table-background-color1: @tab-background-color1;
|
$table-background-color1: $tab-background-color1;
|
||||||
@table-background-color2: @tab-background-color2;
|
$table-background-color2: $tab-background-color2;
|
||||||
|
|
||||||
// Table of contents, data structure index and prototypes
|
// Table of contents, data structure index and prototypes
|
||||||
@toc-background-color1: hsl(0,0%,90%);
|
$toc-background-color1: hsl(0,0%,90%);
|
||||||
@toc-background-color2: lighten(@toc-background-color1, 5%);
|
$toc-background-color2: lighten($toc-background-color1, 5%);
|
||||||
|
|
||||||
// Function prototype parameters color
|
// 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
|
// 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
|
// 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
|
// 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
|
// 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 helper function
|
||||||
.message-box(@base-color) {
|
@mixin message-box($base-color){
|
||||||
background:linear-gradient(to bottom,lighten(@base-color, 5%) 0%,@base-color 100%);
|
background:linear-gradient(to bottom,lighten($base-color, 5%) 0%,$base-color 100%);
|
||||||
box-shadow:inset 0 0 32px darken(@base-color, 5%);
|
box-shadow:inset 0 0 32px darken($base-color, 5%);
|
||||||
color:darken(@base-color, 67%);
|
color:darken($base-color, 67%);
|
||||||
border:2px solid desaturate(darken(@base-color, 10%), 20%);
|
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 {
|
.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 {
|
||||||
@@ -82,24 +82,24 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.sm-dox a span.sub-arrow {
|
.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 {
|
.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 {
|
.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 {
|
.sm-dox ul a:hover {
|
||||||
background:@header-footer-link-color;
|
background:$header-footer-link-color;
|
||||||
text-shadow:none;
|
text-shadow:none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sm-dox ul.sm-nowrap a {
|
.sm-dox ul.sm-nowrap a {
|
||||||
color:@default-text-color;
|
color:$default-text-color;
|
||||||
text-shadow:none;
|
text-shadow:none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,15 +128,15 @@ 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 {
|
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 {
|
body {
|
||||||
color:@default-text-color;
|
color:$default-text-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1,h2,h2.groupheader,h3,div.toc h3,h4,h5,h6,strong,em {
|
h1,h2,h2.groupheader,h3,div.toc h3,h4,h5,h6,strong,em {
|
||||||
color:@heading-color;
|
color:$heading-color;
|
||||||
border-bottom:none;
|
border-bottom:none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,24 +159,30 @@ h3 {
|
|||||||
|
|
||||||
.glfwheader {
|
.glfwheader {
|
||||||
font-size:16px;
|
font-size:16px;
|
||||||
height:64px;
|
min-height:64px;
|
||||||
max-width:920px;
|
max-width:920px;
|
||||||
min-width:800px;
|
|
||||||
padding:0 32px;
|
padding:0 32px;
|
||||||
margin:0 auto;
|
margin:0 auto;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: center;
|
||||||
|
align-content: stretch;
|
||||||
}
|
}
|
||||||
|
|
||||||
#glfwhome {
|
#glfwhome {
|
||||||
line-height:64px;
|
line-height:64px;
|
||||||
padding-right:48px;
|
padding-right:48px;
|
||||||
color:@header-footer-link-color;
|
color:$header-footer-link-color;
|
||||||
font-size:2.5em;
|
font-size:2.5em;
|
||||||
background:url("https://www.glfw.org/css/arrow.png") no-repeat right;
|
background:url("https://www.glfw.org/css/arrow.png") no-repeat right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.glfwnavbar {
|
.glfwnavbar {
|
||||||
list-style-type:none;
|
list-style-type:none;
|
||||||
margin:0 auto;
|
margin:0 0 0 auto;
|
||||||
float:right;
|
float:right;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,7 +194,11 @@ h3 {
|
|||||||
line-height:64px;
|
line-height:64px;
|
||||||
margin-left:2em;
|
margin-left:2em;
|
||||||
display:block;
|
display:block;
|
||||||
color:@header-footer-link-color;
|
color:$header-footer-link-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
.glfwnavbar {
|
||||||
|
padding-left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#glfwhome,.glfwnavbar a,.glfwnavbar a:visited {
|
#glfwhome,.glfwnavbar a,.glfwnavbar a:visited {
|
||||||
@@ -196,7 +206,7 @@ h3 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#titlearea,.footer {
|
#titlearea,.footer {
|
||||||
color:@header-footer-link-color;
|
color:$header-footer-link-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
address.footer {
|
address.footer {
|
||||||
@@ -206,19 +216,17 @@ address.footer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#top {
|
#top {
|
||||||
background:@header-footer-link-color;
|
background:$header-footer-link-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
#main-nav {
|
#main-nav {
|
||||||
max-width:960px;
|
max-width:960px;
|
||||||
min-width:800px;
|
|
||||||
margin:0 auto;
|
margin:0 auto;
|
||||||
font-size:13px;
|
font-size:13px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#main-menu {
|
#main-menu {
|
||||||
max-width:920px;
|
max-width:920px;
|
||||||
min-width:800px;
|
|
||||||
margin:0 auto;
|
margin:0 auto;
|
||||||
font-size:13px;
|
font-size:13px;
|
||||||
}
|
}
|
||||||
@@ -233,21 +241,29 @@ address.footer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#main-menu {
|
#main-menu {
|
||||||
height:36px;
|
min-height:36px;
|
||||||
display:block;
|
display: flex;
|
||||||
position:relative;
|
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 {
|
#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 {
|
#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 {
|
#main-menu li ul.sm-nowrap li a:hover {
|
||||||
color:@default-link-color;
|
color:$default-link-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main-menu > li:last-child {
|
||||||
|
margin: 0 0 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.contents {
|
.contents {
|
||||||
@@ -258,22 +274,22 @@ div.contents,div.header {
|
|||||||
max-width:920px;
|
max-width:920px;
|
||||||
margin:0 auto;
|
margin:0 auto;
|
||||||
padding:0 32px;
|
padding:0 32px;
|
||||||
background:@content-background-color none;
|
background:$content-background-color none;
|
||||||
}
|
}
|
||||||
|
|
||||||
table.doxtable th,table.markdownTable th,dl.reflist dt {
|
table.doxtable th,table.markdownTable th,dl.reflist dt {
|
||||||
background:linear-gradient(to bottom,@table-background-color2 0%,@table-background-color1 100%);
|
background:linear-gradient(to bottom,$table-background-color2 0%,$table-background-color1 100%);
|
||||||
box-shadow:inset 0 0 32px @table-background-color1;
|
box-shadow:inset 0 0 32px $table-background-color1;
|
||||||
text-shadow:0 -1px 1px darken(@table-background-color1, 15%);
|
text-shadow:0 -1px 1px darken($table-background-color1, 15%);
|
||||||
text-align:left;
|
text-align:left;
|
||||||
color:@table-text-color;
|
color:$table-text-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
dl.reflist dt a.el {
|
dl.reflist dt a.el {
|
||||||
color:@default-link-color;
|
color:$default-link-color;
|
||||||
padding:.2em;
|
padding:.2em;
|
||||||
border-radius:4px;
|
border-radius:4px;
|
||||||
background-color:lighten(@default-link-color, 40%);
|
background-color:lighten($default-link-color, 40%);
|
||||||
}
|
}
|
||||||
|
|
||||||
div.toc {
|
div.toc {
|
||||||
@@ -296,27 +312,27 @@ div.toc li {
|
|||||||
}
|
}
|
||||||
|
|
||||||
div.toc,.memproto,div.qindex,div.ah {
|
div.toc,.memproto,div.qindex,div.ah {
|
||||||
background:linear-gradient(to bottom,@toc-background-color2 0%,@toc-background-color1 100%);
|
background:linear-gradient(to bottom,$toc-background-color2 0%,$toc-background-color1 100%);
|
||||||
box-shadow:inset 0 0 32px @toc-background-color1;
|
box-shadow:inset 0 0 32px $toc-background-color1;
|
||||||
text-shadow:0 1px 1px lighten(@toc-background-color2, 10%);
|
text-shadow:0 1px 1px lighten($toc-background-color2, 10%);
|
||||||
color:@heading-color;
|
color:$heading-color;
|
||||||
border:2px solid @toc-background-color1;
|
border:2px solid $toc-background-color1;
|
||||||
border-radius:4px;
|
border-radius:4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.paramname {
|
.paramname {
|
||||||
color:@prototype-param-color;
|
color:$prototype-param-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
dl.reflist dt {
|
dl.reflist dt {
|
||||||
border:2px solid @default-border-color;
|
border:2px solid $default-border-color;
|
||||||
border-top-left-radius:4px;
|
border-top-left-radius:4px;
|
||||||
border-top-right-radius:4px;
|
border-top-right-radius:4px;
|
||||||
border-bottom:none;
|
border-bottom:none;
|
||||||
}
|
}
|
||||||
|
|
||||||
dl.reflist dd {
|
dl.reflist dd {
|
||||||
border:2px solid @default-border-color;
|
border:2px solid $default-border-color;
|
||||||
border-bottom-right-radius:4px;
|
border-bottom-right-radius:4px;
|
||||||
border-bottom-left-radius:4px;
|
border-bottom-left-radius:4px;
|
||||||
border-top:none;
|
border-top:none;
|
||||||
@@ -325,41 +341,41 @@ dl.reflist dd {
|
|||||||
table.doxtable,table.markdownTable {
|
table.doxtable,table.markdownTable {
|
||||||
border-collapse:inherit;
|
border-collapse:inherit;
|
||||||
border-spacing:0;
|
border-spacing:0;
|
||||||
border:2px solid @default-border-color;
|
border:2px solid $default-border-color;
|
||||||
border-radius:4px;
|
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 {
|
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;
|
text-decoration:none;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.directory {
|
div.directory {
|
||||||
border-collapse:inherit;
|
border-collapse:inherit;
|
||||||
border-spacing:0;
|
border-spacing:0;
|
||||||
border:2px solid @default-border-color;
|
border:2px solid $default-border-color;
|
||||||
border-radius:4px;
|
border-radius:4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
hr,.memSeparator {
|
hr,.memSeparator {
|
||||||
height:2px;
|
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 {
|
dl.note,dl.pre,dl.post,dl.invariant {
|
||||||
.message-box(@box-note-color);
|
@include message-box($box-note-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
dl.warning,dl.attention {
|
dl.warning,dl.attention {
|
||||||
.message-box(@box-warning-color);
|
@include message-box($box-warning-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
dl.deprecated,dl.bug {
|
dl.deprecated,dl.bug {
|
||||||
.message-box(@box-bug-color);
|
@include message-box($box-bug-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
dl.todo,dl.test {
|
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 {
|
dl.note,dl.pre,dl.post,dl.invariant,dl.warning,dl.attention,dl.deprecated,dl.bug,dl.todo,dl.test {
|
||||||
@@ -388,7 +404,7 @@ div.fragment,pre.fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.lineno a,.lineno a:visited,.line,pre.fragment {
|
.lineno a,.lineno a:visited,.line,pre.fragment {
|
||||||
color:@default-text-color;
|
color:$default-text-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
span.preprocessor,span.comment {
|
span.preprocessor,span.comment {
|
||||||
@@ -400,7 +416,7 @@ a.code,a.code:visited {
|
|||||||
}
|
}
|
||||||
|
|
||||||
span.keyword,span.keywordtype,span.keywordflow {
|
span.keyword,span.keywordtype,span.keywordflow {
|
||||||
color:darken(@default-text-color, 5%);
|
color:darken($default-text-color, 5%);
|
||||||
font-weight:bold;
|
font-weight:bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
+3
-2
@@ -1,7 +1,8 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<!DOCTYPE html>
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
<meta name="generator" content="Doxygen $doxygenversion"/>
|
<meta name="generator" content="Doxygen $doxygenversion"/>
|
||||||
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
|
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
|
||||||
|
|||||||
+1
-1
@@ -645,7 +645,7 @@ const char* name = glfwGetJoystickName(GLFW_JOYSTICK_4);
|
|||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
Joystick names are not guaranteed to be unique. Two joysticks of the same model
|
Joystick names are not guaranteed to be unique. Two joysticks of the same model
|
||||||
and make may have the same name. Only the [joystick token](@ref joysticks) is
|
and make may have the same name. Only the [joystick ID](@ref joysticks) is
|
||||||
guaranteed to be unique, and only until that joystick is disconnected.
|
guaranteed to be unique, and only until that joystick is disconnected.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -362,8 +362,8 @@ should be using the character callback instead, on both GLFW 2 and 3. This will
|
|||||||
give you the characters being input, as opposed to the keys being pressed.
|
give you the characters being input, as opposed to the keys being pressed.
|
||||||
|
|
||||||
GLFW 3 has key tokens for all keys on a standard 105 key keyboard, so instead of
|
GLFW 3 has key tokens for all keys on a standard 105 key keyboard, so instead of
|
||||||
having to remember whether to check for `'a'` or `'A'`, you now check for
|
having to remember whether to check for `a` or `A`, you now check for
|
||||||
`GLFW_KEY_A`.
|
@ref GLFW_KEY_A.
|
||||||
|
|
||||||
|
|
||||||
@subsection moving_joystick Joystick function changes
|
@subsection moving_joystick Joystick function changes
|
||||||
|
|||||||
@@ -299,6 +299,13 @@ a requirement of the GLFW CMake files. The GLFW source files do not depend on
|
|||||||
CMake.
|
CMake.
|
||||||
|
|
||||||
|
|
||||||
|
@subsubsection caveat_fbtransparency_33 Framebuffer transparency requires DWM transparency
|
||||||
|
|
||||||
|
GLFW no longer supports framebuffer transparency enabled via @ref
|
||||||
|
GLFW_TRANSPARENT_FRAMEBUFFER on Windows 7 if DWM transparency is off
|
||||||
|
(the Transparency setting under Personalization > Window Color).
|
||||||
|
|
||||||
|
|
||||||
@subsection deprecations_33 Deprecations in version 3.3
|
@subsection deprecations_33 Deprecations in version 3.3
|
||||||
|
|
||||||
@subsubsection charmods_callback_33 Character with modifiers callback
|
@subsubsection charmods_callback_33 Character with modifiers callback
|
||||||
|
|||||||
+33
-30
@@ -18,43 +18,42 @@ behave differently in GLFW 3.
|
|||||||
|
|
||||||
@subsection quick_include Including the GLFW header
|
@subsection quick_include Including the GLFW header
|
||||||
|
|
||||||
In the source files of your application where you use OpenGL or GLFW, you need
|
In the source files of your application where you use GLFW, you need to include
|
||||||
to include the GLFW 3 header file.
|
its header file.
|
||||||
|
|
||||||
@code
|
@code
|
||||||
#include <GLFW/glfw3.h>
|
#include <GLFW/glfw3.h>
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
This defines all the constants, types and function prototypes of the GLFW API.
|
This header provides all the constants, types and function prototypes of the
|
||||||
It also includes the OpenGL header from your development environment and
|
GLFW API.
|
||||||
defines all the constants and types necessary for it to work on your platform
|
|
||||||
without including any platform-specific headers.
|
|
||||||
|
|
||||||
In other words:
|
By default it also includes the OpenGL header from your development environment.
|
||||||
|
On some platforms this header only supports older versions of OpenGL. The most
|
||||||
|
extreme case is Windows, where it typically only supports OpenGL 1.2.
|
||||||
|
|
||||||
- Do _not_ include the OpenGL header yourself, as GLFW does this for you in
|
Most programs will instead use an
|
||||||
a platform-independent way
|
[extension loader library](@ref context_glext_auto) and include its header.
|
||||||
- Do _not_ include `windows.h` or other platform-specific headers unless
|
This example uses files generated by [glad](https://gen.glad.sh/). The GLFW
|
||||||
you plan on using those APIs yourself
|
header can detect most such headers if they are included first and will then not
|
||||||
- If you _do_ need to include such headers, include them _before_ the GLFW
|
include the one from your development environment.
|
||||||
header and it will detect this
|
|
||||||
|
|
||||||
On some platforms supported by GLFW the OpenGL header and link library only
|
|
||||||
expose older versions of OpenGL. The most extreme case is Windows, which only
|
|
||||||
exposes OpenGL 1.2. The easiest way to work around this is to use an
|
|
||||||
[extension loader library](@ref context_glext_auto).
|
|
||||||
|
|
||||||
If you are using such a library then you should include its header _before_ the
|
|
||||||
GLFW header. This lets it replace the OpenGL header included by GLFW without
|
|
||||||
conflicts. This example uses
|
|
||||||
[glad2](https://github.com/Dav1dde/glad), but the same rule applies to all such
|
|
||||||
libraries.
|
|
||||||
|
|
||||||
@code
|
@code
|
||||||
#include <glad/gl.h>
|
#include <glad/gl.h>
|
||||||
#include <GLFW/glfw3.h>
|
#include <GLFW/glfw3.h>
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
|
To make sure there will be no header conflicts, you can define @ref
|
||||||
|
GLFW_INCLUDE_NONE before the GLFW header to explicitly disable inclusion of the
|
||||||
|
development environment header. This also allows the two headers to be included
|
||||||
|
in any order.
|
||||||
|
|
||||||
|
@code
|
||||||
|
#define GLFW_INCLUDE_NONE
|
||||||
|
#include <GLFW/glfw3.h>
|
||||||
|
#include <glad/gl.h>
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
|
||||||
@subsection quick_init_term Initializing and terminating GLFW
|
@subsection quick_init_term Initializing and terminating GLFW
|
||||||
|
|
||||||
@@ -246,12 +245,16 @@ glViewport(0, 0, width, height);
|
|||||||
You can also set a framebuffer size callback using @ref
|
You can also set a framebuffer size callback using @ref
|
||||||
glfwSetFramebufferSizeCallback and be notified when the size changes.
|
glfwSetFramebufferSizeCallback and be notified when the size changes.
|
||||||
|
|
||||||
Actual rendering with OpenGL is outside the scope of this tutorial, but there
|
The details of how to render with OpenGL is outside the scope of this tutorial,
|
||||||
are [many](https://open.gl/) [excellent](https://learnopengl.com/)
|
but there are many excellent resources for learning modern OpenGL. Here are
|
||||||
[tutorial](http://openglbook.com/) [sites](http://ogldev.atspace.co.uk/) that
|
a few of them:
|
||||||
teach modern OpenGL. Some of them use GLFW to create the context and window
|
|
||||||
while others use GLUT or SDL, but remember that OpenGL itself always works the
|
- [Anton's OpenGL 4 Tutorials](https://antongerdelan.net/opengl/)
|
||||||
same.
|
- [Learn OpenGL](https://learnopengl.com/)
|
||||||
|
- [Open.GL](https://open.gl/)
|
||||||
|
|
||||||
|
These all happen to use GLFW, but OpenGL itself works the same whatever API you
|
||||||
|
use to create the window and context.
|
||||||
|
|
||||||
|
|
||||||
@subsection quick_timer Reading the timer
|
@subsection quick_timer Reading the timer
|
||||||
|
|||||||
+9
-4
@@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
@tableofcontents
|
@tableofcontents
|
||||||
|
|
||||||
This guide is intended to fill the gaps between the [Vulkan
|
This guide is intended to fill the gaps between the official [Vulkan
|
||||||
documentation](https://www.khronos.org/vulkan/) and the rest of the GLFW
|
resources](https://www.khronos.org/vulkan/) and the rest of the GLFW
|
||||||
documentation and is not a replacement for either. It assumes some familiarity
|
documentation and is not a replacement for either. It assumes some familiarity
|
||||||
with Vulkan concepts like loaders, devices, queues and surfaces and leaves it to
|
with Vulkan concepts like loaders, devices, queues and surfaces and leaves it to
|
||||||
the Vulkan documentation to explain the details of Vulkan functions.
|
the Vulkan documentation to explain the details of Vulkan functions.
|
||||||
@@ -14,7 +14,12 @@ To develop for Vulkan you should download the [LunarG Vulkan
|
|||||||
SDK](https://vulkan.lunarg.com/) for your platform. Apart from headers and link
|
SDK](https://vulkan.lunarg.com/) for your platform. Apart from headers and link
|
||||||
libraries, they also provide the validation layers necessary for development.
|
libraries, they also provide the validation layers necessary for development.
|
||||||
|
|
||||||
For details on a specific function in this category, see the @ref vulkan. There
|
The [Vulkan Tutorial](https://vulkan-tutorial.com/) has more information on how
|
||||||
|
to use GLFW and Vulkan. The [Khronos Vulkan
|
||||||
|
Samples](https://github.com/KhronosGroup/Vulkan-Samples) also use GLFW, although
|
||||||
|
with a small framework in between.
|
||||||
|
|
||||||
|
For details on a specific Vulkan support function, see the @ref vulkan. There
|
||||||
are also guides for the other areas of the GLFW API.
|
are also guides for the other areas of the GLFW API.
|
||||||
|
|
||||||
- @ref intro_guide
|
- @ref intro_guide
|
||||||
@@ -88,7 +93,7 @@ if (glfwVulkanSupported())
|
|||||||
This function returns `GLFW_TRUE` if the Vulkan loader and any minimally
|
This function returns `GLFW_TRUE` if the Vulkan loader and any minimally
|
||||||
functional ICD was found.
|
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.
|
will generate a @ref GLFW_API_UNAVAILABLE error.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+10
-13
@@ -234,13 +234,6 @@ alpha channel will be used to combine the framebuffer with the background. This
|
|||||||
does not affect window decorations. Possible values are `GLFW_TRUE` and
|
does not affect window decorations. Possible values are `GLFW_TRUE` and
|
||||||
`GLFW_FALSE`.
|
`GLFW_FALSE`.
|
||||||
|
|
||||||
@par
|
|
||||||
@win32 GLFW sets a color key for the window to work around repainting issues
|
|
||||||
with a transparent framebuffer. The chosen color value is RGB 255,0,255
|
|
||||||
(magenta). This will make pixels with that exact color fully transparent
|
|
||||||
regardless of their alpha values. If this is a problem, make these pixels any
|
|
||||||
other color before buffer swap.
|
|
||||||
|
|
||||||
@anchor GLFW_FOCUS_ON_SHOW_hint
|
@anchor GLFW_FOCUS_ON_SHOW_hint
|
||||||
__GLFW_FOCUS_ON_SHOW__ specifies whether the window will be given input
|
__GLFW_FOCUS_ON_SHOW__ specifies whether the window will be given input
|
||||||
focus when @ref glfwShowWindow is called. Possible values are `GLFW_TRUE` and `GLFW_FALSE`.
|
focus when @ref glfwShowWindow is called. Possible values are `GLFW_TRUE` and `GLFW_FALSE`.
|
||||||
@@ -408,10 +401,14 @@ Forward-compatibility is described in detail in the
|
|||||||
[OpenGL Reference Manual](https://www.opengl.org/registry/).
|
[OpenGL Reference Manual](https://www.opengl.org/registry/).
|
||||||
|
|
||||||
@anchor GLFW_OPENGL_DEBUG_CONTEXT_hint
|
@anchor GLFW_OPENGL_DEBUG_CONTEXT_hint
|
||||||
__GLFW_OPENGL_DEBUG_CONTEXT__ specifies whether to create a debug OpenGL
|
__GLFW_OPENGL_DEBUG_CONTEXT__ specifies whether the context should be created
|
||||||
context, which may have additional error and performance issue reporting
|
in debug mode, which may provide additional error and diagnostic reporting
|
||||||
functionality. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. If OpenGL ES
|
functionality. Possible values are `GLFW_TRUE` and `GLFW_FALSE`.
|
||||||
is requested, this hint is ignored.
|
|
||||||
|
@par
|
||||||
|
Debug contexts for OpenGL and OpenGL ES are described in detail by the
|
||||||
|
[GL_KHR_debug](https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_debug.txt)
|
||||||
|
extension.
|
||||||
|
|
||||||
@anchor GLFW_OPENGL_PROFILE_hint
|
@anchor GLFW_OPENGL_PROFILE_hint
|
||||||
__GLFW_OPENGL_PROFILE__ specifies which OpenGL profile to create the context
|
__GLFW_OPENGL_PROFILE__ specifies which OpenGL profile to create the context
|
||||||
@@ -1328,8 +1325,8 @@ __GLFW_OPENGL_FORWARD_COMPAT__ is `GLFW_TRUE` if the window's context is an
|
|||||||
OpenGL forward-compatible one, or `GLFW_FALSE` otherwise.
|
OpenGL forward-compatible one, or `GLFW_FALSE` otherwise.
|
||||||
|
|
||||||
@anchor GLFW_OPENGL_DEBUG_CONTEXT_attrib
|
@anchor GLFW_OPENGL_DEBUG_CONTEXT_attrib
|
||||||
__GLFW_OPENGL_DEBUG_CONTEXT__ is `GLFW_TRUE` if the window's context is an
|
__GLFW_OPENGL_DEBUG_CONTEXT__ is `GLFW_TRUE` if the window's context is in debug
|
||||||
OpenGL debug context, or `GLFW_FALSE` otherwise.
|
mode, or `GLFW_FALSE` otherwise.
|
||||||
|
|
||||||
@anchor GLFW_OPENGL_PROFILE_attrib
|
@anchor GLFW_OPENGL_PROFILE_attrib
|
||||||
__GLFW_OPENGL_PROFILE__ indicates the OpenGL profile used by the context. This
|
__GLFW_OPENGL_PROFILE__ indicates the OpenGL profile used by the context. This
|
||||||
|
|||||||
@@ -148,6 +148,7 @@ int main(void)
|
|||||||
glUseProgram(program);
|
glUseProgram(program);
|
||||||
glUniformMatrix4fv(mvp_location, 1, GL_FALSE, (const GLfloat*) mvp);
|
glUniformMatrix4fv(mvp_location, 1, GL_FALSE, (const GLfloat*) mvp);
|
||||||
glDrawArrays(GL_TRIANGLES, 0, 3);
|
glDrawArrays(GL_TRIANGLES, 0, 3);
|
||||||
|
glFinish();
|
||||||
|
|
||||||
#if USE_NATIVE_OSMESA
|
#if USE_NATIVE_OSMESA
|
||||||
glfwGetOSMesaColorBuffer(window, &width, &height, NULL, (void**) &buffer);
|
glfwGetOSMesaColorBuffer(window, &width, &height, NULL, (void**) &buffer);
|
||||||
|
|||||||
+43
-12
@@ -52,7 +52,7 @@ extern "C" {
|
|||||||
* This is the reference documentation for OpenGL and OpenGL ES context related
|
* This is the reference documentation for OpenGL and OpenGL ES context related
|
||||||
* functions. For more task-oriented information, see the @ref context_guide.
|
* functions. For more task-oriented information, see the @ref context_guide.
|
||||||
*/
|
*/
|
||||||
/*! @defgroup vulkan Vulkan reference
|
/*! @defgroup vulkan Vulkan support reference
|
||||||
* @brief Functions and types related to Vulkan.
|
* @brief Functions and types related to Vulkan.
|
||||||
*
|
*
|
||||||
* This is the reference documentation for Vulkan related functions and types.
|
* This is the reference documentation for Vulkan related functions and types.
|
||||||
@@ -193,7 +193,38 @@ extern "C" {
|
|||||||
|
|
||||||
#endif /*__APPLE__*/
|
#endif /*__APPLE__*/
|
||||||
|
|
||||||
#elif !defined(GLFW_INCLUDE_NONE)
|
#elif defined(GLFW_INCLUDE_GLU)
|
||||||
|
|
||||||
|
#if defined(__APPLE__)
|
||||||
|
|
||||||
|
#if defined(GLFW_INCLUDE_GLU)
|
||||||
|
#include <OpenGL/glu.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#else /*__APPLE__*/
|
||||||
|
|
||||||
|
#if defined(GLFW_INCLUDE_GLU)
|
||||||
|
#include <GL/glu.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /*__APPLE__*/
|
||||||
|
|
||||||
|
#elif !defined(GLFW_INCLUDE_NONE) && \
|
||||||
|
!defined(__gl_h_) && \
|
||||||
|
!defined(__gles1_gl_h_) && \
|
||||||
|
!defined(__gles2_gl2_h_) && \
|
||||||
|
!defined(__gles2_gl3_h_) && \
|
||||||
|
!defined(__gles2_gl31_h_) && \
|
||||||
|
!defined(__gles2_gl32_h_) && \
|
||||||
|
!defined(__gl_glcorearb_h_) && \
|
||||||
|
!defined(__gl2_h_) /*legacy*/ && \
|
||||||
|
!defined(__gl3_h_) /*legacy*/ && \
|
||||||
|
!defined(__gl31_h_) /*legacy*/ && \
|
||||||
|
!defined(__gl32_h_) /*legacy*/ && \
|
||||||
|
!defined(__glcorearb_h_) /*legacy*/ && \
|
||||||
|
!defined(__GL_H__) /*non-standard*/ && \
|
||||||
|
!defined(__gltypes_h_) /*non-standard*/ && \
|
||||||
|
!defined(__glee_h_) /*non-standard*/
|
||||||
|
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
|
|
||||||
@@ -201,9 +232,6 @@ extern "C" {
|
|||||||
#define GL_GLEXT_LEGACY
|
#define GL_GLEXT_LEGACY
|
||||||
#endif
|
#endif
|
||||||
#include <OpenGL/gl.h>
|
#include <OpenGL/gl.h>
|
||||||
#if defined(GLFW_INCLUDE_GLU)
|
|
||||||
#include <OpenGL/glu.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else /*__APPLE__*/
|
#else /*__APPLE__*/
|
||||||
|
|
||||||
@@ -211,9 +239,6 @@ extern "C" {
|
|||||||
#if defined(GLFW_INCLUDE_GLEXT)
|
#if defined(GLFW_INCLUDE_GLEXT)
|
||||||
#include <GL/glext.h>
|
#include <GL/glext.h>
|
||||||
#endif
|
#endif
|
||||||
#if defined(GLFW_INCLUDE_GLU)
|
|
||||||
#include <GL/glu.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /*__APPLE__*/
|
#endif /*__APPLE__*/
|
||||||
|
|
||||||
@@ -270,7 +295,7 @@ extern "C" {
|
|||||||
* API changes.
|
* API changes.
|
||||||
* @ingroup init
|
* @ingroup init
|
||||||
*/
|
*/
|
||||||
#define GLFW_VERSION_REVISION 2
|
#define GLFW_VERSION_REVISION 4
|
||||||
/*! @} */
|
/*! @} */
|
||||||
|
|
||||||
/*! @brief One.
|
/*! @brief One.
|
||||||
@@ -949,9 +974,9 @@ extern "C" {
|
|||||||
* and [attribute](@ref GLFW_OPENGL_FORWARD_COMPAT_attrib).
|
* and [attribute](@ref GLFW_OPENGL_FORWARD_COMPAT_attrib).
|
||||||
*/
|
*/
|
||||||
#define GLFW_OPENGL_FORWARD_COMPAT 0x00022006
|
#define GLFW_OPENGL_FORWARD_COMPAT 0x00022006
|
||||||
/*! @brief OpenGL debug context hint and attribute.
|
/*! @brief Debug mode context hint and attribute.
|
||||||
*
|
*
|
||||||
* OpenGL debug context [hint](@ref GLFW_OPENGL_DEBUG_CONTEXT_hint) and
|
* Debug mode context [hint](@ref GLFW_OPENGL_DEBUG_CONTEXT_hint) and
|
||||||
* [attribute](@ref GLFW_OPENGL_DEBUG_CONTEXT_attrib).
|
* [attribute](@ref GLFW_OPENGL_DEBUG_CONTEXT_attrib).
|
||||||
*/
|
*/
|
||||||
#define GLFW_OPENGL_DEBUG_CONTEXT 0x00022007
|
#define GLFW_OPENGL_DEBUG_CONTEXT 0x00022007
|
||||||
@@ -1328,7 +1353,7 @@ typedef void (* GLFWwindowiconifyfun)(GLFWwindow*,int);
|
|||||||
* @endcode
|
* @endcode
|
||||||
*
|
*
|
||||||
* @param[in] window The window that was maximized or restored.
|
* @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.
|
* `GLFW_FALSE` if it was restored.
|
||||||
*
|
*
|
||||||
* @sa @ref window_maximize
|
* @sa @ref window_maximize
|
||||||
@@ -1753,6 +1778,10 @@ typedef struct GLFWgamepadstate
|
|||||||
* bundle, if present. This can be disabled with the @ref
|
* bundle, if present. This can be disabled with the @ref
|
||||||
* GLFW_COCOA_CHDIR_RESOURCES init hint.
|
* GLFW_COCOA_CHDIR_RESOURCES init hint.
|
||||||
*
|
*
|
||||||
|
* @remark @x11 This function will set the `LC_CTYPE` category of the
|
||||||
|
* application locale according to the current environment if that category is
|
||||||
|
* still "C". This is because the "C" locale breaks Unicode text input.
|
||||||
|
*
|
||||||
* @thread_safety This function must only be called from the main thread.
|
* @thread_safety This function must only be called from the main thread.
|
||||||
*
|
*
|
||||||
* @sa @ref intro_init
|
* @sa @ref intro_init
|
||||||
@@ -1776,6 +1805,8 @@ GLFWAPI int glfwInit(void);
|
|||||||
* call this function, as it is called by @ref glfwInit before it returns
|
* call this function, as it is called by @ref glfwInit before it returns
|
||||||
* failure.
|
* failure.
|
||||||
*
|
*
|
||||||
|
* This function has no effect if GLFW is not initialized.
|
||||||
|
*
|
||||||
* @errors Possible errors include @ref GLFW_PLATFORM_ERROR.
|
* @errors Possible errors include @ref GLFW_PLATFORM_ERROR.
|
||||||
*
|
*
|
||||||
* @remark This function may be called before @ref glfwInit.
|
* @remark This function may be called before @ref glfwInit.
|
||||||
|
|||||||
+21
-15
@@ -63,7 +63,7 @@ elseif (_GLFW_OSMESA)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (_GLFW_X11 OR _GLFW_WAYLAND)
|
if (_GLFW_X11 OR _GLFW_WAYLAND)
|
||||||
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
set(glfw_HEADERS ${glfw_HEADERS} linux_joystick.h)
|
set(glfw_HEADERS ${glfw_HEADERS} linux_joystick.h)
|
||||||
set(glfw_SOURCES ${glfw_SOURCES} linux_joystick.c)
|
set(glfw_SOURCES ${glfw_SOURCES} linux_joystick.c)
|
||||||
else()
|
else()
|
||||||
@@ -72,8 +72,8 @@ if (_GLFW_X11 OR _GLFW_WAYLAND)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (APPLE)
|
# Workaround for CMake not knowing about .m files before version 3.16
|
||||||
# For some reason CMake didn't know about .m until version 3.16
|
if (CMAKE_VERSION VERSION_LESS "3.16" AND APPLE)
|
||||||
set_source_files_properties(cocoa_init.m cocoa_joystick.m cocoa_monitor.m
|
set_source_files_properties(cocoa_init.m cocoa_joystick.m cocoa_monitor.m
|
||||||
cocoa_window.m nsgl_context.m PROPERTIES
|
cocoa_window.m nsgl_context.m PROPERTIES
|
||||||
LANGUAGE C)
|
LANGUAGE C)
|
||||||
@@ -87,8 +87,8 @@ set_target_properties(glfw PROPERTIES
|
|||||||
POSITION_INDEPENDENT_CODE ON
|
POSITION_INDEPENDENT_CODE ON
|
||||||
FOLDER "GLFW3")
|
FOLDER "GLFW3")
|
||||||
|
|
||||||
if (${CMAKE_VERSION} VERSION_EQUAL "3.1.0" OR
|
if (CMAKE_VERSION VERSION_EQUAL "3.1.0" OR
|
||||||
${CMAKE_VERSION} VERSION_GREATER "3.1.0")
|
CMAKE_VERSION VERSION_GREATER "3.1.0")
|
||||||
|
|
||||||
set_target_properties(glfw PROPERTIES C_STANDARD 99)
|
set_target_properties(glfw PROPERTIES C_STANDARD 99)
|
||||||
else()
|
else()
|
||||||
@@ -109,22 +109,31 @@ target_include_directories(glfw PRIVATE
|
|||||||
${glfw_INCLUDE_DIRS})
|
${glfw_INCLUDE_DIRS})
|
||||||
target_link_libraries(glfw PRIVATE ${glfw_LIBRARIES})
|
target_link_libraries(glfw PRIVATE ${glfw_LIBRARIES})
|
||||||
|
|
||||||
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR
|
# Make GCC warn about declarations that VS 2010 and 2012 won't accept for all
|
||||||
"${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR
|
# source files that VS will build (Clang ignores this because we set -std=c99)
|
||||||
"${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang")
|
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||||
|
|
||||||
# Make GCC and Clang warn about declarations that VS 2010 and 2012 won't
|
|
||||||
# accept for all source files that VS will build
|
|
||||||
set_source_files_properties(context.c init.c input.c monitor.c vulkan.c
|
set_source_files_properties(context.c init.c input.c monitor.c vulkan.c
|
||||||
window.c win32_init.c win32_joystick.c
|
window.c win32_init.c win32_joystick.c
|
||||||
win32_monitor.c win32_time.c win32_thread.c
|
win32_monitor.c win32_time.c win32_thread.c
|
||||||
win32_window.c wgl_context.c egl_context.c
|
win32_window.c wgl_context.c egl_context.c
|
||||||
osmesa_context.c PROPERTIES
|
osmesa_context.c PROPERTIES
|
||||||
COMPILE_FLAGS -Wdeclaration-after-statement)
|
COMPILE_FLAGS -Wdeclaration-after-statement)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Enable a reasonable set of warnings (no, -Wextra is not reasonable)
|
# 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")
|
target_compile_options(glfw PRIVATE "-Wall")
|
||||||
endif()
|
endif()
|
||||||
|
elseif (MSVC)
|
||||||
|
target_compile_options(glfw PRIVATE "/W3")
|
||||||
|
endif()
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
target_compile_definitions(glfw PRIVATE _UNICODE)
|
target_compile_definitions(glfw PRIVATE _UNICODE)
|
||||||
@@ -159,9 +168,6 @@ if (BUILD_SHARED_LIBS)
|
|||||||
elseif (APPLE)
|
elseif (APPLE)
|
||||||
# Add -fno-common to work around a bug in Apple's GCC
|
# Add -fno-common to work around a bug in Apple's GCC
|
||||||
target_compile_options(glfw PRIVATE "-fno-common")
|
target_compile_options(glfw PRIVATE "-fno-common")
|
||||||
|
|
||||||
set_target_properties(glfw PROPERTIES
|
|
||||||
INSTALL_NAME_DIR "${CMAKE_INSTALL_LIBDIR}")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (UNIX)
|
if (UNIX)
|
||||||
|
|||||||
+5
-3
@@ -428,9 +428,6 @@ static GLFWbool initializeTIS(void)
|
|||||||
{
|
{
|
||||||
if (_glfw.hints.init.ns.menubar)
|
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
|
// Menu bar setup must go between sharedApplication and finishLaunching
|
||||||
// in order to properly emulate the behavior of NSApplicationMain
|
// in order to properly emulate the behavior of NSApplicationMain
|
||||||
|
|
||||||
@@ -449,6 +446,11 @@ static GLFWbool initializeTIS(void)
|
|||||||
{
|
{
|
||||||
_glfw.ns.finishedLaunching = GLFW_TRUE;
|
_glfw.ns.finishedLaunching = GLFW_TRUE;
|
||||||
_glfwPlatformPostEmptyEvent();
|
_glfwPlatformPostEmptyEvent();
|
||||||
|
|
||||||
|
// In case we are unbundled, make us a proper UI application
|
||||||
|
if (_glfw.hints.init.ns.menubar)
|
||||||
|
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
|
||||||
|
|
||||||
[NSApp stop:nil];
|
[NSApp stop:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+56
-37
@@ -39,8 +39,21 @@
|
|||||||
|
|
||||||
// Get the name of the specified display, or NULL
|
// 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_iterator_t it;
|
||||||
io_service_t service;
|
io_service_t service;
|
||||||
CFDictionaryRef info;
|
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
|
// Returns the display refresh rate queried from the I/O registry
|
||||||
//
|
//
|
||||||
static double getFallbackRefreshRate(CGDirectDisplayID displayID)
|
static double getFallbackRefreshRate(CGDirectDisplayID displayID)
|
||||||
@@ -277,14 +265,20 @@ static double getFallbackRefreshRate(CGDirectDisplayID displayID)
|
|||||||
CFSTR("IOFBCurrentPixelCount"),
|
CFSTR("IOFBCurrentPixelCount"),
|
||||||
kCFAllocatorDefault,
|
kCFAllocatorDefault,
|
||||||
kNilOptions);
|
kNilOptions);
|
||||||
if (!clockRef || !countRef)
|
|
||||||
break;
|
|
||||||
|
|
||||||
uint32_t clock = 0, count = 0;
|
uint32_t clock = 0, count = 0;
|
||||||
|
|
||||||
|
if (clockRef)
|
||||||
|
{
|
||||||
CFNumberGetValue(clockRef, kCFNumberIntType, &clock);
|
CFNumberGetValue(clockRef, kCFNumberIntType, &clock);
|
||||||
CFNumberGetValue(countRef, kCFNumberIntType, &count);
|
|
||||||
CFRelease(clockRef);
|
CFRelease(clockRef);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (countRef)
|
||||||
|
{
|
||||||
|
CFNumberGetValue(countRef, kCFNumberIntType, &count);
|
||||||
CFRelease(countRef);
|
CFRelease(countRef);
|
||||||
|
}
|
||||||
|
|
||||||
if (clock > 0 && count > 0)
|
if (clock > 0 && count > 0)
|
||||||
refreshRate = clock / (double) count;
|
refreshRate = clock / (double) count;
|
||||||
@@ -328,27 +322,46 @@ void _glfwPollMonitorsNS(void)
|
|||||||
if (CGDisplayIsAsleep(displays[i]))
|
if (CGDisplayIsAsleep(displays[i]))
|
||||||
continue;
|
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
|
// HACK: Compare unit numbers instead of display IDs to work around
|
||||||
// display replacement on machines with automatic graphics
|
// display replacement on machines with automatic graphics
|
||||||
// switching
|
// switching
|
||||||
const uint32_t unitNumber = CGDisplayUnitNumber(displays[i]);
|
if (CGDisplayUnitNumber([screenNumber unsignedIntValue]) == unitNumber)
|
||||||
for (uint32_t j = 0; j < disconnectedCount; j++)
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// HACK: Compare unit numbers instead of display IDs to work around
|
||||||
|
// display replacement on machines with automatic graphics
|
||||||
|
// switching
|
||||||
|
uint32_t j;
|
||||||
|
for (j = 0; j < disconnectedCount; j++)
|
||||||
{
|
{
|
||||||
if (disconnected[j] && disconnected[j]->ns.unitNumber == unitNumber)
|
if (disconnected[j] && disconnected[j]->ns.unitNumber == unitNumber)
|
||||||
{
|
{
|
||||||
|
disconnected[j]->ns.screen = screen;
|
||||||
disconnected[j] = NULL;
|
disconnected[j] = NULL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (j < disconnectedCount)
|
||||||
|
continue;
|
||||||
|
|
||||||
const CGSize size = CGDisplayScreenSize(displays[i]);
|
const CGSize size = CGDisplayScreenSize(displays[i]);
|
||||||
char* name = getDisplayName(displays[i]);
|
char* name = getMonitorName(displays[i], screen);
|
||||||
if (!name)
|
if (!name)
|
||||||
name = _glfw_strdup("Unknown");
|
name = _glfw_strdup("Unknown");
|
||||||
|
|
||||||
_GLFWmonitor* monitor = _glfwAllocMonitor(name, size.width, size.height);
|
_GLFWmonitor* monitor = _glfwAllocMonitor(name, size.width, size.height);
|
||||||
monitor->ns.displayID = displays[i];
|
monitor->ns.displayID = displays[i];
|
||||||
monitor->ns.unitNumber = unitNumber;
|
monitor->ns.unitNumber = unitNumber;
|
||||||
|
monitor->ns.screen = screen;
|
||||||
|
|
||||||
free(name);
|
free(name);
|
||||||
|
|
||||||
@@ -457,8 +470,11 @@ void _glfwPlatformGetMonitorContentScale(_GLFWmonitor* monitor,
|
|||||||
{
|
{
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
|
|
||||||
if (!refreshMonitorScreen(monitor))
|
if (!monitor->ns.screen)
|
||||||
return;
|
{
|
||||||
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
|
"Cocoa: Cannot query content scale without screen");
|
||||||
|
}
|
||||||
|
|
||||||
const NSRect points = [monitor->ns.screen frame];
|
const NSRect points = [monitor->ns.screen frame];
|
||||||
const NSRect pixels = [monitor->ns.screen convertRectToBacking:points];
|
const NSRect pixels = [monitor->ns.screen convertRectToBacking:points];
|
||||||
@@ -477,8 +493,11 @@ void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor,
|
|||||||
{
|
{
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
|
|
||||||
if (!refreshMonitorScreen(monitor))
|
if (!monitor->ns.screen)
|
||||||
return;
|
{
|
||||||
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
|
"Cocoa: Cannot query workarea without screen");
|
||||||
|
}
|
||||||
|
|
||||||
const NSRect frameRect = [monitor->ns.screen visibleFrame];
|
const NSRect frameRect = [monitor->ns.screen visibleFrame];
|
||||||
|
|
||||||
@@ -521,7 +540,7 @@ GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Skip duplicate modes
|
// Skip duplicate modes
|
||||||
if (i < *count)
|
if (j < *count)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
(*count)++;
|
(*count)++;
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ typedef VkResult (APIENTRY *PFN_vkCreateMetalSurfaceEXT)(VkInstance,const VkMeta
|
|||||||
#define _glfw_dlclose(handle) dlclose(handle)
|
#define _glfw_dlclose(handle) dlclose(handle)
|
||||||
#define _glfw_dlsym(handle, name) dlsym(handle, name)
|
#define _glfw_dlsym(handle, name) dlsym(handle, name)
|
||||||
|
|
||||||
#define _GLFW_EGL_NATIVE_WINDOW ((EGLNativeWindowType) window->ns.view)
|
#define _GLFW_EGL_NATIVE_WINDOW ((EGLNativeWindowType) window->ns.layer)
|
||||||
#define _GLFW_EGL_NATIVE_DISPLAY EGL_DEFAULT_DISPLAY
|
#define _GLFW_EGL_NATIVE_DISPLAY EGL_DEFAULT_DISPLAY
|
||||||
|
|
||||||
#define _GLFW_PLATFORM_WINDOW_STATE _GLFWwindowNS ns
|
#define _GLFW_PLATFORM_WINDOW_STATE _GLFWwindowNS ns
|
||||||
@@ -121,6 +121,7 @@ typedef struct _GLFWwindowNS
|
|||||||
id layer;
|
id layer;
|
||||||
|
|
||||||
GLFWbool maximized;
|
GLFWbool maximized;
|
||||||
|
GLFWbool occluded;
|
||||||
GLFWbool retina;
|
GLFWbool retina;
|
||||||
|
|
||||||
// Cached window properties to filter out duplicate events
|
// Cached window properties to filter out duplicate events
|
||||||
|
|||||||
+27
-4
@@ -322,6 +322,14 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
|
|||||||
_glfwInputWindowFocus(window, GLFW_FALSE);
|
_glfwInputWindowFocus(window, GLFW_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)windowDidChangeOcclusionState:(NSNotification* )notification
|
||||||
|
{
|
||||||
|
if ([window->ns.object occlusionState] & NSWindowOcclusionStateVisible)
|
||||||
|
window->ns.occluded = GLFW_FALSE;
|
||||||
|
else
|
||||||
|
window->ns.occluded = GLFW_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
@@ -723,16 +731,26 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
|
|||||||
else
|
else
|
||||||
characters = (NSString*) string;
|
characters = (NSString*) string;
|
||||||
|
|
||||||
const NSUInteger length = [characters length];
|
NSRange range = NSMakeRange(0, [characters length]);
|
||||||
for (NSUInteger i = 0; i < length; i++)
|
while (range.length)
|
||||||
{
|
{
|
||||||
const unichar codepoint = [characters characterAtIndex:i];
|
uint32_t codepoint = 0;
|
||||||
if ((codepoint & 0xff00) == 0xf700)
|
|
||||||
|
if ([characters getBytes:&codepoint
|
||||||
|
maxLength:sizeof(codepoint)
|
||||||
|
usedLength:NULL
|
||||||
|
encoding:NSUTF32StringEncoding
|
||||||
|
options:0
|
||||||
|
range:range
|
||||||
|
remainingRange:&range])
|
||||||
|
{
|
||||||
|
if (codepoint >= 0xf700 && codepoint <= 0xf7ff)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
_glfwInputChar(window, codepoint, mods, plain);
|
_glfwInputChar(window, codepoint, mods, plain);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (void)doCommandBySelector:(SEL)selector
|
- (void)doCommandBySelector:(SEL)selector
|
||||||
{
|
{
|
||||||
@@ -901,6 +919,11 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
|||||||
}
|
}
|
||||||
else if (ctxconfig->source == GLFW_EGL_CONTEXT_API)
|
else if (ctxconfig->source == GLFW_EGL_CONTEXT_API)
|
||||||
{
|
{
|
||||||
|
// EGL implementation on macOS use CALayer* EGLNativeWindowType so we
|
||||||
|
// need to get the layer for EGL window surface creation.
|
||||||
|
[window->ns.view setWantsLayer:YES];
|
||||||
|
window->ns.layer = [window->ns.view layer];
|
||||||
|
|
||||||
if (!_glfwInitEGL())
|
if (!_glfwInitEGL())
|
||||||
return GLFW_FALSE;
|
return GLFW_FALSE;
|
||||||
if (!_glfwCreateContextEGL(window, ctxconfig, fbconfig))
|
if (!_glfwCreateContextEGL(window, ctxconfig, fbconfig))
|
||||||
|
|||||||
+1
-3
@@ -588,8 +588,7 @@ GLFWbool _glfwCreateContextEGL(_GLFWwindow* window,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set up attributes for surface creation
|
// Set up attributes for surface creation
|
||||||
{
|
index = 0;
|
||||||
int index = 0;
|
|
||||||
|
|
||||||
if (fbconfig->sRGB)
|
if (fbconfig->sRGB)
|
||||||
{
|
{
|
||||||
@@ -598,7 +597,6 @@ GLFWbool _glfwCreateContextEGL(_GLFWwindow* window,
|
|||||||
}
|
}
|
||||||
|
|
||||||
setAttrib(EGL_NONE, EGL_NONE);
|
setAttrib(EGL_NONE, EGL_NONE);
|
||||||
}
|
|
||||||
|
|
||||||
window->context.egl.surface =
|
window->context.egl.surface =
|
||||||
eglCreateWindowSurface(_glfw.egl.display,
|
eglCreateWindowSurface(_glfw.egl.display,
|
||||||
|
|||||||
+1
-1
@@ -51,7 +51,7 @@ static void swapBuffersNSGL(_GLFWwindow* window)
|
|||||||
|
|
||||||
// HACK: Simulate vsync with usleep as NSGL swap interval does not apply to
|
// HACK: Simulate vsync with usleep as NSGL swap interval does not apply to
|
||||||
// windows with a non-visible occlusion state
|
// windows with a non-visible occlusion state
|
||||||
if (!([window->ns.object occlusionState] & NSWindowOcclusionStateVisible))
|
if (window->ns.occluded)
|
||||||
{
|
{
|
||||||
int interval = 0;
|
int interval = 0;
|
||||||
[window->context.nsgl.object getValues:&interval
|
[window->context.nsgl.object getValues:&interval
|
||||||
|
|||||||
@@ -104,10 +104,6 @@ typedef BOOL (WINAPI * PFN_wglShareLists)(HGLRC,HGLRC);
|
|||||||
#define wglMakeCurrent _glfw.wgl.MakeCurrent
|
#define wglMakeCurrent _glfw.wgl.MakeCurrent
|
||||||
#define wglShareLists _glfw.wgl.ShareLists
|
#define wglShareLists _glfw.wgl.ShareLists
|
||||||
|
|
||||||
#define _GLFW_RECREATION_NOT_NEEDED 0
|
|
||||||
#define _GLFW_RECREATION_REQUIRED 1
|
|
||||||
#define _GLFW_RECREATION_IMPOSSIBLE 2
|
|
||||||
|
|
||||||
#define _GLFW_PLATFORM_CONTEXT_STATE _GLFWcontextWGL wgl
|
#define _GLFW_PLATFORM_CONTEXT_STATE _GLFWcontextWGL wgl
|
||||||
#define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE _GLFWlibraryWGL wgl
|
#define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE _GLFWlibraryWGL wgl
|
||||||
|
|
||||||
|
|||||||
@@ -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_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
|
// Executables (but not DLLs) exporting this symbol with this value will be
|
||||||
// automatically directed to the high-performance GPU on Nvidia Optimus systems
|
// automatically directed to the high-performance GPU on Nvidia Optimus systems
|
||||||
// with up-to-date drivers
|
// with up-to-date drivers
|
||||||
@@ -143,6 +147,8 @@ static GLFWbool loadLibraries(void)
|
|||||||
GetProcAddress(_glfw.win32.dwmapi.instance, "DwmFlush");
|
GetProcAddress(_glfw.win32.dwmapi.instance, "DwmFlush");
|
||||||
_glfw.win32.dwmapi.EnableBlurBehindWindow = (PFN_DwmEnableBlurBehindWindow)
|
_glfw.win32.dwmapi.EnableBlurBehindWindow = (PFN_DwmEnableBlurBehindWindow)
|
||||||
GetProcAddress(_glfw.win32.dwmapi.instance, "DwmEnableBlurBehindWindow");
|
GetProcAddress(_glfw.win32.dwmapi.instance, "DwmEnableBlurBehindWindow");
|
||||||
|
_glfw.win32.dwmapi.GetColorizationColor = (PFN_DwmGetColorizationColor)
|
||||||
|
GetProcAddress(_glfw.win32.dwmapi.instance, "DwmGetColorizationColor");
|
||||||
}
|
}
|
||||||
|
|
||||||
_glfw.win32.shcore.instance = LoadLibraryA("shcore.dll");
|
_glfw.win32.shcore.instance = LoadLibraryA("shcore.dll");
|
||||||
|
|||||||
@@ -356,7 +356,7 @@ static BOOL CALLBACK deviceCallback(const DIDEVICEINSTANCE* di, void* user)
|
|||||||
|
|
||||||
for (jid = 0; jid <= GLFW_JOYSTICK_LAST; jid++)
|
for (jid = 0; jid <= GLFW_JOYSTICK_LAST; jid++)
|
||||||
{
|
{
|
||||||
_GLFWjoystick* js = _glfw.joysticks + jid;
|
js = _glfw.joysticks + jid;
|
||||||
if (js->present)
|
if (js->present)
|
||||||
{
|
{
|
||||||
if (memcmp(&js->win32.guid, &di->guidInstance, sizeof(GUID)) == 0)
|
if (memcmp(&js->win32.guid, &di->guidInstance, sizeof(GUID)) == 0)
|
||||||
@@ -672,11 +672,11 @@ int _glfwPlatformPollJoystick(_GLFWjoystick* js, int mode)
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Screams of horror are appropriate at this point
|
// Screams of horror are appropriate at this point
|
||||||
int state = LOWORD(*(DWORD*) data) / (45 * DI_DEGREES);
|
int stateIndex = LOWORD(*(DWORD*) data) / (45 * DI_DEGREES);
|
||||||
if (state < 0 || state > 8)
|
if (stateIndex < 0 || stateIndex > 8)
|
||||||
state = 8;
|
stateIndex = 8;
|
||||||
|
|
||||||
_glfwInputJoystickHat(js, pi, states[state]);
|
_glfwInputJoystickHat(js, pi, states[stateIndex]);
|
||||||
pi++;
|
pi++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -185,6 +185,8 @@ void _glfwPollMonitorsWin32(void)
|
|||||||
display.DeviceName) == 0)
|
display.DeviceName) == 0)
|
||||||
{
|
{
|
||||||
disconnected[i] = NULL;
|
disconnected[i] = NULL;
|
||||||
|
// handle may have changed, update
|
||||||
|
EnumDisplayMonitors(NULL, NULL, monitorCallback, (LPARAM) _glfw.monitors[i]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-1
@@ -77,6 +77,9 @@
|
|||||||
#ifndef WM_DWMCOMPOSITIONCHANGED
|
#ifndef WM_DWMCOMPOSITIONCHANGED
|
||||||
#define WM_DWMCOMPOSITIONCHANGED 0x031E
|
#define WM_DWMCOMPOSITIONCHANGED 0x031E
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef WM_DWMCOLORIZATIONCOLORCHANGED
|
||||||
|
#define WM_DWMCOLORIZATIONCOLORCHANGED 0x0320
|
||||||
|
#endif
|
||||||
#ifndef WM_COPYGLOBALDATA
|
#ifndef WM_COPYGLOBALDATA
|
||||||
#define WM_COPYGLOBALDATA 0x0049
|
#define WM_COPYGLOBALDATA 0x0049
|
||||||
#endif
|
#endif
|
||||||
@@ -99,7 +102,7 @@
|
|||||||
#define DISPLAY_DEVICE_ACTIVE 0x00000001
|
#define DISPLAY_DEVICE_ACTIVE 0x00000001
|
||||||
#endif
|
#endif
|
||||||
#ifndef _WIN32_WINNT_WINBLUE
|
#ifndef _WIN32_WINNT_WINBLUE
|
||||||
#define _WIN32_WINNT_WINBLUE 0x0602
|
#define _WIN32_WINNT_WINBLUE 0x0603
|
||||||
#endif
|
#endif
|
||||||
#ifndef _WIN32_WINNT_WIN8
|
#ifndef _WIN32_WINNT_WIN8
|
||||||
#define _WIN32_WINNT_WIN8 0x0602
|
#define _WIN32_WINNT_WIN8 0x0602
|
||||||
@@ -247,9 +250,11 @@ typedef BOOL (WINAPI * PFN_AdjustWindowRectExForDpi)(LPRECT,DWORD,BOOL,DWORD,UIN
|
|||||||
typedef HRESULT (WINAPI * PFN_DwmIsCompositionEnabled)(BOOL*);
|
typedef HRESULT (WINAPI * PFN_DwmIsCompositionEnabled)(BOOL*);
|
||||||
typedef HRESULT (WINAPI * PFN_DwmFlush)(VOID);
|
typedef HRESULT (WINAPI * PFN_DwmFlush)(VOID);
|
||||||
typedef HRESULT(WINAPI * PFN_DwmEnableBlurBehindWindow)(HWND,const DWM_BLURBEHIND*);
|
typedef HRESULT(WINAPI * PFN_DwmEnableBlurBehindWindow)(HWND,const DWM_BLURBEHIND*);
|
||||||
|
typedef HRESULT (WINAPI * PFN_DwmGetColorizationColor)(DWORD*,BOOL*);
|
||||||
#define DwmIsCompositionEnabled _glfw.win32.dwmapi.IsCompositionEnabled
|
#define DwmIsCompositionEnabled _glfw.win32.dwmapi.IsCompositionEnabled
|
||||||
#define DwmFlush _glfw.win32.dwmapi.Flush
|
#define DwmFlush _glfw.win32.dwmapi.Flush
|
||||||
#define DwmEnableBlurBehindWindow _glfw.win32.dwmapi.EnableBlurBehindWindow
|
#define DwmEnableBlurBehindWindow _glfw.win32.dwmapi.EnableBlurBehindWindow
|
||||||
|
#define DwmGetColorizationColor _glfw.win32.dwmapi.GetColorizationColor
|
||||||
|
|
||||||
// shcore.dll function pointer typedefs
|
// shcore.dll function pointer typedefs
|
||||||
typedef HRESULT (WINAPI * PFN_SetProcessDpiAwareness)(PROCESS_DPI_AWARENESS);
|
typedef HRESULT (WINAPI * PFN_SetProcessDpiAwareness)(PROCESS_DPI_AWARENESS);
|
||||||
@@ -316,8 +321,13 @@ typedef struct _GLFWwindowWin32
|
|||||||
GLFWbool transparent;
|
GLFWbool transparent;
|
||||||
GLFWbool scaleToMonitor;
|
GLFWbool scaleToMonitor;
|
||||||
|
|
||||||
|
// Cached size used to filter out duplicate events
|
||||||
|
int width, height;
|
||||||
|
|
||||||
// The last received cursor position, regardless of source
|
// The last received cursor position, regardless of source
|
||||||
int lastCursorPosX, lastCursorPosY;
|
int lastCursorPosX, lastCursorPosY;
|
||||||
|
// The last recevied high surrogate when decoding pairs of UTF-16 messages
|
||||||
|
WCHAR highSurrogate;
|
||||||
|
|
||||||
} _GLFWwindowWin32;
|
} _GLFWwindowWin32;
|
||||||
|
|
||||||
@@ -373,6 +383,7 @@ typedef struct _GLFWlibraryWin32
|
|||||||
PFN_DwmIsCompositionEnabled IsCompositionEnabled;
|
PFN_DwmIsCompositionEnabled IsCompositionEnabled;
|
||||||
PFN_DwmFlush Flush;
|
PFN_DwmFlush Flush;
|
||||||
PFN_DwmEnableBlurBehindWindow EnableBlurBehindWindow;
|
PFN_DwmEnableBlurBehindWindow EnableBlurBehindWindow;
|
||||||
|
PFN_DwmGetColorizationColor GetColorizationColor;
|
||||||
} dwmapi;
|
} dwmapi;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
|||||||
+88
-41
@@ -377,12 +377,17 @@ static void updateWindowStyles(const _GLFWwindow* window)
|
|||||||
//
|
//
|
||||||
static void updateFramebufferTransparency(const _GLFWwindow* window)
|
static void updateFramebufferTransparency(const _GLFWwindow* window)
|
||||||
{
|
{
|
||||||
BOOL enabled;
|
BOOL composition, opaque;
|
||||||
|
DWORD color;
|
||||||
|
|
||||||
if (!IsWindowsVistaOrGreater())
|
if (!IsWindowsVistaOrGreater())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled)
|
if (FAILED(DwmIsCompositionEnabled(&composition)) || !composition)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (IsWindows8OrGreater() ||
|
||||||
|
(SUCCEEDED(DwmGetColorizationColor(&color, &opaque)) && !opaque))
|
||||||
{
|
{
|
||||||
HRGN region = CreateRectRgn(0, 0, -1, -1);
|
HRGN region = CreateRectRgn(0, 0, -1, -1);
|
||||||
DWM_BLURBEHIND bb = {0};
|
DWM_BLURBEHIND bb = {0};
|
||||||
@@ -390,37 +395,18 @@ static void updateFramebufferTransparency(const _GLFWwindow* window)
|
|||||||
bb.hRgnBlur = region;
|
bb.hRgnBlur = region;
|
||||||
bb.fEnable = TRUE;
|
bb.fEnable = TRUE;
|
||||||
|
|
||||||
if (SUCCEEDED(DwmEnableBlurBehindWindow(window->win32.handle, &bb)))
|
DwmEnableBlurBehindWindow(window->win32.handle, &bb);
|
||||||
{
|
|
||||||
// Decorated windows don't repaint the transparent background
|
|
||||||
// leaving a trail behind animations
|
|
||||||
// HACK: Making the window layered with a transparency color key
|
|
||||||
// seems to fix this. Normally, when specifying
|
|
||||||
// a transparency color key to be used when composing the
|
|
||||||
// layered window, all pixels painted by the window in this
|
|
||||||
// color will be transparent. That doesn't seem to be the
|
|
||||||
// case anymore, at least when used with blur behind window
|
|
||||||
// plus negative region.
|
|
||||||
LONG exStyle = GetWindowLongW(window->win32.handle, GWL_EXSTYLE);
|
|
||||||
exStyle |= WS_EX_LAYERED;
|
|
||||||
SetWindowLongW(window->win32.handle, GWL_EXSTYLE, exStyle);
|
|
||||||
|
|
||||||
// Using a color key not equal to black to fix the trailing
|
|
||||||
// issue. When set to black, something is making the hit test
|
|
||||||
// not resize with the window frame.
|
|
||||||
SetLayeredWindowAttributes(window->win32.handle,
|
|
||||||
RGB(255, 0, 255), 255, LWA_COLORKEY);
|
|
||||||
}
|
|
||||||
|
|
||||||
DeleteObject(region);
|
DeleteObject(region);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LONG exStyle = GetWindowLongW(window->win32.handle, GWL_EXSTYLE);
|
// HACK: Disable framebuffer transparency on Windows 7 when the
|
||||||
exStyle &= ~WS_EX_LAYERED;
|
// colorization color is opaque, because otherwise the window
|
||||||
SetWindowLongW(window->win32.handle, GWL_EXSTYLE, exStyle);
|
// contents is blended additively with the previous frame instead
|
||||||
RedrawWindow(window->win32.handle, NULL, NULL,
|
// of replacing it
|
||||||
RDW_ERASE | RDW_INVALIDATE | RDW_FRAME);
|
DWM_BLURBEHIND bb = {0};
|
||||||
|
bb.dwFlags = DWM_BB_ENABLE;
|
||||||
|
DwmEnableBlurBehindWindow(window->win32.handle, &bb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -519,7 +505,17 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
|||||||
case WM_NCCREATE:
|
case WM_NCCREATE:
|
||||||
{
|
{
|
||||||
if (_glfwIsWindows10AnniversaryUpdateOrGreaterWin32())
|
if (_glfwIsWindows10AnniversaryUpdateOrGreaterWin32())
|
||||||
|
{
|
||||||
|
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);
|
EnableNonClientDpiScaling(hWnd);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -645,11 +641,35 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
|||||||
|
|
||||||
case WM_CHAR:
|
case WM_CHAR:
|
||||||
case WM_SYSCHAR:
|
case WM_SYSCHAR:
|
||||||
|
{
|
||||||
|
if (wParam >= 0xd800 && wParam <= 0xdbff)
|
||||||
|
window->win32.highSurrogate = (WCHAR) wParam;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unsigned int codepoint = 0;
|
||||||
|
|
||||||
|
if (wParam >= 0xdc00 && wParam <= 0xdfff)
|
||||||
|
{
|
||||||
|
if (window->win32.highSurrogate)
|
||||||
|
{
|
||||||
|
codepoint += (window->win32.highSurrogate - 0xd800) << 10;
|
||||||
|
codepoint += (WCHAR) wParam - 0xdc00;
|
||||||
|
codepoint += 0x10000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
codepoint = (WCHAR) wParam;
|
||||||
|
|
||||||
|
window->win32.highSurrogate = 0;
|
||||||
|
_glfwInputChar(window, codepoint, getKeyMods(), uMsg != WM_SYSCHAR);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
case WM_UNICHAR:
|
case WM_UNICHAR:
|
||||||
{
|
{
|
||||||
const GLFWbool plain = (uMsg != WM_SYSCHAR);
|
if (wParam == UNICODE_NOCHAR)
|
||||||
|
|
||||||
if (uMsg == WM_UNICHAR && wParam == UNICODE_NOCHAR)
|
|
||||||
{
|
{
|
||||||
// WM_UNICHAR is not sent by Windows, but is sent by some
|
// WM_UNICHAR is not sent by Windows, but is sent by some
|
||||||
// third-party input method engine
|
// third-party input method engine
|
||||||
@@ -657,7 +677,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
_glfwInputChar(window, (unsigned int) wParam, getKeyMods(), plain);
|
_glfwInputChar(window, (unsigned int) wParam, getKeyMods(), GLFW_TRUE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -944,6 +964,8 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
|||||||
|
|
||||||
case WM_SIZE:
|
case WM_SIZE:
|
||||||
{
|
{
|
||||||
|
const int width = LOWORD(lParam);
|
||||||
|
const int height = HIWORD(lParam);
|
||||||
const GLFWbool iconified = wParam == SIZE_MINIMIZED;
|
const GLFWbool iconified = wParam == SIZE_MINIMIZED;
|
||||||
const GLFWbool maximized = wParam == SIZE_MAXIMIZED ||
|
const GLFWbool maximized = wParam == SIZE_MAXIMIZED ||
|
||||||
(window->win32.maximized &&
|
(window->win32.maximized &&
|
||||||
@@ -958,8 +980,14 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
|||||||
if (window->win32.maximized != maximized)
|
if (window->win32.maximized != maximized)
|
||||||
_glfwInputWindowMaximize(window, maximized);
|
_glfwInputWindowMaximize(window, maximized);
|
||||||
|
|
||||||
_glfwInputFramebufferSize(window, LOWORD(lParam), HIWORD(lParam));
|
if (width != window->win32.width || height != window->win32.height)
|
||||||
_glfwInputWindowSize(window, LOWORD(lParam), HIWORD(lParam));
|
{
|
||||||
|
window->win32.width = width;
|
||||||
|
window->win32.height = height;
|
||||||
|
|
||||||
|
_glfwInputFramebufferSize(window, width, height);
|
||||||
|
_glfwInputWindowSize(window, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
if (window->monitor && window->win32.iconified != iconified)
|
if (window->monitor && window->win32.iconified != iconified)
|
||||||
{
|
{
|
||||||
@@ -1073,6 +1101,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
|||||||
}
|
}
|
||||||
|
|
||||||
case WM_DWMCOMPOSITIONCHANGED:
|
case WM_DWMCOMPOSITIONCHANGED:
|
||||||
|
case WM_DWMCOLORIZATIONCOLORCHANGED:
|
||||||
{
|
{
|
||||||
if (window->win32.transparent)
|
if (window->win32.transparent)
|
||||||
updateFramebufferTransparency(window);
|
updateFramebufferTransparency(window);
|
||||||
@@ -1112,9 +1141,11 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
|||||||
const float xscale = HIWORD(wParam) / (float) USER_DEFAULT_SCREEN_DPI;
|
const float xscale = HIWORD(wParam) / (float) USER_DEFAULT_SCREEN_DPI;
|
||||||
const float yscale = LOWORD(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
|
// Resize windowed mode windows that either permit rescaling or that
|
||||||
// sent a WM_GETDPISCALEDSIZE before this
|
// need it to compensate for non-client area scaling
|
||||||
if (_glfwIsWindows10CreatorsUpdateOrGreaterWin32())
|
if (!window->monitor &&
|
||||||
|
(window->win32.scaleToMonitor ||
|
||||||
|
_glfwIsWindows10CreatorsUpdateOrGreaterWin32()))
|
||||||
{
|
{
|
||||||
RECT* suggested = (RECT*) lParam;
|
RECT* suggested = (RECT*) lParam;
|
||||||
SetWindowPos(window->win32.handle, HWND_TOP,
|
SetWindowPos(window->win32.handle, HWND_TOP,
|
||||||
@@ -1229,7 +1260,7 @@ static int createNativeWindow(_GLFWwindow* window,
|
|||||||
NULL, // No parent window
|
NULL, // No parent window
|
||||||
NULL, // No window menu
|
NULL, // No window menu
|
||||||
GetModuleHandleW(NULL),
|
GetModuleHandleW(NULL),
|
||||||
NULL);
|
(LPVOID) wndconfig);
|
||||||
|
|
||||||
free(wideTitle);
|
free(wideTitle);
|
||||||
|
|
||||||
@@ -1296,6 +1327,8 @@ static int createNativeWindow(_GLFWwindow* window,
|
|||||||
window->win32.transparent = GLFW_TRUE;
|
window->win32.transparent = GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_glfwPlatformGetWindowSize(window, &window->win32.width, &window->win32.height);
|
||||||
|
|
||||||
return GLFW_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1797,7 +1830,8 @@ int _glfwPlatformWindowHovered(_GLFWwindow* window)
|
|||||||
|
|
||||||
int _glfwPlatformFramebufferTransparent(_GLFWwindow* window)
|
int _glfwPlatformFramebufferTransparent(_GLFWwindow* window)
|
||||||
{
|
{
|
||||||
BOOL enabled;
|
BOOL composition, opaque;
|
||||||
|
DWORD color;
|
||||||
|
|
||||||
if (!window->win32.transparent)
|
if (!window->win32.transparent)
|
||||||
return GLFW_FALSE;
|
return GLFW_FALSE;
|
||||||
@@ -1805,7 +1839,20 @@ int _glfwPlatformFramebufferTransparent(_GLFWwindow* window)
|
|||||||
if (!IsWindowsVistaOrGreater())
|
if (!IsWindowsVistaOrGreater())
|
||||||
return GLFW_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
return SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled;
|
if (FAILED(DwmIsCompositionEnabled(&composition)) || !composition)
|
||||||
|
return GLFW_FALSE;
|
||||||
|
|
||||||
|
if (!IsWindows8OrGreater())
|
||||||
|
{
|
||||||
|
// HACK: Disable framebuffer transparency on Windows 7 when the
|
||||||
|
// colorization color is opaque, because otherwise the window
|
||||||
|
// contents is blended additively with the previous frame instead
|
||||||
|
// of replacing it
|
||||||
|
if (FAILED(DwmGetColorizationColor(&color, &opaque)) || opaque)
|
||||||
|
return GLFW_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwPlatformSetWindowResizable(_GLFWwindow* window, GLFWbool enabled)
|
void _glfwPlatformSetWindowResizable(_GLFWwindow* window, GLFWbool enabled)
|
||||||
|
|||||||
@@ -1099,3 +1099,4 @@ GLFWAPI void glfwPostEmptyEvent(void)
|
|||||||
_GLFW_REQUIRE_INIT();
|
_GLFW_REQUIRE_INIT();
|
||||||
_glfwPlatformPostEmptyEvent();
|
_glfwPlatformPostEmptyEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -347,9 +347,9 @@ static void pointerHandleAxis(void* data,
|
|||||||
axis == WL_POINTER_AXIS_VERTICAL_SCROLL);
|
axis == WL_POINTER_AXIS_VERTICAL_SCROLL);
|
||||||
|
|
||||||
if (axis == WL_POINTER_AXIS_HORIZONTAL_SCROLL)
|
if (axis == WL_POINTER_AXIS_HORIZONTAL_SCROLL)
|
||||||
x = wl_fixed_to_double(value) * scrollFactor;
|
x = -wl_fixed_to_double(value) * scrollFactor;
|
||||||
else if (axis == WL_POINTER_AXIS_VERTICAL_SCROLL)
|
else if (axis == WL_POINTER_AXIS_VERTICAL_SCROLL)
|
||||||
y = wl_fixed_to_double(value) * scrollFactor;
|
y = -wl_fixed_to_double(value) * scrollFactor;
|
||||||
|
|
||||||
_glfwInputScroll(window, x, y);
|
_glfwInputScroll(window, x, y);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,6 +88,14 @@ static void outputHandleDone(void* data, struct wl_output* output)
|
|||||||
{
|
{
|
||||||
struct _GLFWmonitor *monitor = data;
|
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);
|
_glfwInputMonitor(monitor, GLFW_CONNECTED, _GLFW_INSERT_LAST);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+16
-7
@@ -208,8 +208,8 @@ static struct wl_buffer* createShmBuffer(const GLFWimage* image)
|
|||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Wayland: Creating a buffer file for %d B failed: %m",
|
"Wayland: Creating a buffer file for %d B failed: %s",
|
||||||
length);
|
length, strerror(errno));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -217,7 +217,7 @@ static struct wl_buffer* createShmBuffer(const GLFWimage* image)
|
|||||||
if (data == MAP_FAILED)
|
if (data == MAP_FAILED)
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Wayland: mmap failed: %m");
|
"Wayland: mmap failed: %s", strerror(errno));
|
||||||
close(fd);
|
close(fd);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -312,10 +312,10 @@ static void createDecorations(_GLFWwindow* window)
|
|||||||
|
|
||||||
static void destroyDecoration(_GLFWdecorationWayland* decoration)
|
static void destroyDecoration(_GLFWdecorationWayland* decoration)
|
||||||
{
|
{
|
||||||
if (decoration->surface)
|
|
||||||
wl_surface_destroy(decoration->surface);
|
|
||||||
if (decoration->subsurface)
|
if (decoration->subsurface)
|
||||||
wl_subsurface_destroy(decoration->subsurface);
|
wl_subsurface_destroy(decoration->subsurface);
|
||||||
|
if (decoration->surface)
|
||||||
|
wl_surface_destroy(decoration->surface);
|
||||||
if (decoration->viewport)
|
if (decoration->viewport)
|
||||||
wp_viewport_destroy(decoration->viewport);
|
wp_viewport_destroy(decoration->viewport);
|
||||||
decoration->surface = NULL;
|
decoration->surface = NULL;
|
||||||
@@ -870,11 +870,18 @@ static void handleEvents(int timeout)
|
|||||||
if (read_ret != 8)
|
if (read_ret != 8)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (_glfw.wl.keyboardFocus)
|
||||||
|
{
|
||||||
for (i = 0; i < repeats; ++i)
|
for (i = 0; i < repeats; ++i)
|
||||||
_glfwInputKey(_glfw.wl.keyboardFocus, _glfw.wl.keyboardLastKey,
|
{
|
||||||
_glfw.wl.keyboardLastScancode, GLFW_REPEAT,
|
_glfwInputKey(_glfw.wl.keyboardFocus,
|
||||||
|
_glfw.wl.keyboardLastKey,
|
||||||
|
_glfw.wl.keyboardLastScancode,
|
||||||
|
GLFW_REPEAT,
|
||||||
_glfw.wl.xkb.modifiers);
|
_glfw.wl.xkb.modifiers);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (fds[2].revents & POLLIN)
|
if (fds[2].revents & POLLIN)
|
||||||
{
|
{
|
||||||
@@ -1111,7 +1118,9 @@ void _glfwPlatformGetFramebufferSize(_GLFWwindow* window,
|
|||||||
int* width, int* height)
|
int* width, int* height)
|
||||||
{
|
{
|
||||||
_glfwPlatformGetWindowSize(window, width, height);
|
_glfwPlatformGetWindowSize(window, width, height);
|
||||||
|
if (width)
|
||||||
*width *= window->wl.scale;
|
*width *= window->wl.scale;
|
||||||
|
if (height)
|
||||||
*height *= window->wl.scale;
|
*height *= window->wl.scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+223
-118
@@ -38,24 +38,15 @@
|
|||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
|
|
||||||
|
|
||||||
// Translate an X11 key code to a GLFW key code.
|
// Translate the X11 KeySyms for a key to a GLFW key code
|
||||||
|
// NOTE: This is only used as a fallback, in case the XKB method fails
|
||||||
|
// It is layout-dependent and will fail partially on most non-US layouts
|
||||||
//
|
//
|
||||||
static int translateKeyCode(int scancode)
|
static int translateKeySyms(const KeySym* keysyms, int width)
|
||||||
{
|
{
|
||||||
int keySym;
|
if (width > 1)
|
||||||
|
|
||||||
// Valid key code range is [8,255], according to the Xlib manual
|
|
||||||
if (scancode < 8 || scancode > 255)
|
|
||||||
return GLFW_KEY_UNKNOWN;
|
|
||||||
|
|
||||||
if (_glfw.x11.xkb.available)
|
|
||||||
{
|
{
|
||||||
// Try secondary keysym, for numeric keypad keys
|
switch (keysyms[1])
|
||||||
// Note: This way we always force "NumLock = ON", which is intentional
|
|
||||||
// since the returned key code should correspond to a physical
|
|
||||||
// location.
|
|
||||||
keySym = XkbKeycodeToKeysym(_glfw.x11.display, scancode, _glfw.x11.xkb.group, 1);
|
|
||||||
switch (keySym)
|
|
||||||
{
|
{
|
||||||
case XK_KP_0: return GLFW_KEY_KP_0;
|
case XK_KP_0: return GLFW_KEY_KP_0;
|
||||||
case XK_KP_1: return GLFW_KEY_KP_1;
|
case XK_KP_1: return GLFW_KEY_KP_1;
|
||||||
@@ -73,22 +64,9 @@ static int translateKeyCode(int scancode)
|
|||||||
case XK_KP_Enter: return GLFW_KEY_KP_ENTER;
|
case XK_KP_Enter: return GLFW_KEY_KP_ENTER;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now try primary keysym for function keys (non-printable keys)
|
|
||||||
// These should not depend on the current keyboard layout
|
|
||||||
keySym = XkbKeycodeToKeysym(_glfw.x11.display, scancode, _glfw.x11.xkb.group, 0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int dummy;
|
|
||||||
KeySym* keySyms;
|
|
||||||
|
|
||||||
keySyms = XGetKeyboardMapping(_glfw.x11.display, scancode, 1, &dummy);
|
|
||||||
keySym = keySyms[0];
|
|
||||||
XFree(keySyms);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (keySym)
|
switch (keysyms[0])
|
||||||
{
|
{
|
||||||
case XK_Escape: return GLFW_KEY_ESCAPE;
|
case XK_Escape: return GLFW_KEY_ESCAPE;
|
||||||
case XK_Tab: return GLFW_KEY_TAB;
|
case XK_Tab: return GLFW_KEY_TAB;
|
||||||
@@ -232,7 +210,7 @@ static int translateKeyCode(int scancode)
|
|||||||
//
|
//
|
||||||
static void createKeyTables(void)
|
static void createKeyTables(void)
|
||||||
{
|
{
|
||||||
int scancode, key;
|
int scancode, scancodeMin, scancodeMax;
|
||||||
|
|
||||||
memset(_glfw.x11.keycodes, -1, sizeof(_glfw.x11.keycodes));
|
memset(_glfw.x11.keycodes, -1, sizeof(_glfw.x11.keycodes));
|
||||||
memset(_glfw.x11.scancodes, -1, sizeof(_glfw.x11.scancodes));
|
memset(_glfw.x11.scancodes, -1, sizeof(_glfw.x11.scancodes));
|
||||||
@@ -242,89 +220,217 @@ static void createKeyTables(void)
|
|||||||
// Use XKB to determine physical key locations independently of the
|
// Use XKB to determine physical key locations independently of the
|
||||||
// current keyboard layout
|
// current keyboard layout
|
||||||
|
|
||||||
char name[XkbKeyNameLength + 1];
|
|
||||||
XkbDescPtr desc = XkbGetMap(_glfw.x11.display, 0, XkbUseCoreKbd);
|
XkbDescPtr desc = XkbGetMap(_glfw.x11.display, 0, XkbUseCoreKbd);
|
||||||
XkbGetNames(_glfw.x11.display, XkbKeyNamesMask, desc);
|
XkbGetNames(_glfw.x11.display, XkbKeyNamesMask | XkbKeyAliasesMask, desc);
|
||||||
|
|
||||||
|
scancodeMin = desc->min_key_code;
|
||||||
|
scancodeMax = desc->max_key_code;
|
||||||
|
|
||||||
|
const struct
|
||||||
|
{
|
||||||
|
int key;
|
||||||
|
char* name;
|
||||||
|
} keymap[] =
|
||||||
|
{
|
||||||
|
{ GLFW_KEY_GRAVE_ACCENT, "TLDE" },
|
||||||
|
{ GLFW_KEY_1, "AE01" },
|
||||||
|
{ GLFW_KEY_2, "AE02" },
|
||||||
|
{ GLFW_KEY_3, "AE03" },
|
||||||
|
{ GLFW_KEY_4, "AE04" },
|
||||||
|
{ GLFW_KEY_5, "AE05" },
|
||||||
|
{ GLFW_KEY_6, "AE06" },
|
||||||
|
{ GLFW_KEY_7, "AE07" },
|
||||||
|
{ GLFW_KEY_8, "AE08" },
|
||||||
|
{ GLFW_KEY_9, "AE09" },
|
||||||
|
{ GLFW_KEY_0, "AE10" },
|
||||||
|
{ GLFW_KEY_MINUS, "AE11" },
|
||||||
|
{ GLFW_KEY_EQUAL, "AE12" },
|
||||||
|
{ GLFW_KEY_Q, "AD01" },
|
||||||
|
{ GLFW_KEY_W, "AD02" },
|
||||||
|
{ GLFW_KEY_E, "AD03" },
|
||||||
|
{ GLFW_KEY_R, "AD04" },
|
||||||
|
{ GLFW_KEY_T, "AD05" },
|
||||||
|
{ GLFW_KEY_Y, "AD06" },
|
||||||
|
{ GLFW_KEY_U, "AD07" },
|
||||||
|
{ GLFW_KEY_I, "AD08" },
|
||||||
|
{ GLFW_KEY_O, "AD09" },
|
||||||
|
{ GLFW_KEY_P, "AD10" },
|
||||||
|
{ GLFW_KEY_LEFT_BRACKET, "AD11" },
|
||||||
|
{ GLFW_KEY_RIGHT_BRACKET, "AD12" },
|
||||||
|
{ GLFW_KEY_A, "AC01" },
|
||||||
|
{ GLFW_KEY_S, "AC02" },
|
||||||
|
{ GLFW_KEY_D, "AC03" },
|
||||||
|
{ GLFW_KEY_F, "AC04" },
|
||||||
|
{ GLFW_KEY_G, "AC05" },
|
||||||
|
{ GLFW_KEY_H, "AC06" },
|
||||||
|
{ GLFW_KEY_J, "AC07" },
|
||||||
|
{ GLFW_KEY_K, "AC08" },
|
||||||
|
{ GLFW_KEY_L, "AC09" },
|
||||||
|
{ GLFW_KEY_SEMICOLON, "AC10" },
|
||||||
|
{ GLFW_KEY_APOSTROPHE, "AC11" },
|
||||||
|
{ GLFW_KEY_Z, "AB01" },
|
||||||
|
{ GLFW_KEY_X, "AB02" },
|
||||||
|
{ GLFW_KEY_C, "AB03" },
|
||||||
|
{ GLFW_KEY_V, "AB04" },
|
||||||
|
{ GLFW_KEY_B, "AB05" },
|
||||||
|
{ GLFW_KEY_N, "AB06" },
|
||||||
|
{ GLFW_KEY_M, "AB07" },
|
||||||
|
{ GLFW_KEY_COMMA, "AB08" },
|
||||||
|
{ GLFW_KEY_PERIOD, "AB09" },
|
||||||
|
{ GLFW_KEY_SLASH, "AB10" },
|
||||||
|
{ GLFW_KEY_BACKSLASH, "BKSL" },
|
||||||
|
{ GLFW_KEY_WORLD_1, "LSGT" },
|
||||||
|
{ GLFW_KEY_SPACE, "SPCE" },
|
||||||
|
{ GLFW_KEY_ESCAPE, "ESC" },
|
||||||
|
{ GLFW_KEY_ENTER, "RTRN" },
|
||||||
|
{ GLFW_KEY_TAB, "TAB" },
|
||||||
|
{ GLFW_KEY_BACKSPACE, "BKSP" },
|
||||||
|
{ GLFW_KEY_INSERT, "INS" },
|
||||||
|
{ GLFW_KEY_DELETE, "DELE" },
|
||||||
|
{ GLFW_KEY_RIGHT, "RGHT" },
|
||||||
|
{ GLFW_KEY_LEFT, "LEFT" },
|
||||||
|
{ GLFW_KEY_DOWN, "DOWN" },
|
||||||
|
{ GLFW_KEY_UP, "UP" },
|
||||||
|
{ GLFW_KEY_PAGE_UP, "PGUP" },
|
||||||
|
{ GLFW_KEY_PAGE_DOWN, "PGDN" },
|
||||||
|
{ GLFW_KEY_HOME, "HOME" },
|
||||||
|
{ GLFW_KEY_END, "END" },
|
||||||
|
{ GLFW_KEY_CAPS_LOCK, "CAPS" },
|
||||||
|
{ GLFW_KEY_SCROLL_LOCK, "SCLK" },
|
||||||
|
{ GLFW_KEY_NUM_LOCK, "NMLK" },
|
||||||
|
{ GLFW_KEY_PRINT_SCREEN, "PRSC" },
|
||||||
|
{ GLFW_KEY_PAUSE, "PAUS" },
|
||||||
|
{ GLFW_KEY_F1, "FK01" },
|
||||||
|
{ GLFW_KEY_F2, "FK02" },
|
||||||
|
{ GLFW_KEY_F3, "FK03" },
|
||||||
|
{ GLFW_KEY_F4, "FK04" },
|
||||||
|
{ GLFW_KEY_F5, "FK05" },
|
||||||
|
{ GLFW_KEY_F6, "FK06" },
|
||||||
|
{ GLFW_KEY_F7, "FK07" },
|
||||||
|
{ GLFW_KEY_F8, "FK08" },
|
||||||
|
{ GLFW_KEY_F9, "FK09" },
|
||||||
|
{ GLFW_KEY_F10, "FK10" },
|
||||||
|
{ GLFW_KEY_F11, "FK11" },
|
||||||
|
{ GLFW_KEY_F12, "FK12" },
|
||||||
|
{ GLFW_KEY_F13, "FK13" },
|
||||||
|
{ GLFW_KEY_F14, "FK14" },
|
||||||
|
{ GLFW_KEY_F15, "FK15" },
|
||||||
|
{ GLFW_KEY_F16, "FK16" },
|
||||||
|
{ GLFW_KEY_F17, "FK17" },
|
||||||
|
{ GLFW_KEY_F18, "FK18" },
|
||||||
|
{ GLFW_KEY_F19, "FK19" },
|
||||||
|
{ GLFW_KEY_F20, "FK20" },
|
||||||
|
{ GLFW_KEY_F21, "FK21" },
|
||||||
|
{ GLFW_KEY_F22, "FK22" },
|
||||||
|
{ GLFW_KEY_F23, "FK23" },
|
||||||
|
{ GLFW_KEY_F24, "FK24" },
|
||||||
|
{ GLFW_KEY_F25, "FK25" },
|
||||||
|
{ GLFW_KEY_KP_0, "KP0" },
|
||||||
|
{ GLFW_KEY_KP_1, "KP1" },
|
||||||
|
{ GLFW_KEY_KP_2, "KP2" },
|
||||||
|
{ GLFW_KEY_KP_3, "KP3" },
|
||||||
|
{ GLFW_KEY_KP_4, "KP4" },
|
||||||
|
{ GLFW_KEY_KP_5, "KP5" },
|
||||||
|
{ GLFW_KEY_KP_6, "KP6" },
|
||||||
|
{ GLFW_KEY_KP_7, "KP7" },
|
||||||
|
{ GLFW_KEY_KP_8, "KP8" },
|
||||||
|
{ GLFW_KEY_KP_9, "KP9" },
|
||||||
|
{ GLFW_KEY_KP_DECIMAL, "KPDL" },
|
||||||
|
{ GLFW_KEY_KP_DIVIDE, "KPDV" },
|
||||||
|
{ GLFW_KEY_KP_MULTIPLY, "KPMU" },
|
||||||
|
{ GLFW_KEY_KP_SUBTRACT, "KPSU" },
|
||||||
|
{ GLFW_KEY_KP_ADD, "KPAD" },
|
||||||
|
{ GLFW_KEY_KP_ENTER, "KPEN" },
|
||||||
|
{ GLFW_KEY_KP_EQUAL, "KPEQ" },
|
||||||
|
{ GLFW_KEY_LEFT_SHIFT, "LFSH" },
|
||||||
|
{ GLFW_KEY_LEFT_CONTROL, "LCTL" },
|
||||||
|
{ GLFW_KEY_LEFT_ALT, "LALT" },
|
||||||
|
{ GLFW_KEY_LEFT_SUPER, "LWIN" },
|
||||||
|
{ GLFW_KEY_RIGHT_SHIFT, "RTSH" },
|
||||||
|
{ GLFW_KEY_RIGHT_CONTROL, "RCTL" },
|
||||||
|
{ GLFW_KEY_RIGHT_ALT, "RALT" },
|
||||||
|
{ GLFW_KEY_RIGHT_ALT, "LVL3" },
|
||||||
|
{ GLFW_KEY_RIGHT_ALT, "MDSW" },
|
||||||
|
{ GLFW_KEY_RIGHT_SUPER, "RWIN" },
|
||||||
|
{ GLFW_KEY_MENU, "MENU" }
|
||||||
|
};
|
||||||
|
|
||||||
// Find the X11 key code -> GLFW key code mapping
|
// Find the X11 key code -> GLFW key code mapping
|
||||||
for (scancode = desc->min_key_code; scancode <= desc->max_key_code; scancode++)
|
for (scancode = scancodeMin; scancode <= scancodeMax; scancode++)
|
||||||
{
|
{
|
||||||
memcpy(name, desc->names->keys[scancode].name, XkbKeyNameLength);
|
int key = GLFW_KEY_UNKNOWN;
|
||||||
name[XkbKeyNameLength] = '\0';
|
|
||||||
|
|
||||||
// Map the key name to a GLFW key code. Note: We only map printable
|
// Map the key name to a GLFW key code. Note: We use the US
|
||||||
// keys here, and we use the US keyboard layout. The rest of the
|
// keyboard layout. Because function keys aren't mapped correctly
|
||||||
// keys (function keys) are mapped using traditional KeySym
|
// when using traditional KeySym translations, they are mapped
|
||||||
// translations.
|
// here instead.
|
||||||
if (strcmp(name, "TLDE") == 0) key = GLFW_KEY_GRAVE_ACCENT;
|
for (int i = 0; i < sizeof(keymap) / sizeof(keymap[0]); i++)
|
||||||
else if (strcmp(name, "AE01") == 0) key = GLFW_KEY_1;
|
{
|
||||||
else if (strcmp(name, "AE02") == 0) key = GLFW_KEY_2;
|
if (strncmp(desc->names->keys[scancode].name,
|
||||||
else if (strcmp(name, "AE03") == 0) key = GLFW_KEY_3;
|
keymap[i].name,
|
||||||
else if (strcmp(name, "AE04") == 0) key = GLFW_KEY_4;
|
XkbKeyNameLength) == 0)
|
||||||
else if (strcmp(name, "AE05") == 0) key = GLFW_KEY_5;
|
{
|
||||||
else if (strcmp(name, "AE06") == 0) key = GLFW_KEY_6;
|
key = keymap[i].key;
|
||||||
else if (strcmp(name, "AE07") == 0) key = GLFW_KEY_7;
|
break;
|
||||||
else if (strcmp(name, "AE08") == 0) key = GLFW_KEY_8;
|
}
|
||||||
else if (strcmp(name, "AE09") == 0) key = GLFW_KEY_9;
|
}
|
||||||
else if (strcmp(name, "AE10") == 0) key = GLFW_KEY_0;
|
|
||||||
else if (strcmp(name, "AE11") == 0) key = GLFW_KEY_MINUS;
|
// Fall back to key aliases in case the key name did not match
|
||||||
else if (strcmp(name, "AE12") == 0) key = GLFW_KEY_EQUAL;
|
for (int i = 0; i < desc->names->num_key_aliases; i++)
|
||||||
else if (strcmp(name, "AD01") == 0) key = GLFW_KEY_Q;
|
{
|
||||||
else if (strcmp(name, "AD02") == 0) key = GLFW_KEY_W;
|
if (key != GLFW_KEY_UNKNOWN)
|
||||||
else if (strcmp(name, "AD03") == 0) key = GLFW_KEY_E;
|
break;
|
||||||
else if (strcmp(name, "AD04") == 0) key = GLFW_KEY_R;
|
|
||||||
else if (strcmp(name, "AD05") == 0) key = GLFW_KEY_T;
|
if (strncmp(desc->names->key_aliases[i].real,
|
||||||
else if (strcmp(name, "AD06") == 0) key = GLFW_KEY_Y;
|
desc->names->keys[scancode].name,
|
||||||
else if (strcmp(name, "AD07") == 0) key = GLFW_KEY_U;
|
XkbKeyNameLength) != 0)
|
||||||
else if (strcmp(name, "AD08") == 0) key = GLFW_KEY_I;
|
{
|
||||||
else if (strcmp(name, "AD09") == 0) key = GLFW_KEY_O;
|
continue;
|
||||||
else if (strcmp(name, "AD10") == 0) key = GLFW_KEY_P;
|
}
|
||||||
else if (strcmp(name, "AD11") == 0) key = GLFW_KEY_LEFT_BRACKET;
|
|
||||||
else if (strcmp(name, "AD12") == 0) key = GLFW_KEY_RIGHT_BRACKET;
|
for (int j = 0; j < sizeof(keymap) / sizeof(keymap[0]); j++)
|
||||||
else if (strcmp(name, "AC01") == 0) key = GLFW_KEY_A;
|
{
|
||||||
else if (strcmp(name, "AC02") == 0) key = GLFW_KEY_S;
|
if (strncmp(desc->names->key_aliases[i].alias,
|
||||||
else if (strcmp(name, "AC03") == 0) key = GLFW_KEY_D;
|
keymap[j].name,
|
||||||
else if (strcmp(name, "AC04") == 0) key = GLFW_KEY_F;
|
XkbKeyNameLength) == 0)
|
||||||
else if (strcmp(name, "AC05") == 0) key = GLFW_KEY_G;
|
{
|
||||||
else if (strcmp(name, "AC06") == 0) key = GLFW_KEY_H;
|
key = keymap[j].key;
|
||||||
else if (strcmp(name, "AC07") == 0) key = GLFW_KEY_J;
|
break;
|
||||||
else if (strcmp(name, "AC08") == 0) key = GLFW_KEY_K;
|
}
|
||||||
else if (strcmp(name, "AC09") == 0) key = GLFW_KEY_L;
|
}
|
||||||
else if (strcmp(name, "AC10") == 0) key = GLFW_KEY_SEMICOLON;
|
}
|
||||||
else if (strcmp(name, "AC11") == 0) key = GLFW_KEY_APOSTROPHE;
|
|
||||||
else if (strcmp(name, "AB01") == 0) key = GLFW_KEY_Z;
|
|
||||||
else if (strcmp(name, "AB02") == 0) key = GLFW_KEY_X;
|
|
||||||
else if (strcmp(name, "AB03") == 0) key = GLFW_KEY_C;
|
|
||||||
else if (strcmp(name, "AB04") == 0) key = GLFW_KEY_V;
|
|
||||||
else if (strcmp(name, "AB05") == 0) key = GLFW_KEY_B;
|
|
||||||
else if (strcmp(name, "AB06") == 0) key = GLFW_KEY_N;
|
|
||||||
else if (strcmp(name, "AB07") == 0) key = GLFW_KEY_M;
|
|
||||||
else if (strcmp(name, "AB08") == 0) key = GLFW_KEY_COMMA;
|
|
||||||
else if (strcmp(name, "AB09") == 0) key = GLFW_KEY_PERIOD;
|
|
||||||
else if (strcmp(name, "AB10") == 0) key = GLFW_KEY_SLASH;
|
|
||||||
else if (strcmp(name, "BKSL") == 0) key = GLFW_KEY_BACKSLASH;
|
|
||||||
else if (strcmp(name, "LSGT") == 0) key = GLFW_KEY_WORLD_1;
|
|
||||||
else key = GLFW_KEY_UNKNOWN;
|
|
||||||
|
|
||||||
if ((scancode >= 0) && (scancode < 256))
|
|
||||||
_glfw.x11.keycodes[scancode] = key;
|
_glfw.x11.keycodes[scancode] = key;
|
||||||
}
|
}
|
||||||
|
|
||||||
XkbFreeNames(desc, XkbKeyNamesMask, True);
|
XkbFreeNames(desc, XkbKeyNamesMask, True);
|
||||||
XkbFreeKeyboard(desc, 0, True);
|
XkbFreeKeyboard(desc, 0, True);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
XDisplayKeycodes(_glfw.x11.display, &scancodeMin, &scancodeMax);
|
||||||
|
|
||||||
for (scancode = 0; scancode < 256; scancode++)
|
int width;
|
||||||
|
KeySym* keysyms = XGetKeyboardMapping(_glfw.x11.display,
|
||||||
|
scancodeMin,
|
||||||
|
scancodeMax - scancodeMin + 1,
|
||||||
|
&width);
|
||||||
|
|
||||||
|
for (scancode = scancodeMin; scancode <= scancodeMax; scancode++)
|
||||||
{
|
{
|
||||||
// Translate the un-translated key codes using traditional X11 KeySym
|
// Translate the un-translated key codes using traditional X11 KeySym
|
||||||
// lookups
|
// lookups
|
||||||
if (_glfw.x11.keycodes[scancode] < 0)
|
if (_glfw.x11.keycodes[scancode] < 0)
|
||||||
_glfw.x11.keycodes[scancode] = translateKeyCode(scancode);
|
{
|
||||||
|
const size_t base = (scancode - scancodeMin) * width;
|
||||||
|
_glfw.x11.keycodes[scancode] = translateKeySyms(&keysyms[base], width);
|
||||||
|
}
|
||||||
|
|
||||||
// Store the reverse translation for faster key name lookup
|
// Store the reverse translation for faster key name lookup
|
||||||
if (_glfw.x11.keycodes[scancode] > 0)
|
if (_glfw.x11.keycodes[scancode] > 0)
|
||||||
_glfw.x11.scancodes[_glfw.x11.keycodes[scancode]] = scancode;
|
_glfw.x11.scancodes[_glfw.x11.keycodes[scancode]] = scancode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XFree(keysyms);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check whether the IM has a usable style
|
// Check whether the IM has a usable style
|
||||||
@@ -352,13 +458,13 @@ static GLFWbool hasUsableInputMethodStyle(void)
|
|||||||
|
|
||||||
// Check whether the specified atom is supported
|
// Check whether the specified atom is supported
|
||||||
//
|
//
|
||||||
static Atom getSupportedAtom(Atom* supportedAtoms,
|
static Atom getAtomIfSupported(Atom* supportedAtoms,
|
||||||
unsigned long atomCount,
|
unsigned long atomCount,
|
||||||
const char* atomName)
|
const char* atomName)
|
||||||
{
|
{
|
||||||
const Atom atom = XInternAtom(_glfw.x11.display, atomName, False);
|
const Atom atom = XInternAtom(_glfw.x11.display, atomName, False);
|
||||||
|
|
||||||
for (unsigned int i = 0; i < atomCount; i++)
|
for (unsigned long i = 0; i < atomCount; i++)
|
||||||
{
|
{
|
||||||
if (supportedAtoms[i] == atom)
|
if (supportedAtoms[i] == atom)
|
||||||
return atom;
|
return atom;
|
||||||
@@ -426,33 +532,33 @@ static void detectEWMH(void)
|
|||||||
// See which of the atoms we support that are supported by the WM
|
// See which of the atoms we support that are supported by the WM
|
||||||
|
|
||||||
_glfw.x11.NET_WM_STATE =
|
_glfw.x11.NET_WM_STATE =
|
||||||
getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_STATE");
|
getAtomIfSupported(supportedAtoms, atomCount, "_NET_WM_STATE");
|
||||||
_glfw.x11.NET_WM_STATE_ABOVE =
|
_glfw.x11.NET_WM_STATE_ABOVE =
|
||||||
getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_STATE_ABOVE");
|
getAtomIfSupported(supportedAtoms, atomCount, "_NET_WM_STATE_ABOVE");
|
||||||
_glfw.x11.NET_WM_STATE_FULLSCREEN =
|
_glfw.x11.NET_WM_STATE_FULLSCREEN =
|
||||||
getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_STATE_FULLSCREEN");
|
getAtomIfSupported(supportedAtoms, atomCount, "_NET_WM_STATE_FULLSCREEN");
|
||||||
_glfw.x11.NET_WM_STATE_MAXIMIZED_VERT =
|
_glfw.x11.NET_WM_STATE_MAXIMIZED_VERT =
|
||||||
getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_STATE_MAXIMIZED_VERT");
|
getAtomIfSupported(supportedAtoms, atomCount, "_NET_WM_STATE_MAXIMIZED_VERT");
|
||||||
_glfw.x11.NET_WM_STATE_MAXIMIZED_HORZ =
|
_glfw.x11.NET_WM_STATE_MAXIMIZED_HORZ =
|
||||||
getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_STATE_MAXIMIZED_HORZ");
|
getAtomIfSupported(supportedAtoms, atomCount, "_NET_WM_STATE_MAXIMIZED_HORZ");
|
||||||
_glfw.x11.NET_WM_STATE_DEMANDS_ATTENTION =
|
_glfw.x11.NET_WM_STATE_DEMANDS_ATTENTION =
|
||||||
getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_STATE_DEMANDS_ATTENTION");
|
getAtomIfSupported(supportedAtoms, atomCount, "_NET_WM_STATE_DEMANDS_ATTENTION");
|
||||||
_glfw.x11.NET_WM_FULLSCREEN_MONITORS =
|
_glfw.x11.NET_WM_FULLSCREEN_MONITORS =
|
||||||
getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_FULLSCREEN_MONITORS");
|
getAtomIfSupported(supportedAtoms, atomCount, "_NET_WM_FULLSCREEN_MONITORS");
|
||||||
_glfw.x11.NET_WM_WINDOW_TYPE =
|
_glfw.x11.NET_WM_WINDOW_TYPE =
|
||||||
getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_WINDOW_TYPE");
|
getAtomIfSupported(supportedAtoms, atomCount, "_NET_WM_WINDOW_TYPE");
|
||||||
_glfw.x11.NET_WM_WINDOW_TYPE_NORMAL =
|
_glfw.x11.NET_WM_WINDOW_TYPE_NORMAL =
|
||||||
getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_WINDOW_TYPE_NORMAL");
|
getAtomIfSupported(supportedAtoms, atomCount, "_NET_WM_WINDOW_TYPE_NORMAL");
|
||||||
_glfw.x11.NET_WORKAREA =
|
_glfw.x11.NET_WORKAREA =
|
||||||
getSupportedAtom(supportedAtoms, atomCount, "_NET_WORKAREA");
|
getAtomIfSupported(supportedAtoms, atomCount, "_NET_WORKAREA");
|
||||||
_glfw.x11.NET_CURRENT_DESKTOP =
|
_glfw.x11.NET_CURRENT_DESKTOP =
|
||||||
getSupportedAtom(supportedAtoms, atomCount, "_NET_CURRENT_DESKTOP");
|
getAtomIfSupported(supportedAtoms, atomCount, "_NET_CURRENT_DESKTOP");
|
||||||
_glfw.x11.NET_ACTIVE_WINDOW =
|
_glfw.x11.NET_ACTIVE_WINDOW =
|
||||||
getSupportedAtom(supportedAtoms, atomCount, "_NET_ACTIVE_WINDOW");
|
getAtomIfSupported(supportedAtoms, atomCount, "_NET_ACTIVE_WINDOW");
|
||||||
_glfw.x11.NET_FRAME_EXTENTS =
|
_glfw.x11.NET_FRAME_EXTENTS =
|
||||||
getSupportedAtom(supportedAtoms, atomCount, "_NET_FRAME_EXTENTS");
|
getAtomIfSupported(supportedAtoms, atomCount, "_NET_FRAME_EXTENTS");
|
||||||
_glfw.x11.NET_REQUEST_FRAME_EXTENTS =
|
_glfw.x11.NET_REQUEST_FRAME_EXTENTS =
|
||||||
getSupportedAtom(supportedAtoms, atomCount, "_NET_REQUEST_FRAME_EXTENTS");
|
getAtomIfSupported(supportedAtoms, atomCount, "_NET_REQUEST_FRAME_EXTENTS");
|
||||||
|
|
||||||
if (supportedAtoms)
|
if (supportedAtoms)
|
||||||
XFree(supportedAtoms);
|
XFree(supportedAtoms);
|
||||||
@@ -660,13 +766,12 @@ static GLFWbool initExtensions(void)
|
|||||||
_glfw.x11.xkb.detectable = GLFW_TRUE;
|
_glfw.x11.xkb.detectable = GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
_glfw.x11.xkb.group = 0;
|
|
||||||
XkbStateRec state;
|
XkbStateRec state;
|
||||||
if (XkbGetState(_glfw.x11.display, XkbUseCoreKbd, &state) == Success)
|
if (XkbGetState(_glfw.x11.display, XkbUseCoreKbd, &state) == Success)
|
||||||
{
|
|
||||||
XkbSelectEventDetails(_glfw.x11.display, XkbUseCoreKbd, XkbStateNotify, XkbAllStateComponentsMask, XkbGroupStateMask);
|
|
||||||
_glfw.x11.xkb.group = (unsigned int)state.group;
|
_glfw.x11.xkb.group = (unsigned int)state.group;
|
||||||
}
|
|
||||||
|
XkbSelectEventDetails(_glfw.x11.display, XkbUseCoreKbd, XkbStateNotify,
|
||||||
|
XkbGroupStateMask, XkbGroupStateMask);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__CYGWIN__)
|
#if defined(__CYGWIN__)
|
||||||
@@ -851,6 +956,9 @@ static Window createHelperWindow(void)
|
|||||||
//
|
//
|
||||||
static int errorHandler(Display *display, XErrorEvent* event)
|
static int errorHandler(Display *display, XErrorEvent* event)
|
||||||
{
|
{
|
||||||
|
if (_glfw.x11.display != display)
|
||||||
|
return 0;
|
||||||
|
|
||||||
_glfw.x11.errorCode = event->error_code;
|
_glfw.x11.errorCode = event->error_code;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -931,15 +1039,12 @@ Cursor _glfwCreateCursorX11(const GLFWimage* image, int xhot, int yhot)
|
|||||||
|
|
||||||
int _glfwPlatformInit(void)
|
int _glfwPlatformInit(void)
|
||||||
{
|
{
|
||||||
#if !defined(X_HAVE_UTF8_STRING)
|
// HACK: If the application has left the locale as "C" then both wide
|
||||||
// HACK: If the current locale is "C" and the Xlib UTF-8 functions are
|
// character text input and explicit UTF-8 input via XIM will break
|
||||||
// unavailable, apply the environment's locale in the hope that it's
|
// This sets the CTYPE part of the current locale from the environment
|
||||||
// both available and not "C"
|
// in the hope that it is set to something more sane than "C"
|
||||||
// This is done because the "C" locale breaks wide character input,
|
|
||||||
// which is what we fall back on when UTF-8 support is missing
|
|
||||||
if (strcmp(setlocale(LC_CTYPE, NULL), "C") == 0)
|
if (strcmp(setlocale(LC_CTYPE, NULL), "C") == 0)
|
||||||
setlocale(LC_CTYPE, "");
|
setlocale(LC_CTYPE, "");
|
||||||
#endif
|
|
||||||
|
|
||||||
XInitThreads();
|
XInitThreads();
|
||||||
XrmInitialize();
|
XrmInitialize();
|
||||||
|
|||||||
+1
-1
@@ -164,7 +164,7 @@ void _glfwPollMonitorsX11(void)
|
|||||||
if (widthMM <= 0 || heightMM <= 0)
|
if (widthMM <= 0 || heightMM <= 0)
|
||||||
{
|
{
|
||||||
// HACK: If RandR does not provide a physical size, assume the
|
// HACK: If RandR does not provide a physical size, assume the
|
||||||
// X11 default 96 DPI and calcuate from the CRTC viewport
|
// X11 default 96 DPI and calculate from the CRTC viewport
|
||||||
// NOTE: These members are affected by rotation, unlike the mode
|
// NOTE: These members are affected by rotation, unlike the mode
|
||||||
// info and output info members
|
// info and output info members
|
||||||
widthMM = (int) (ci->width * 25.4f / 96.f);
|
widthMM = (int) (ci->width * 25.4f / 96.f);
|
||||||
|
|||||||
+3
-2
@@ -199,8 +199,9 @@ typedef struct _GLFWwindowX11
|
|||||||
// The last position the cursor was warped to by GLFW
|
// The last position the cursor was warped to by GLFW
|
||||||
int warpCursorPosX, warpCursorPosY;
|
int warpCursorPosX, warpCursorPosY;
|
||||||
|
|
||||||
// The time of the last KeyPress event
|
// The time of the last KeyPress event per keycode, for discarding
|
||||||
Time lastKeyTime;
|
// duplicate key events generated for some keys by ibus
|
||||||
|
Time keyPressTimes[256];
|
||||||
|
|
||||||
} _GLFWwindowX11;
|
} _GLFWwindowX11;
|
||||||
|
|
||||||
|
|||||||
+38
-16
@@ -1195,6 +1195,8 @@ static void processEvent(XEvent *event)
|
|||||||
{
|
{
|
||||||
_glfw.x11.xkb.group = ((XkbEvent*) event)->state.group;
|
_glfw.x11.xkb.group = ((XkbEvent*) event)->state.group;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1273,16 +1275,20 @@ static void processEvent(XEvent *event)
|
|||||||
|
|
||||||
if (window->x11.ic)
|
if (window->x11.ic)
|
||||||
{
|
{
|
||||||
// HACK: Ignore duplicate key press events generated by ibus
|
// HACK: Do not report the key press events duplicated by XIM
|
||||||
// These have the same timestamp as the original event
|
// Duplicate key releases are filtered out implicitly by
|
||||||
// Corresponding release events are filtered out
|
// the GLFW key repeat logic in _glfwInputKey
|
||||||
// implicitly by the GLFW key repeat logic
|
// A timestamp per key is used to handle simultaneous keys
|
||||||
if (window->x11.lastKeyTime < event->xkey.time)
|
// NOTE: Always allow the first event for each key through
|
||||||
|
// (the server never sends a timestamp of zero)
|
||||||
|
// NOTE: Timestamp difference is compared to handle wrap-around
|
||||||
|
Time diff = event->xkey.time - window->x11.keyPressTimes[keycode];
|
||||||
|
if (diff == event->xkey.time || (diff > 0 && diff < (1 << 31)))
|
||||||
{
|
{
|
||||||
if (keycode)
|
if (keycode)
|
||||||
_glfwInputKey(window, key, keycode, GLFW_PRESS, mods);
|
_glfwInputKey(window, key, keycode, GLFW_PRESS, mods);
|
||||||
|
|
||||||
window->x11.lastKeyTime = event->xkey.time;
|
window->x11.keyPressTimes[keycode] = event->xkey.time;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!filtered)
|
if (!filtered)
|
||||||
@@ -1557,6 +1563,8 @@ static void processEvent(XEvent *event)
|
|||||||
// the position into root (screen) coordinates
|
// the position into root (screen) coordinates
|
||||||
if (!event->xany.send_event && window->x11.parent != _glfw.x11.root)
|
if (!event->xany.send_event && window->x11.parent != _glfw.x11.root)
|
||||||
{
|
{
|
||||||
|
_glfwGrabErrorHandlerX11();
|
||||||
|
|
||||||
Window dummy;
|
Window dummy;
|
||||||
XTranslateCoordinates(_glfw.x11.display,
|
XTranslateCoordinates(_glfw.x11.display,
|
||||||
window->x11.parent,
|
window->x11.parent,
|
||||||
@@ -1564,6 +1572,10 @@ static void processEvent(XEvent *event)
|
|||||||
xpos, ypos,
|
xpos, ypos,
|
||||||
&xpos, &ypos,
|
&xpos, &ypos,
|
||||||
&dummy);
|
&dummy);
|
||||||
|
|
||||||
|
_glfwReleaseErrorHandlerX11();
|
||||||
|
if (_glfw.x11.errorCode == BadWindow)
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xpos != window->x11.xpos || ypos != window->x11.ypos)
|
if (xpos != window->x11.xpos || ypos != window->x11.ypos)
|
||||||
@@ -1971,7 +1983,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
|||||||
const _GLFWctxconfig* ctxconfig,
|
const _GLFWctxconfig* ctxconfig,
|
||||||
const _GLFWfbconfig* fbconfig)
|
const _GLFWfbconfig* fbconfig)
|
||||||
{
|
{
|
||||||
Visual* visual;
|
Visual* visual = NULL;
|
||||||
int depth;
|
int depth;
|
||||||
|
|
||||||
if (ctxconfig->client != GLFW_NO_API)
|
if (ctxconfig->client != GLFW_NO_API)
|
||||||
@@ -1997,8 +2009,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctxconfig->client == GLFW_NO_API ||
|
if (!visual)
|
||||||
ctxconfig->source == GLFW_OSMESA_CONTEXT_API)
|
|
||||||
{
|
{
|
||||||
visual = DefaultVisual(_glfw.x11.display, _glfw.x11.screen);
|
visual = DefaultVisual(_glfw.x11.display, _glfw.x11.screen);
|
||||||
depth = DefaultDepth(_glfw.x11.display, _glfw.x11.screen);
|
depth = DefaultDepth(_glfw.x11.display, _glfw.x11.screen);
|
||||||
@@ -2489,7 +2500,11 @@ void _glfwPlatformSetWindowMonitor(_GLFWwindow* window,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (window->monitor)
|
if (window->monitor)
|
||||||
|
{
|
||||||
|
_glfwPlatformSetWindowDecorated(window, window->decorated);
|
||||||
|
_glfwPlatformSetWindowFloating(window, window->floating);
|
||||||
releaseMonitor(window);
|
releaseMonitor(window);
|
||||||
|
}
|
||||||
|
|
||||||
_glfwInputWindowMonitor(window, monitor);
|
_glfwInputWindowMonitor(window, monitor);
|
||||||
updateNormalHints(window, width, height);
|
updateNormalHints(window, width, height);
|
||||||
@@ -2580,13 +2595,19 @@ int _glfwPlatformWindowHovered(_GLFWwindow* window)
|
|||||||
int rootX, rootY, childX, childY;
|
int rootX, rootY, childX, childY;
|
||||||
unsigned int mask;
|
unsigned int mask;
|
||||||
|
|
||||||
if (!XQueryPointer(_glfw.x11.display, w,
|
_glfwGrabErrorHandlerX11();
|
||||||
&root, &w, &rootX, &rootY, &childX, &childY, &mask))
|
|
||||||
{
|
|
||||||
return GLFW_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (w == window->x11.handle)
|
const Bool result = XQueryPointer(_glfw.x11.display, w,
|
||||||
|
&root, &w, &rootX, &rootY,
|
||||||
|
&childX, &childY, &mask);
|
||||||
|
|
||||||
|
_glfwReleaseErrorHandlerX11();
|
||||||
|
|
||||||
|
if (_glfw.x11.errorCode == BadWindow)
|
||||||
|
w = _glfw.x11.root;
|
||||||
|
else if (!result)
|
||||||
|
return GLFW_FALSE;
|
||||||
|
else if (w == window->x11.handle)
|
||||||
return GLFW_TRUE;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2950,8 +2971,9 @@ void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor)
|
|||||||
|
|
||||||
void _glfwPlatformSetClipboardString(const char* string)
|
void _glfwPlatformSetClipboardString(const char* string)
|
||||||
{
|
{
|
||||||
|
char* copy = _glfw_strdup(string);
|
||||||
free(_glfw.x11.clipboardString);
|
free(_glfw.x11.clipboardString);
|
||||||
_glfw.x11.clipboardString = _glfw_strdup(string);
|
_glfw.x11.clipboardString = copy;
|
||||||
|
|
||||||
XSetSelectionOwner(_glfw.x11.display,
|
XSetSelectionOwner(_glfw.x11.display,
|
||||||
_glfw.x11.CLIPBOARD,
|
_glfw.x11.CLIPBOARD,
|
||||||
|
|||||||
+46
-142
@@ -70,150 +70,54 @@ static GLADapiproc glad_vulkan_callback(const char* name, void* user)
|
|||||||
return glfwGetInstanceProcAddress((VkInstance) user, name);
|
return glfwGetInstanceProcAddress((VkInstance) user, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char fragShaderCode[] = {
|
static const uint32_t fragShaderCode[] = {
|
||||||
0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x08, 0x00,
|
0x07230203,0x00010000,0x00080007,0x00000014,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||||
0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00,
|
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||||
0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00,
|
0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000009,0x00000011,0x00030010,
|
||||||
0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30,
|
0x00000004,0x00000007,0x00030003,0x00000002,0x00000190,0x00090004,0x415f4c47,0x735f4252,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x72617065,0x5f657461,0x64616873,0x6f5f7265,0x63656a62,0x00007374,0x00090004,0x415f4c47,
|
||||||
0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00,
|
0x735f4252,0x69646168,0x6c5f676e,0x75676e61,0x5f656761,0x70303234,0x006b6361,0x00040005,
|
||||||
0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00,
|
0x00000004,0x6e69616d,0x00000000,0x00050005,0x00000009,0x61724675,0x6c6f4367,0x0000726f,
|
||||||
0x09, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00,
|
0x00030005,0x0000000d,0x00786574,0x00050005,0x00000011,0x63786574,0x64726f6f,0x00000000,
|
||||||
0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00,
|
0x00040047,0x00000009,0x0000001e,0x00000000,0x00040047,0x0000000d,0x00000022,0x00000000,
|
||||||
0x02, 0x00, 0x00, 0x00, 0x90, 0x01, 0x00, 0x00, 0x04, 0x00, 0x09, 0x00,
|
0x00040047,0x0000000d,0x00000021,0x00000000,0x00040047,0x00000011,0x0000001e,0x00000000,
|
||||||
0x47, 0x4c, 0x5f, 0x41, 0x52, 0x42, 0x5f, 0x73, 0x65, 0x70, 0x61, 0x72,
|
0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,0x00000020,
|
||||||
0x61, 0x74, 0x65, 0x5f, 0x73, 0x68, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x6f,
|
0x00040017,0x00000007,0x00000006,0x00000004,0x00040020,0x00000008,0x00000003,0x00000007,
|
||||||
0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x00, 0x00, 0x04, 0x00, 0x09, 0x00,
|
0x0004003b,0x00000008,0x00000009,0x00000003,0x00090019,0x0000000a,0x00000006,0x00000001,
|
||||||
0x47, 0x4c, 0x5f, 0x41, 0x52, 0x42, 0x5f, 0x73, 0x68, 0x61, 0x64, 0x69,
|
0x00000000,0x00000000,0x00000000,0x00000001,0x00000000,0x0003001b,0x0000000b,0x0000000a,
|
||||||
0x6e, 0x67, 0x5f, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x5f,
|
0x00040020,0x0000000c,0x00000000,0x0000000b,0x0004003b,0x0000000c,0x0000000d,0x00000000,
|
||||||
0x34, 0x32, 0x30, 0x70, 0x61, 0x63, 0x6b, 0x00, 0x05, 0x00, 0x04, 0x00,
|
0x00040017,0x0000000f,0x00000006,0x00000002,0x00040020,0x00000010,0x00000001,0x0000000f,
|
||||||
0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00,
|
0x0004003b,0x00000010,0x00000011,0x00000001,0x00050036,0x00000002,0x00000004,0x00000000,
|
||||||
0x05, 0x00, 0x05, 0x00, 0x09, 0x00, 0x00, 0x00, 0x75, 0x46, 0x72, 0x61,
|
0x00000003,0x000200f8,0x00000005,0x0004003d,0x0000000b,0x0000000e,0x0000000d,0x0004003d,
|
||||||
0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00,
|
0x0000000f,0x00000012,0x00000011,0x00050057,0x00000007,0x00000013,0x0000000e,0x00000012,
|
||||||
0x0d, 0x00, 0x00, 0x00, 0x74, 0x65, 0x78, 0x00, 0x05, 0x00, 0x05, 0x00,
|
0x0003003e,0x00000009,0x00000013,0x000100fd,0x00010038
|
||||||
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 char vertShaderCode[] = {
|
static const uint32_t vertShaderCode[] = {
|
||||||
0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x08, 0x00,
|
0x07230203,0x00010000,0x00080007,0x00000018,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||||
0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00,
|
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||||
0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00,
|
0x0009000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x00000009,0x0000000b,0x00000010,
|
||||||
0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30,
|
0x00000014,0x00030003,0x00000002,0x00000190,0x00090004,0x415f4c47,0x735f4252,0x72617065,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x5f657461,0x64616873,0x6f5f7265,0x63656a62,0x00007374,0x00090004,0x415f4c47,0x735f4252,
|
||||||
0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x69646168,0x6c5f676e,0x75676e61,0x5f656761,0x70303234,0x006b6361,0x00040005,0x00000004,
|
||||||
0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00,
|
0x6e69616d,0x00000000,0x00050005,0x00000009,0x63786574,0x64726f6f,0x00000000,0x00040005,
|
||||||
0x09, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
|
0x0000000b,0x72747461,0x00000000,0x00060005,0x0000000e,0x505f6c67,0x65567265,0x78657472,
|
||||||
0x17, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00,
|
0x00000000,0x00060006,0x0000000e,0x00000000,0x505f6c67,0x7469736f,0x006e6f69,0x00030005,
|
||||||
0x03, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x01, 0x00, 0x00,
|
0x00000010,0x00000000,0x00030005,0x00000014,0x00736f70,0x00040047,0x00000009,0x0000001e,
|
||||||
0x04, 0x00, 0x09, 0x00, 0x47, 0x4c, 0x5f, 0x41, 0x52, 0x42, 0x5f, 0x73,
|
0x00000000,0x00040047,0x0000000b,0x0000001e,0x00000001,0x00050048,0x0000000e,0x00000000,
|
||||||
0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x68, 0x61, 0x64,
|
0x0000000b,0x00000000,0x00030047,0x0000000e,0x00000002,0x00040047,0x00000014,0x0000001e,
|
||||||
0x65, 0x72, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x00, 0x00,
|
0x00000000,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,
|
||||||
0x04, 0x00, 0x09, 0x00, 0x47, 0x4c, 0x5f, 0x41, 0x52, 0x42, 0x5f, 0x73,
|
0x00000020,0x00040017,0x00000007,0x00000006,0x00000002,0x00040020,0x00000008,0x00000003,
|
||||||
0x68, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x61, 0x6e, 0x67, 0x75,
|
0x00000007,0x0004003b,0x00000008,0x00000009,0x00000003,0x00040020,0x0000000a,0x00000001,
|
||||||
0x61, 0x67, 0x65, 0x5f, 0x34, 0x32, 0x30, 0x70, 0x61, 0x63, 0x6b, 0x00,
|
0x00000007,0x0004003b,0x0000000a,0x0000000b,0x00000001,0x00040017,0x0000000d,0x00000006,
|
||||||
0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e,
|
0x00000004,0x0003001e,0x0000000e,0x0000000d,0x00040020,0x0000000f,0x00000003,0x0000000e,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x09, 0x00, 0x00, 0x00,
|
0x0004003b,0x0000000f,0x00000010,0x00000003,0x00040015,0x00000011,0x00000020,0x00000001,
|
||||||
0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x00, 0x00, 0x00, 0x00,
|
0x0004002b,0x00000011,0x00000012,0x00000000,0x00040020,0x00000013,0x00000001,0x0000000d,
|
||||||
0x05, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72,
|
0x0004003b,0x00000013,0x00000014,0x00000001,0x00040020,0x00000016,0x00000003,0x0000000d,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x11, 0x00, 0x00, 0x00,
|
0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003d,
|
||||||
0x67, 0x6c, 0x5f, 0x50, 0x65, 0x72, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78,
|
0x00000007,0x0000000c,0x0000000b,0x0003003e,0x00000009,0x0000000c,0x0004003d,0x0000000d,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x11, 0x00, 0x00, 0x00,
|
0x00000015,0x00000014,0x00050041,0x00000016,0x00000017,0x00000010,0x00000012,0x0003003e,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74,
|
0x00000017,0x00000015,0x000100fd,0x00010038
|
||||||
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
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct texture_object {
|
struct texture_object {
|
||||||
|
|||||||
Reference in New Issue
Block a user