screen is always white when changing texture and render states?

Started by
-1 comments, last by freeworld 15 years, 11 months ago
I'm just messing around with different SetTextureStage calls but the screen is always completely white when I use them. If you need more info than what's below please ask I'm not sure what all you'll want.

// Everything is 2D Orthoganal, So I just draw one background image and
// randomly draw several imgaes in a 128x128 pixel area. The normal states 
// just setup alphablending.


if (state == ZTEXTURESTATE_NORMAL)
	{
		(*m_d3ddev)->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
		(*m_d3ddev)->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
		(*m_d3ddev)->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE);

	}

	if (state == ZTEXTURESTATE_SCREEN_BLEND)
	{
		(*m_d3ddev)->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ZERO);
		(*m_d3ddev)->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_SRCCOLOR);
		(*m_d3ddev)->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_ADD);
		(*m_d3ddev)->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);

// the above code is what I'm using to set the states, there's only to sets of 
// changes, the background is normal the others are the screen blend

// the inital states are setup at the beginning of the program
m_d3ddev->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
	m_d3ddev->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
	m_d3ddev->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
	m_d3ddev->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
	m_d3ddev->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE);


any help is appreciated
[ dev journal ]
[ current projects' videos ]
[ Zolo Project ]
I'm not mean, I just like to get to the point.

This topic is closed to new replies.

Advertisement