Closed f32by closed 3 years ago
Looks like I just forgot to include
Fixed to macOS are not complete yet, the upgrade from GLFW 3.3.1 to 3.3.2 has broke glfwCreateWindowSurface
, and DPI scaling on macOS displays the engine at the wrong resolution.
Thanks! I tried latest commit from ui
branch and now tutorial 1 can run. However only 1/4 window is being rendered. Is it a bug caused by glfw? I tried glfw 3.3.1 but got the same result...
Update: I found some explanations about incorrect viewport from glfw faq (https://www.glfw.org/faq.html). glfw developers recommend to use framebuffer size instead of window size on macOS. After glfw window creation, I called glfwGetFramebufferSize() to overwrite window size with actual framebuffer size. Now it can be rendered correctly:)
--- a/Sources/Devices/Window.cpp
+++ b/Sources/Devices/Window.cpp
@@ -125,6 +125,8 @@ Window::Window() :
throw std::runtime_error("GLFW failed to create the window");
}
+ glfwGetFramebufferSize(window, reinterpret_cast<int *>(&size.x), reinterpret_cast<int *>(&size.y));
+
// Sets the user pointer.
glfwSetWindowUserPointer(window, this);
Describe the bug
To Reproduce
Expected behaviour build should succeed
Screenshots No
Hardware:
Additional context I noticed this commit fixes this issue but build still fails :(