remove deprecated GLFW calls and tame clang-format
This commit is contained in:
parent
a12adc1a34
commit
a4f6803c35
2 changed files with 10 additions and 10 deletions
|
@ -11,14 +11,14 @@ project(paradiso
|
|||
# boilerplate locations for build
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin CACHE PATH "Executables go here")
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib CACHE PATH "Libraries go here")
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin CACHE PATH "Standalone DLLs go here")
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin CACHE PATH "Standalone DLLs go here")
|
||||
|
||||
#
|
||||
# C++20 is mandatory
|
||||
#
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(examples)
|
||||
add_subdirectory(examples)
|
||||
|
|
|
@ -22,8 +22,10 @@
|
|||
*/
|
||||
#include "paradiso/window.hpp"
|
||||
|
||||
// clang-format off
|
||||
#include "glad/glad.h"
|
||||
#include "GLFW/glfw3.h"
|
||||
// clang-format on
|
||||
|
||||
#include <cmath>
|
||||
#include <codecvt>
|
||||
|
@ -89,9 +91,8 @@ struct Window::impl {
|
|||
static void charmods_callback(GLFWwindow* window, unsigned int codepoint,
|
||||
int mods) {
|
||||
// build the string from a Unicode code point
|
||||
std::wstring_convert<std::codecvt_utf8<char32_t>, char32_t> converter;
|
||||
std::string u8str = converter.to_bytes(codepoint);
|
||||
|
||||
// std::wstring_convert<std::codecvt_utf8<char32_t>, char32_t>
|
||||
// converter; std::string u8str = converter.to_bytes(codepoint);
|
||||
// input::get()._input_string = u8str;
|
||||
}
|
||||
|
||||
|
@ -146,8 +147,9 @@ struct Window::impl {
|
|||
glfwSetFramebufferSizeCallback(window_,
|
||||
Window::impl::framebuffer_size_callback);
|
||||
glfwSetKeyCallback(window_, Window::impl::key_callback);
|
||||
// glfwSetCharCallback(_window, character_callback);
|
||||
glfwSetCharModsCallback(window_, charmods_callback);
|
||||
// glfwSetCharCallback(_window, character_callback);
|
||||
// glfwSetCharModsCallback(window_, charmods_callback); // will be
|
||||
// deprecated in 4.0
|
||||
glfwSetScrollCallback(window_, scroll_callback);
|
||||
|
||||
glfwSetDropCallback(window_, drop_callback);
|
||||
|
@ -182,7 +184,6 @@ struct Window::impl {
|
|||
// delete events
|
||||
paradiso::Window::KeyboardInputStack{}.swap(keyboard_input_);
|
||||
|
||||
|
||||
// get new events
|
||||
glfwPollEvents();
|
||||
|
||||
|
@ -310,5 +311,4 @@ const Window::KeyboardInputStack& Window::keyboard_input() const {
|
|||
return impl_->keyboard_input_;
|
||||
}
|
||||
|
||||
|
||||
} // namespace paradiso
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue