Hazel
Hazel copied to clipboard
About resize function on high dpi screen
it might be better to put
glfwSetWindowSizeCallback(m_Window, [](GLFWwindow *window, int width, int height) {
WindowData &data = *(WindowData *)glfwGetWindowUserPointer(window);
data.Width = width;
data.Height = height;
WindowResizeEvent event(width, height);
data.EventCallback(event);
});
into
glfwSetFramebufferSizeCallback(m_Window, [](GLFWwindow* window, int width, int height){
WindowData &data = *(WindowData *)glfwGetWindowUserPointer(window);
data.Width = width;
data.Height = height;
WindowResizeEvent event(width, height);
data.EventCallback(event);
});
use glfwSetWindowSizeCallback might have resize error on high dpi screen
I’d say: create a pull request
That only causes an issue when the framebuffer is not the same size as the window. This is only an issue for macOS where the framebuffer is twice the size of the window. Until then, this shouldn't be a real issue. We don't have any high DPI support yet either...