Original Post
Hi:
Has anyone ever run and taken a close look at the microsoft Cubic mapping sample code before. the hardware capacity identifying part is so confusing and I have some questions about it. First of all, if the code:
m_d3dCaps.TextureCaps & D3DPTEXTURECAPS_CUBEMAP
returns a value of 0, does that mean cubic mapping cannot be done on that particular computer? Atleast that is the value returned on my computer and then the sample code skips over the code that initialises the cubic texture, like this:
if( m_d3dCaps.TextureCaps & D3DPTEXTURECAPS_CUBEMAP )
{
if( FAILED( D3DXCreateCubeTexture( m_pd3dDevice, CUBEMAP_RESOLUTION, 1,
D3DUSAGE_RENDERTARGET, m_d3dsdBackBuffer.Format, D3DPOOL_DEFAULT, &m_pCubeMap ) ) )
{
if( FAILED( D3DXCreateCubeTexture( m_pd3dDevice, CUBEMAP_RESOLUTION, 1,
0, m_d3dsdBackBuffer.Format, D3DPOOL_DEFAULT, &m_pCubeMap ) ) )
{
m_pCubeMap = NULL;
}
}
}
The thing amazes me is that the cubic mapping seems still working fine.A plane is flying around a teapot with the dynamic reflections on it. I am confused that the cubic mapping still works without the initialization of the cubic texture. Can anyone tell me why, helping me to make things clearer?
Thanks for any help in advance