I am trying to use the DirectXTex library but everytime I try, the compiler keeps giving me one error after another. More specifically, I want to use the headers DDSTextureLoader.h
and WICTextureLoader.h
so that I can use the functions CreateWICTextureFromFile
and CreateDDSTextureFromFile
so i can load textures onto my Direct3D11 application. But the compiler gives me 3 errors:
Function 'DXGI_FORMAT MakeSRGB (DXGI_FORMAT)' already has a body
'=': unable to resolve function overload
this error repeats 2 times
'SetDebugObjectName': ambiguous call to overloaded function
this error repeats 3 times
Compiler also says that these errors come from the file WICTextureLoader.cpp
I'm not sure what to do to fix these errors...Down below is my code (I included all the header files that I used in my game)
#include <windows.h>
#include <D3D11.h>
#include <dinput.h>
#include <D3Dcompiler.h>
#include <DDSTextureLoader.h>
#include <WICTextureLoader.h>
#include <sstream>
#include <SimpleMath.h>
#include <SpriteFont.h>
#include "DDSTextureLoader.cpp"
#include "WICTextureLoader.cpp"
CreateDDSTextureFromFile(device, L"SpaceSky512.dds", &SkyTexture, &SkyTextureResource);
CreateWICTextureFromFile(device, DevContext, L"grass.jpg", NULL, &Texture, 0);
I stopped using the headers from the legacy directX SDK and started using the windows SDK like most people. But how can i fix the compiler errors?