LPDIRECT3DVERTEXSHADER9 g_pVertexShader = NULL;
//Actually put in my InitD3D() function
g_pD3DDevice->GetVertexShader(&g_pVertexShader);
void InitBlit()
{
// Turn off culling, so we see the front and back of primitives
g_pD3DDevice->SetRenderState(D3DRS_CULLMODE,
D3DCULL_NONE);
// Enable alpha blended transparency.
g_pD3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
g_pD3DDevice->SetRenderState(
D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
g_pD3DDevice->SetRenderState(
D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
g_pD3DDevice->SetVertexShader(g_pVertexShader);
}
In this case, the difference was the SetVertexShader parameter. In DX9 it''s listed as, ''IDirect3DVertexShader9* pShader'', whereas in DX8 it''s listed as,''DWORD Handle''.
Sprites problems in Direct3D
I was following along with the 2D in 3D tutorial at this site. A problem occurred when I realized that it was using some DX8 functions that no longer exist in DX9. So I switched them to their DX9 equivilants, however some of the parameters are completely different, and I''m not sure what to use for them. If I run the below function in my program, it crashes:
Instead of SetVertexShader, use SetFVF. You might want to take a look at the link below for more info:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/convertingtodirectx9.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/convertingtodirectx9.asp
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement