#include #include #include #include // Must be before everything else. // Cannot include DX12Includes because we redefine everything. // TODO : Separate lib // TODO : Only when not shipping // Check if we just load the dll and not link against? #include #pragma comment(lib, "dxcompiler.lib") using namespace Juliet; void Compile() { IDxcCompiler3* compiler = nullptr; DxcCreateInstance(&CLSID_DxcCompiler, IID_IDxcCompiler3, reinterpret_cast(&compiler)); IDxcUtils* utils = nullptr; DxcCreateInstance(&CLSID_DxcUtils, &IID_IDxcUtils, reinterpret_cast(&utils)); if (compiler == nullptr) { Juliet::Log(LogLevel::Error, LogCategory::Graphics, "Cannot create DXCompiler instance"); } if (utils == nullptr) { Log(LogLevel::Error, LogCategory::Graphics, "Cannot create IDxcUtils instance"); compiler->lpVtbl->Release(compiler); } IDxcIncludeHandler* includeHandler; utils->lpVtbl->CreateDefaultIncludeHandler(utils, &includeHandler); if (includeHandler == nullptr) { compiler->lpVtbl->Release(compiler); utils->lpVtbl->Release(utils); } } int main(int argc, char* argv[]) { auto* stream = IOFromFile(ConstString("XF"), ConstString("w")); IOPrintf(stream, ":)"); IOPrintf(stream, "%d%s", 1234, "Hello World!"); return 0; }