Can anyone help me with this problem:
I just want to show a .X file (object) on the screen. Ererythings initialized so far (light disabled). In every resource I found I am told to use the CD3DFile class, but these resources referred to DirectX 7. I found the D3DFile.cpp and .h files in the sample-area of the SDK and simply copied them for use; but half of the functions I should use are not there!
What I write simply is this:
///////////////////////////////////////////////////////
CD3DFile* file= new CD3DFile();
if(FAILED(file->Create(lpDevice, "testcylinder.x"
))
{
return FALSE;
}
lpDevice->Clear(0, 0, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,0), 1.0f, 0);
D3DMATRIX mat_world;
CreateStdMatrix(&mat_world);//own function(works correct)
if(FAILED(file->Render(lpDevice)))
{
return FALSE;
}
if(FAILED(lpDevice->SetTransform(D3DTS_WORLD, &mat_world)))
{
return FALSE;
}
lpDevice->Present(NULL, NULL, NULL, NULL);
delete file;
file= NULL;
//////////////////////////////////////////////////////
Can anyone tell me what I am doing wrong (my first try with Direct3D) or tell me any library to use???
I just want to show a .X file (object) on the screen. Ererythings initialized so far (light disabled). In every resource I found I am told to use the CD3DFile class, but these resources referred to DirectX 7. I found the D3DFile.cpp and .h files in the sample-area of the SDK and simply copied them for use; but half of the functions I should use are not there!
What I write simply is this:
///////////////////////////////////////////////////////
CD3DFile* file= new CD3DFile();
if(FAILED(file->Create(lpDevice, "testcylinder.x"
{
return FALSE;
}
lpDevice->Clear(0, 0, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,0), 1.0f, 0);
D3DMATRIX mat_world;
CreateStdMatrix(&mat_world);//own function(works correct)
if(FAILED(file->Render(lpDevice)))
{
return FALSE;
}
if(FAILED(lpDevice->SetTransform(D3DTS_WORLD, &mat_world)))
{
return FALSE;
}
lpDevice->Present(NULL, NULL, NULL, NULL);
delete file;
file= NULL;
//////////////////////////////////////////////////////
Can anyone tell me what I am doing wrong (my first try with Direct3D) or tell me any library to use???