Problem with textures in X files

Started by
2 comments, last by minerjr 22 years, 8 months ago
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
Advertisement
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.
}
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.
-Pac "The thing I like about friends in my classes is that they can't access my private members directly." "When listening to some one tell about their problem (whether it's code or not), don't listen to what went right or wrong, but what they assumed....."
Thanks alot. I will try all of your suggestions tonight as I am at work right now. Thanks for the replies.



Minerjr

This topic is closed to new replies.

Advertisement