Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to render .X files in VC++(.Net) and DirectX 8.1

Status
Not open for further replies.

mirr2001

Programmer
Mar 29, 2002
24
DK
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???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top