Sign in to follow this  

screen is always white when changing texture and render states?

This topic is 3491 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'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

Share this post


Link to post
Share on other sites

This topic is 3491 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this