Sign in to follow this  
wforl

Directx dll from c#

Recommended Posts

Whilst this question is largly DirectX based, I think its going to result in a general programming reply, so I decided to place it here. Im wanting to create a C# application with GUI to compile my HLSL files and report back any errors. At the moment, Im just having the C# application call the fxc.exe application, with the HLSL file as one of the command line arguments, but the errors reported are obviously only seen in the console window of fxc.exe. Im wanting these errors to be passed back to the C# application, and be visible in the GUI. At the moment I see no way of doing this. From reading the documentation on fxc.exe, it mentions nothing about storing errors to a file, they only seem to be outputed to the console window. Whilst I could get this working with the XNA libraries, Im trying to avoid this as the rest of my engine uses the standard Directx libraries and C++. So it seems daft to have the XNA runtimes as one of the requirements purly to compile shaders. So Im thinking about loading one of the Directx .dlls in c#, and calling something like D3D10CompileEffectFromMemory() from C#. But I havent done anything like this before. So Im looking for some advice. The problem I see is that D3D10CompileEffectFromMemory(), requires as arguments, other types that are declared in the DirectX headers, such as ID3D10Blob. Which will contain the any errors reported and the compiled shader data.

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