yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
b4fc380af
master
1// main.cpp 2 3// This file implements the entry point for `slangd`, the daemon process of Slang's language server. 4 5#include "../../source/core/slang-basic.h" 6#include "../../source/slang/slang-language-server.h" 7 8#include <thread> 9 10int main (int argc ,const char * const * argv ) 11{ 12bool isDebug = false; 13for (auto i = 1 ;i < argc ;i ++ ) 14 { 15if (Slang ::UnownedStringSlice (argv [i ])== "--debug" ) 16 { 17isDebug = true; 18 } 19else if (Slang ::UnownedStringSlice (argv [i ])== "--print-builtin-module" && i < argc - 1 ) 20 { 21Slang ::UnownedStringSlice moduleName = Slang ::UnownedStringSlice (argv [++ i ]); 22Slang ::ComPtr < slang::IBlob > code ; 23Slang ::getBuiltinModuleSource (moduleName ,code .writeRef ()); 24printf ("%s\n" , (const char * )code -> getBufferPointer ()); 25return 0 ; 26 } 27 } 28if (isDebug ) 29 { 30 std::this_thread::sleep_for (std::chrono::seconds (10 )); 31 } 32Slang ::LanguageServerStartupOptions options ; 33options .parse (argc ,argv ); 34auto result = Slang ::runLanguageServer (options ); 35 slang::shutdown (); 36return result ; 37}