For some reason I can't get textures to display correctly when going from fullscreen to windowed and vice-versa. Every other managed resource gets re-created properly, like my vb and ib.
Here is my code for loading the texture.
[SOURCE]
D3DXCreateTextureFromFileEx(
g_pDevice, fileName,
0, 0, 0, 0,
D3DFMT_A8R8G8B8,
D3DPOOL_MANAGED,
D3DX_FILTER_POINT,
D3DX_DEFAULT,
d3d::MAGENTA,
NULL, NULL, &temp.m_tex );
Here is my code thats called when i reset the texture
hr = g_pDevice->SetRenderState( D3DRS_ALPHATESTENABLE, TRUE );
if( FAILED( hr ) )
{
::MessageBox( 0, "No support for renderstate ALPHATESTENABLE", 0, 0 );
return false;
}
g_pDevice->SetRenderState( D3DRS_ALPHAREF, d3d::MAGENTA );
g_pDevice->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_POINT);
g_pDevice->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_POINT);
g_pDevice->SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_POINT);
g_pDevice->SetRenderState( D3DRS_ALPHAFUNC, D3DCMP_EQUAL );
Also, I even try calling SetTexture( ), and passing it the currently active texture. But the model just displays white after a switch from full->windowed.
Thanks,
-ph33r