Reformat
This commit is contained in:
parent
7ce7fe4889
commit
25278cb496
1 changed files with 10 additions and 6 deletions
|
|
@ -24,7 +24,9 @@ namespace gui {
|
||||||
|
|
||||||
glfwMakeContextCurrent(wwindow.get());
|
glfwMakeContextCurrent(wwindow.get());
|
||||||
glfwSetFramebufferSizeCallback(wwindow.get(),
|
glfwSetFramebufferSizeCallback(wwindow.get(),
|
||||||
framebufferCallback != nullptr ? framebufferCallback : internalFramebufferCallback);
|
framebufferCallback != nullptr
|
||||||
|
? framebufferCallback
|
||||||
|
: internalFramebufferCallback);
|
||||||
|
|
||||||
glfwSwapInterval(1); // VSync on
|
glfwSwapInterval(1); // VSync on
|
||||||
glfwSetKeyCallback(wwindow.get(), key_callback);
|
glfwSetKeyCallback(wwindow.get(), key_callback);
|
||||||
|
|
@ -50,31 +52,33 @@ namespace gui {
|
||||||
void Window::key_callback(GLFWwindow *window, const int key, const int scancode, const int action, const int mods) {
|
void Window::key_callback(GLFWwindow *window, const int key, const int scancode, const int action, const int mods) {
|
||||||
auto *modules = static_cast<modulesType *>(glfwGetWindowUserPointer(window));
|
auto *modules = static_cast<modulesType *>(glfwGetWindowUserPointer(window));
|
||||||
std::ranges::for_each(*modules,
|
std::ranges::for_each(*modules,
|
||||||
[=](modulesType::reference item) { item.second->key_callback(key, scancode, action, mods); });
|
[=](modulesType::reference item) {
|
||||||
|
item.second->key_callback(key, scancode, action, mods);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::cursor_position_callback(GLFWwindow *window, const double xpos, const double ypos) {
|
void Window::cursor_position_callback(GLFWwindow *window, const double xpos, const double ypos) {
|
||||||
auto *modules = static_cast<modulesType *>(glfwGetWindowUserPointer(window));
|
auto *modules = static_cast<modulesType *>(glfwGetWindowUserPointer(window));
|
||||||
std::ranges::for_each(*modules,
|
std::ranges::for_each(*modules,
|
||||||
[=](modulesType::reference item) { item.second->cursor_position_callback(xpos, ypos); });
|
[=](modulesType::reference item) { item.second->cursor_position_callback(xpos, ypos); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::scroll_callback(GLFWwindow *window, const double xoffset, const double yoffset) {
|
void Window::scroll_callback(GLFWwindow *window, const double xoffset, const double yoffset) {
|
||||||
auto *modules = static_cast<modulesType *>(glfwGetWindowUserPointer(window));
|
auto *modules = static_cast<modulesType *>(glfwGetWindowUserPointer(window));
|
||||||
std::ranges::for_each(*modules,
|
std::ranges::for_each(*modules,
|
||||||
[=](modulesType::reference item) { item.second->scroll_callback(xoffset, yoffset); });
|
[=](modulesType::reference item) { item.second->scroll_callback(xoffset, yoffset); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::window_size_callback(GLFWwindow *window, const int width, const int height) {
|
void Window::window_size_callback(GLFWwindow *window, const int width, const int height) {
|
||||||
auto *modules = static_cast<modulesType *>(glfwGetWindowUserPointer(window));
|
auto *modules = static_cast<modulesType *>(glfwGetWindowUserPointer(window));
|
||||||
std::ranges::for_each(*modules,
|
std::ranges::for_each(*modules,
|
||||||
[=](modulesType::reference item) { item.second->window_size(width, height); });
|
[=](modulesType::reference item) { item.second->window_size(width, height); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::window_pos_callback(GLFWwindow *window, const int xpos, const int ypos) {
|
void Window::window_pos_callback(GLFWwindow *window, const int xpos, const int ypos) {
|
||||||
auto *modules = static_cast<modulesType *>(glfwGetWindowUserPointer(window));
|
auto *modules = static_cast<modulesType *>(glfwGetWindowUserPointer(window));
|
||||||
std::ranges::for_each(*modules,
|
std::ranges::for_each(*modules,
|
||||||
[=](modulesType::reference item) { item.second->window_pos(xpos, ypos); });
|
[=](modulesType::reference item) { item.second->window_pos(xpos, ypos); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::add_module(data::BasicData &module) {
|
void Window::add_module(data::BasicData &module) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue