remove deprecated GLFW calls and tame clang-format

This commit is contained in:
Hartmut Seichter 2025-05-22 22:39:05 +02:00
parent a12adc1a34
commit a4f6803c35
2 changed files with 10 additions and 10 deletions

View file

@ -16,7 +16,7 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin CACHE PATH "Standalon
# #
# C++20 is mandatory # C++20 is mandatory
# #
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_EXTENSIONS OFF)

View file

@ -22,8 +22,10 @@
*/ */
#include "paradiso/window.hpp" #include "paradiso/window.hpp"
// clang-format off
#include "glad/glad.h" #include "glad/glad.h"
#include "GLFW/glfw3.h" #include "GLFW/glfw3.h"
// clang-format on
#include <cmath> #include <cmath>
#include <codecvt> #include <codecvt>
@ -89,9 +91,8 @@ struct Window::impl {
static void charmods_callback(GLFWwindow* window, unsigned int codepoint, static void charmods_callback(GLFWwindow* window, unsigned int codepoint,
int mods) { int mods) {
// build the string from a Unicode code point // build the string from a Unicode code point
std::wstring_convert<std::codecvt_utf8<char32_t>, char32_t> converter; // std::wstring_convert<std::codecvt_utf8<char32_t>, char32_t>
std::string u8str = converter.to_bytes(codepoint); // converter; std::string u8str = converter.to_bytes(codepoint);
// input::get()._input_string = u8str; // input::get()._input_string = u8str;
} }
@ -147,7 +148,8 @@ struct Window::impl {
Window::impl::framebuffer_size_callback); Window::impl::framebuffer_size_callback);
glfwSetKeyCallback(window_, Window::impl::key_callback); glfwSetKeyCallback(window_, Window::impl::key_callback);
// glfwSetCharCallback(_window, character_callback); // glfwSetCharCallback(_window, character_callback);
glfwSetCharModsCallback(window_, charmods_callback); // glfwSetCharModsCallback(window_, charmods_callback); // will be
// deprecated in 4.0
glfwSetScrollCallback(window_, scroll_callback); glfwSetScrollCallback(window_, scroll_callback);
glfwSetDropCallback(window_, drop_callback); glfwSetDropCallback(window_, drop_callback);
@ -182,7 +184,6 @@ struct Window::impl {
// delete events // delete events
paradiso::Window::KeyboardInputStack{}.swap(keyboard_input_); paradiso::Window::KeyboardInputStack{}.swap(keyboard_input_);
// get new events // get new events
glfwPollEvents(); glfwPollEvents();
@ -310,5 +311,4 @@ const Window::KeyboardInputStack& Window::keyboard_input() const {
return impl_->keyboard_input_; return impl_->keyboard_input_;
} }
} // namespace paradiso } // namespace paradiso