Sign in to follow this  
Mike nl

CWD prefixed in D3DXCreateEffect's errors

Recommended Posts

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.

Share this post


Link to post
Share on other sites
*bump*

Also, I found out today that this doesn't happen for files which are included from the main file. Then it shows the path as specified in the include directive.

Doesn't anyone have an idea about this?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this