File tree Expand file tree Collapse file tree 3 files changed +27
-1
lines changed
Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Original file line number Diff line number Diff line change 22
33Go from zero to your first shader in minutes.
44
5+ ## 0) Populate submodules
6+ ``` sh
7+ git submodule update --init --recursive
8+ ```
9+
510## 1) Install + Build
611
712### macOS (Homebrew)
Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ sudo apt-get install -y \
7575### Linux/macOS
7676``` sh
7777# FFmpeg is optional; set `-DDISABLE_FFMPEG=ON` (see `CMakeLists.txt`) to build without it.
78+ git submodule update --init --recursive
7879cmake -B build .
7980cmake --build build
8081./build/vsdf {filepath}.frag
@@ -83,6 +84,7 @@ cmake --build build
8384### Windows
8485``` powershell
8586# FFmpeg is optional; set `-DDISABLE_FFMPEG=ON` (see `CMakeLists.txt`) to build without it.
87+ git submodule update --init --recursive
8688cmake -B build -DCMAKE_TOOLCHAIN_FILE="C:/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake" .
8789cmake --build build --config Release
8890.\build\Release\vsdf.exe {filepath}.frag
@@ -176,6 +178,7 @@ Also by running the test suite it will check this automatically
176178
177179### Linux/macOS
178180``` sh
181+ git submodule update --init --recursive
179182cmake -B build -DBUILD_TESTS=ON -DDEBUG=ON
180183cmake --build build
181184./build/tests/vsdf_tests
@@ -184,6 +187,7 @@ cmake --build build
184187
185188### Windows
186189``` powershell
190+ git submodule update --init --recursive
187191cmake -B build -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE="C:/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake" .
188192cmake --build build --config Debug
189193.\build\tests\vsdf_tests\Debug\vsdf_tests.exe
Original file line number Diff line number Diff line change 88#include < cstdint>
99#include < filesystem>
1010#include < optional>
11+ #include < spdlog/fmt/fmt.h>
1112#include < spdlog/spdlog.h>
1213#include < string>
1314#include < unordered_map>
1415
1516namespace {
17+ constexpr const char kVersion [] = " vsdf dev" ;
18+
19+ void printHelp (const char *exe) {
20+ fmt::print (" Usage: {} [options] <shader.frag>\n Example: {} --toy "
21+ " shaders/testtoyshader.frag\n " ,
22+ exe, exe);
23+ }
24+
25+ void printVersion () { fmt::print (" {}\n " , kVersion ); }
26+
1627spdlog::level::level_enum parseLogLevel (const std::string &levelStr) {
1728 static const std::unordered_map<std::string, spdlog::level::level_enum>
1829 kLevels = {{" trace" , spdlog::level::trace},
@@ -55,7 +66,13 @@ int main(int argc, char **argv) {
5566 std::string arg;
5667 for (int i = 1 ; i < argc; ++i) {
5768 arg = argv[i];
58- if (arg == " --toy" ) {
69+ if (arg == " --help" ) {
70+ printHelp (argv[0 ]);
71+ return 0 ;
72+ } else if (arg == " --version" ) {
73+ printVersion ();
74+ return 0 ;
75+ } else if (arg == " --toy" ) {
5976 useToyTemplate = true ;
6077 continue ;
6178 } else if (arg == " --headless" ) {
You can’t perform that action at this time.
0 commit comments