Skip to content

Commit

Permalink
update glfw to v3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
duddel committed Aug 27, 2024
1 parent 4fcc074 commit 01b94e4
Show file tree
Hide file tree
Showing 97 changed files with 20,493 additions and 7,909 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: install deps
run: |
sudo apt update
sudo apt install libgl1-mesa-dev xorg-dev
sudo apt install libgl1-mesa-dev xorg-dev libwayland-dev libxkbcommon-dev
if: startsWith(matrix.os, 'ubuntu')
- name: configure
run: |
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ RUN apt-get update && apt-get install -y \
zip \
libgl1-mesa-dev \
wget \
xorg-dev && \
xorg-dev \
libwayland-dev \
libxkbcommon-dev && \
rm -rf /var/lib/apt/lists/*

# Install tools for docs and quality
Expand Down
3 changes: 2 additions & 1 deletion init/template/assets/yg_LICENSES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
License of GLFW
===========================================================
Copyright (c) 2002-2006 Marcus Geelnard
Copyright (c) 2006-2016 Camilla Löwy elmindreda@glfw.org

Copyright (c) 2006-2019 Camilla Löwy

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
Expand Down
8 changes: 4 additions & 4 deletions src/platform_desktop_web/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ namespace yourgame_internal
yourgame_internal::input::setInput(yourgame::input::SCROLL_OFFSET_X, 0.0f);
yourgame_internal::input::setInput(yourgame::input::SCROLL_OFFSET_Y, 0.0f);

// todo: mapped gamepad input available since glfw v3.3,
// emscripten implements glfw v3.2 API only (2020-12-12)
// ToDo: emscripten GLFW implementation is incomplete (undefined symbol: glfwGetGamepadState),
// even though the GLFW API, provided via emscripten, is v3.3 (2024-08-27)
#ifndef __EMSCRIPTEN__
for (const auto &pad : gamepadFirstButtonAxisIdx)
{
Expand Down Expand Up @@ -282,8 +282,8 @@ namespace yourgame_internal
glfwSetScrollCallback(window, scrollCallback);
glfwSetJoystickCallback(joystickCallback);

// todo: mapped gamepad input available since glfw v3.3,
// emscripten implements glfw v3.2 API only (2020-12-12)
// ToDo: emscripten GLFW implementation is incomplete (undefined symbol: glfwGetGamepadState),
// even though the GLFW API, provided via emscripten, is v3.3 (2024-08-27)
#ifndef __EMSCRIPTEN__
// poll and set gamepads, that are already connected during init
for (const auto &p : gamepadConnectedApiMapping)
Expand Down
5 changes: 1 addition & 4 deletions src/platform_desktop_web/yourgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,7 @@ namespace yourgame_internal

glfwSwapInterval(yourgame::input::geti(yourgame::input::VSYNC_ON) ? 1 : 0);

// enable raw mouse input if supported. affects catched mouse mode, see catchMouse()
// todo: raw mouse motion available since glfw v3.3,
// emscripten implements glfw v3.2 API only (2021-01-19)
#ifndef __EMSCRIPTEN__
#if (GLFW_VERSION_MAJOR == 3) && (GLFW_VERSION_MINOR >= 3)
if (glfwRawMouseMotionSupported())
{
glfwSetInputMode(_window, GLFW_RAW_MOUSE_MOTION, GLFW_TRUE);
Expand Down
11 changes: 8 additions & 3 deletions thirdparty/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,15 @@ These libraries are integrated if the project has been initialized with default

## GLFW

- version: **3.3**
- origin: <https://github.com/glfw/glfw/releases/tag/3.3>
- version: **3.4**
- origin: <https://github.com/glfw/glfw/releases/tag/3.4>
- extracted from origin:
- all, except deps/, docs/, examples/, tests/
- CMake/\*
- deps/wayland/\*
- include/\*
- src/\*
- CMakeLists.txt
- LICENSE.md
- license: [glfw/LICENSE.md](glfw/LICENSE.md)

## glm
Expand Down
19 changes: 17 additions & 2 deletions thirdparty/glfw/CMake/GenerateMappings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,23 @@ endif()

file(STRINGS "${source_path}" lines)
foreach(line ${lines})
if ("${line}" MATCHES "^[0-9a-fA-F].*$")
set(GLFW_GAMEPAD_MAPPINGS "${GLFW_GAMEPAD_MAPPINGS}\"${line}\",\n")
if (line MATCHES "^[0-9a-fA-F]")
if (line MATCHES "platform:Windows")
if (GLFW_WIN32_MAPPINGS)
string(APPEND GLFW_WIN32_MAPPINGS "\n")
endif()
string(APPEND GLFW_WIN32_MAPPINGS "\"${line}\",")
elseif (line MATCHES "platform:Mac OS X")
if (GLFW_COCOA_MAPPINGS)
string(APPEND GLFW_COCOA_MAPPINGS "\n")
endif()
string(APPEND GLFW_COCOA_MAPPINGS "\"${line}\",")
elseif (line MATCHES "platform:Linux")
if (GLFW_LINUX_MAPPINGS)
string(APPEND GLFW_LINUX_MAPPINGS "\n")
endif()
string(APPEND GLFW_LINUX_MAPPINGS "\"${line}\",")
endif()
endif()
endforeach()

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
if (NOT EXISTS "@GLFW_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: \"@GLFW_BINARY_DIR@/install_manifest.txt\"")
endif()

file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
file(READ "@GLFW_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")

foreach (file ${files})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ libdir=@CMAKE_INSTALL_FULL_LIBDIR@

Name: GLFW
Description: A multi-platform library for OpenGL, window and input
Version: @GLFW_VERSION_FULL@
Version: @GLFW_VERSION@
URL: https://www.glfw.org/
Requires.private: @GLFW_PKG_DEPS@
Libs: -L${libdir} -l@GLFW_LIB_NAME@
Libs.private: @GLFW_PKG_LIBS@
Requires.private: @GLFW_PKG_CONFIG_REQUIRES_PRIVATE@
Libs: -L${libdir} -l@GLFW_LIB_NAME@@GLFW_LIB_NAME_SUFFIX@
Libs.private: @GLFW_PKG_CONFIG_LIBS_PRIVATE@
Cflags: -I${includedir}
3 changes: 3 additions & 0 deletions thirdparty/glfw/CMake/glfw3Config.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include(CMakeFindDependencyMacro)
find_dependency(Threads)
include("${CMAKE_CURRENT_LIST_DIR}/glfw3Targets.cmake")
2 changes: 1 addition & 1 deletion thirdparty/glfw/CMake/modules/FindEpollShim.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ if (EPOLLSHIM_INCLUDE_DIRS AND EPOLLSHIM_LIBRARIES)
endif (EPOLLSHIM_INCLUDE_DIRS AND EPOLLSHIM_LIBRARIES)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(EPOLLSHIM DEFAULT_MSG EPOLLSHIM_LIBRARIES EPOLLSHIM_INCLUDE_DIRS)
find_package_handle_standard_args(EpollShim DEFAULT_MSG EPOLLSHIM_LIBRARIES EPOLLSHIM_INCLUDE_DIRS)
mark_as_advanced(EPOLLSHIM_INCLUDE_DIRS EPOLLSHIM_LIBRARIES)
26 changes: 0 additions & 26 deletions thirdparty/glfw/CMake/modules/FindWaylandProtocols.cmake

This file was deleted.

34 changes: 0 additions & 34 deletions thirdparty/glfw/CMake/modules/FindXKBCommon.cmake

This file was deleted.

Loading

0 comments on commit 01b94e4

Please sign in to comment.