metal-seed
metal-seed copied to clipboard
π€π± An Apple Metal starter repo that you could use to get the ball rolling.
Metal Seed
A Metal repo you can use to get started with your own renderer.
Setup
First install:
Then type the following in your terminal.
# π Clone the repo
git clone https://github.com/alaingalvan/metal-seed --recurse-submodules
# πΏ go inside the folder
cd metal-seed
# π― If you forget to `recurse-submodules` you can always run:
git submodule update --init
# π· Make a build folder
mkdir build
cd build
# π To build your XCode project on Mac OS
cmake .. -G Xcode
# π± To build your XCode project targeting iOS / iPad OS
cmake .. -G Xcode -DCMAKE_SYSTEM_NAME=iOS
# π¨ Build project
cmake --build .
Refer to this blog post on designing C++ libraries and apps for more details on CMake, Git Submodules, etc.
Project Layout
As your project becomes more complex, you'll want to separate files and organize your application to something more akin to a game or renderer, check out this post on game engine architecture and this one on real time renderer architecture for more details.
ββ π external/ # πΆ Dependencies
β ββ π crosswindow/ # πΌοΈ OS Windows
β ββ π crosswindow-graphics/ # π¨ Metal Layer Creation
β ββ π glm/ # β Linear Algebra
ββ π src/ # π Source Files
β ββ π Utils.h # βοΈ Utilities (Load Files, Check Shaders, etc.)
β ββ π Renderer.h # πΊ Triangle Draw Code
β ββ π Renderer.mm # -
β ββ π Main.mm # π Application Main
ββ π .gitignore # ποΈ Ignore certain files in git repo
ββ π CMakeLists.txt # π¨ Build Script
ββ π license.md # βοΈ Your License (Unlicense)
ββ πreadme.md # π Read Me!