Archived

This topic is now archived and is closed to further replies.

minerjr

Problem with textures in X files

Recommended Posts

minerjr    122
I am having trouble loading X files in my game. I can load up the object but the textures do not show up. I tried the file in the XFile program under the DirectX SDK and they work fine there. Here is my loader code for my X file and the render. CD3DFile* Ladder; Ladder = new CD3DFile(); if( FAILED( Ladder->Load( "Test.x" ) ) ) { return InitFail(WindowhWnd, hr, "Failed to load Test.x"); } And the render code. Ladder->Render( lpD3DDev ); Now do I have to load in the textures manually. I was looking at the XFILE loader code and it looks like It can do it self. Thanks for any help. This is slowing the progress of my game considerably. Minerjr Edited by - minerjr on August 7, 2001 7:46:42 AM

Share this post


Link to post
Share on other sites
sevecol    122
if (use Framework)
{
after load x file,you must:
D3DTextr_CreateTextureFromFile( "some.bmp" );
some.bmp is the Texture.
}
else
{
you must create surface for Texture,and SetTexture befor draw.
}

Share this post


Link to post
Share on other sites
Pactuul    122
I''m going to assume your using the sdk''s example for model loading. If so then make sure the texture is in the same directory as the xfile. Also what happened with me was that the xfile and the texture where both in the \data directory, and the code only looked for the textures in the main program''s directory. You might have to edit the string it''s using before it loads the texture to add the \data\ (or what ever directory your using.

If this still doesn''t fix the problem you would be best advised to run the debugger and setup through line by line where it''s loading the texture and make sure everything is right.

Share this post


Link to post
Share on other sites