Failed to compile on macOS 10.15.3
f32by opened this issue · 2 comments
Describe the bug
1. compiler complains about missing including <unordered_map>.
2. ld: can't map file, errno=22 file '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenAL.framework' for architecture x86_64
To Reproduce
- Follow the build instructions in this wiki page
- Open Acid.xcodeproj
- Build target TestTourial1
Expected behaviour
build should succeed
Screenshots
No
Hardware:
- Device: MacBook Pro 16-inch
- OS: macOS 10.15.3
Additional context
I noticed this commit fixes this issue but build still fails :(
Looks like I just forgot to include <unordered_map> in a few spots, and msdf-c inline methods also failed to be found. Also in macOS 10.14+ releases OpenAL soft must be installed. I made those changes here: 29320ed
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);