crosire / d3d8to9

A D3D8 pseudo-driver which converts API calls and bytecode shaders to equivalent D3D9 ones.
BSD 2-Clause "Simplified" License
875 stars 77 forks source link

Using d3dx9 #99

Closed asdfasdfdev closed 5 years ago

asdfasdfdev commented 5 years ago

I'm having trouble including d3dx9.h in my application as I get a bunch of redefinition and ambiguous symbol errors.

Is it possible to use d3d8to9 alongside d3dx9, and if so, how?

Thanks!

metallicafan212 commented 5 years ago

You can't directly use those headers in D3D8to9. Basically, it's because of the conflicting definitions, but to get around this you can compartmentalize your code into another dll or static library to keep it away from D3D8to9. I do this to be able to load and compile HLSL shaders when I detect a few asm lines in D3D8to9. You just have to maintain a interface between the two parts, making sure to go around any conflicting definitions. Things like a pointer to the device are fine to pass through to each other, but things like textures will cause the redefinition errors.