I am using visual studio c++ 2003 edition and I am trying to use the function CompileFromFIle function from DirectX SDK February 2010 SDK to add bloom to my source code for a mod I am working on and I get this error upon building the release build what is the issue. How do I fix this error?
Output build errors:
c:\Users\john\Desktop\fear public tools 108\Source\Game\ClientFxDLL\D3D10.h(839) : error C2061: syntax error : identifier '__out' c:\Users\john\Desktop\fear public tools 108\Source\Game\ClientFxDLL\D3D10.h(843) : error C2061: syntax error : identifier '__in' c:\Users\john\Desktop\fear public tools 108\Source\Game\ClientFxDLL\D3D10.h(847) : error C2059: syntax error : ')' c:\Users\john\Desktop\fear public tools 108\Source\Game\ClientFxDLL\D3D10.h(847) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Here is my code cpp file to look at also:
#define _WIN32_WINNT 0x600
#include "stdafx.h"
#include <stdio.h>
#include "C:\Users\john\Desktop\fear public tools 108\Source \Game\ClientFxDLL\D3Dcompiler.h"
#pragma comment(lib,"d3dcompiler.lib")
HRESULT CompileShader( _In_ LPCWSTR srcFile, _In_ LPCSTR entryPoint, _In_ LPCSTR profile, _Outptr_ ID3DBlob** blob )
{
if ( !srcFile || !entryPoint || !profile || !blob )
return E_INVALIDARG;
*blob = nullptr;
UINT flags = D3DCOMPILE_ENABLE_STRICTNESS;
#if defined( DEBUG ) || defined( _DEBUG )
flags |= D3DCOMPILE_DEBUG;
#endif
const D3D_SHADER_MACRO defines[] =
{
"EXAMPLE_DEFINE", "1",
NULL, NULL
};
ID3DBlob* shaderBlob = nullptr;
ID3DBlob* errorBlob = nullptr;
HRESULT hr = D3DCompileFromFile( srcFile, defines, D3D_COMPILE_STANDARD_FILE_INCLUDE,
entryPoint, profile,
flags, 0, &shaderBlob, &errorBlob );
if ( FAILED(hr) )
{
if ( errorBlob )
{
OutputDebugStringA( (char*)errorBlob->GetBufferPointer() );
errorBlob->Release();
}
if ( shaderBlob )
shaderBlob->Release();
return hr;
}
*blob = shaderBlob;
return hr;
}
int main()
{
// Compile vertex shader shader
ID3DBlob *vsBlob = nullptr;
HRESULT hr = CompileShader( L"BloomCombine.hlsl", "VSMain", "vs_4_0_level_9_1", &vsBlob );
if ( FAILED(hr) )
{
printf("Failed compiling vertex shader %08X\n", hr );
return -1;
}
// Compile pixel shader shader
ID3DBlob *psBlob = nullptr;
hr = CompileShader( L"BloomExtract.hlsl", "PSMain", "ps_4_0_level_9_1", &psBlob );
if ( FAILED(hr) )
{
vsBlob->Release();
printf("Failed compiling pixel shader %08X\n", hr );
return -1;
}
printf("Success\n");
// Clean up
vsBlob->Release();
psBlob->Release();
return 0;
}