Hi,
I want to use D3DX8 and D3DX9 (Sprite and Font class) in one project. Using D3D8 and D3D9 together is not a problem but the X variants have the same function and class name for DX8 and DX9. This causes problems while executing the (test) program.
//D3D8 part
LPDIRECT3DDEVICE8 device;
....
ID3DXSprite *sprite;
D3DXCreateSprite(device, &sprite);
sprite->Release();
//and D3D9 part in an other file
LPDIRECT3DDEVICE9 device;
....
ID3DXSprite *sprite;
D3DXCreateSprite(device, &sprite);
sprite->Release();
The D3D8 part will run fine but the D3D9 part crashes in the D3DXCreateSprite method. I checked the generated assemblercode and it turns out that both D3DXCreateSprite methods are the same so the code tries to initialize the D3DX9 Sprite with the D3DX8 Sprite code what can't work.
I hoped something like this could work but for sure it does not:
namespace D3D8
{
#include <d3dx8.h>
#pragma comment(lib, "d3d8.lib")
#pragma comment(lib, "d3dx8.lib")
}
D3D8::ID3DXSprite *sprite;
D3D8::D3DXCreateSprite(device, &sprite);
sprite->Release();
The compiler doesn't create seperate methods.
Anyone has an idea how I can include both DX versions in one project? One solution could be to dynamicly load the d3dx_....dll and use GetProcAddress for D3DXCreateSprite but I hope there is an "build in" solution.
Thanks for your help!