Hazel icon indicating copy to clipboard operation
Hazel copied to clipboard

About resize function on high dpi screen

Open rocketman123456 opened this issue 5 years ago • 2 comments

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

rocketman123456 avatar Nov 28 '20 19:11 rocketman123456

I’d say: create a pull request

mandar1jn avatar Nov 29 '20 19:11 mandar1jn

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...

LovelySanta avatar Dec 01 '20 23:12 LovelySanta