CWD prefixed in D3DXCreateEffect's errors
Hello everyone,
I hope someone can help with this lest I use the ugly solution.
In my game engine, I'm loading effects from my VFS via D3DXCreateEffectFromFile with a custom ID3DXInclude handler, using the fact that the include handler is also called (albeit twice) for the specified path. Now, this works fine; my problem is one of aesthetics. If there is an error, DirectX seems to prefix the specified path with the current working directory.
For instance, when I pass "DX9\Brush" (which includes a non-existant Globals.fxh) to D3DXCreateEffectFromFile with my custom include handler, I expect this error message:
DX9\Brush(4,10): error X1507: failed to open source file: 'Globals.fxh'
However, I get this:
D:\Project\MapEditor\bin\Debug\DX9\Brush(4,10): error X1507: failed to open source file: 'Globals.fxh'
The same occurs when I use D3DXCreateEffect after loading the file into memory beforehand:
D:\Project\MapEditor\bin\Debug\memory(4,10): error X1507: failed to open source file: 'Globals.fxh'
Which is even weirder, IMO. I can see why D3DXCreateEffectFromFile might think that it's an path relative to the CWD. But for memory files as well? That does not compute for me.
So I hope someone has a solution to this problem, otherwise I'll have to do some ugly string replaces.
Thanks in advance,
Mike
PS: for completeness, my situation is that I'm writing the engine in a statically linked C++ lib and am using that lib in this C# tool via C++/CLI. I'm using the August 2009 SDK. Debug runtime gives no error or related warning. Google searches gave me nothing relevant.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement