Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Sfpiano

Sprites problems in Direct3D

This topic is 5587 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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:
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''.

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!