Adding IOStream + String library (needed to have proper iostream)
This commit is contained in:
@@ -66,6 +66,7 @@
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)Juliet\include\;$(SolutionDir)JulietShaderCompiler;</AdditionalIncludeDirectories>
|
||||
<LanguageStandard>stdcpp20</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
@@ -85,6 +86,7 @@
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp20</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
@@ -102,12 +104,12 @@
|
||||
<ClInclude Include="DXCompiler.h"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CopyFileToFolders Include="DXShaderCompiler\dxcompiler.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="DXShaderCompiler\dxil.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="DXShaderCompiler\dxcompiler.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</CopyFileToFolders>
|
||||
<CopyFileToFolders Include="DXShaderCompiler\dxil.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</CopyFileToFolders>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
||||
@@ -1,49 +1,49 @@
|
||||
|
||||
//#include <Core/Common/CoreTypes.h>
|
||||
//#include <Core/Logging/LogManager.h>
|
||||
//#include <Core/Logging/LogTypes.h>
|
||||
#include <Core/Common/String.h>
|
||||
#include <Core/HAL/IO/IOStream.h>
|
||||
#include <Core/Logging/LogManager.h>
|
||||
#include <Core/Logging/LogTypes.h>
|
||||
|
||||
// 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 <DXCompiler.h>
|
||||
|
||||
//#include <DXCompiler.h>
|
||||
//#pragma comment(lib, "dxcompiler.lib")
|
||||
#pragma comment(lib, "dxcompiler.lib")
|
||||
|
||||
//using namespace Juliet;
|
||||
using namespace Juliet;
|
||||
|
||||
void Compile()
|
||||
{
|
||||
// IDxcCompiler3* compiler = nullptr;
|
||||
// DxcCreateInstance(&CLSID_DxcCompiler, IID_IDxcCompiler3, reinterpret_cast<void**>(&compiler));
|
||||
//
|
||||
// IDxcUtils* utils = nullptr;
|
||||
// DxcCreateInstance(&CLSID_DxcUtils, &IID_IDxcUtils, reinterpret_cast<void**>(&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);
|
||||
// }
|
||||
IDxcCompiler3* compiler = nullptr;
|
||||
DxcCreateInstance(&CLSID_DxcCompiler, IID_IDxcCompiler3, reinterpret_cast<void**>(&compiler));
|
||||
|
||||
IDxcUtils* utils = nullptr;
|
||||
DxcCreateInstance(&CLSID_DxcUtils, &IID_IDxcUtils, reinterpret_cast<void**>(&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("bleeblou"), ConstString("w"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user