Do I have to install the DirectX 7 SDK to compile a projecct, or can I use the DirectX 9 SDK?
Missing types:
LPDIRECT3D7 g_pD3D = NULL;
LPDIRECT3DDEVICE7 g_pD3DDevice = NULL;
D3DTLVERTEX g_Vertex[4]; //quad vertices for 3D images
Undefined defines:
//Set render state
g_pD3DDevice->SetRenderState(D3DRENDERSTATE_CLIPPING,false);
g_pD3DDevice->SetRenderState(D3DRENDERSTATE_LIGHTING,false);
g_pD3DDevice->SetRenderState(D3DRENDERSTATE_CULLMODE,D3DCULL_NONE);
if (pImage->isMasked == true)
g_pD3DDevice->SetRenderState(D3DRENDERSTATE_COLORKEYENABLE, TRUE);
if (alpha != 255) //if image is alpha blended
{
g_pD3DDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE,true);
g_pD3DDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND,D3DBLEND_SRCALPHA );
g_pD3DDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND,D3DBLEND_INVSRCALPHA);
g_pD3DDevice->SetTextureStageState(0,D3DTSS_ALPHAOP,D3DTA_TFACTOR);
}
Setting up the device.
//Query DirectDraw for access to Direct3D
hr = g_pDirectDraw->QueryInterface(IID_IDirect3D7,(VOID**)&g_pD3D);
if(FAILED(hr)) {ReleaseObjects();return 17;};
//Create the D3D device using hardware
hr = g_pD3D->CreateDevice(
IID_IDirect3DHALDevice,
g_pBackBuffer,
&g_pD3DDevice);//I'm getting a no palette attached error
//If no hardware support, create the D3D device using sofware
if(FAILED(hr))
{
hr = g_pD3D->CreateDevice(
IID_IDirect3DRGBDevice,
g_pBackBuffer,
&g_pD3DDevice);
if(FAILED(hr)) {ReleaseObjects();return 18;}
}