mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-08 17:57:02 +08:00
refactor: extract constants into separate constants.hpp file
This commit is contained in:
12
src/app.cpp
12
src/app.cpp
@@ -51,8 +51,7 @@ void App::init() {
|
||||
glfwSetKeyCallback(m_window.get_glfw_window(), key_callback);
|
||||
glfwSetScrollCallback(m_window.get_glfw_window(), mouse_scroll_callback);
|
||||
glfwSetCursorEnterCallback(m_window.get_glfw_window(), cursor_enter_callback);
|
||||
|
||||
|
||||
glfwSetCharCallback(m_window.get_glfw_window(), char_callback);
|
||||
PerlinNoise::init();
|
||||
|
||||
m_renderer.init();
|
||||
@@ -192,6 +191,15 @@ void App::cursor_enter_callback(GLFWwindow* window, int entered) {
|
||||
}
|
||||
}
|
||||
|
||||
void App::char_callback(GLFWwindow* window, unsigned int c) {
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
App* app = static_cast<App*>(glfwGetWindowUserPointer(window));
|
||||
ASSERT_MSG(app, "nullptr");
|
||||
if (io.WantCaptureKeyboard && app->m_window.is_mouse_enable()) {
|
||||
ImGui_ImplGlfw_CharCallback(window, c);
|
||||
}
|
||||
}
|
||||
|
||||
void App::render() {
|
||||
|
||||
if (glfwGetWindowAttrib(m_window.get_glfw_window(), GLFW_ICONIFIED) != 0)
|
||||
|
||||
Reference in New Issue
Block a user