LukasBanana / LLGL

Low Level Graphics Library (LLGL) is a thin abstraction layer for the modern graphics APIs OpenGL, Direct3D, Vulkan, and Metal
BSD 3-Clause "New" or "Revised" License
2.05k stars 139 forks source link

Hard to run examples in Mac #31

Closed hymn4u closed 5 years ago

hymn4u commented 5 years ago

hello lukas, i found LLGL hard to run example on Mac xcode.

  1. use "MACOSX_BUNDLE" to generate examples, but i don't konw how to read .vert .frag in app's contents folder... pretty sad. i just change that to default, then use absolute path to read them.
  2. when i choose metal to render, just can't find file [[NSString alloc] initWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil] return nil. i guess U have some good ideas to solving them.
hymn4u commented 5 years ago

any help is appreciated, thanks~~

LukasBanana commented 5 years ago

Have you set the working directory to the respective example folder? In case of the HelloTriangle project for instance, you need to set the working directory to <Your-LLGL-Repository>/examples/Cpp/HelloTriangle. I only mentioned it in the GettingStarted document on page 13, but the document is outdated (the path is obsolete).

Maybe I find a way to specify the working directories via CMakeLists.txt script some day. Until then, you have to change it in Xcode via Product -> Scheme -> Edit Scheme... -> Options Tab -> Working Directory (I use Xcode 10.1).

hymn4u commented 5 years ago

Sorry for late. That works on my xcode10.14, thanks~