Skip to main content
gamedev.net
🔒 Locked

MDX, Textures in an ArrayList

Started by AcidInjury Nov 19, 2004 at 5:27 PM 2 replies 1.2k views
Original Post
AcidInjury
AcidInjury
The following code throws an exception. Can anyone clairify for me why?

segTexList.Add(TextureLoader.FromFile(device, @"..\..\assets\textures\ms_pods.tga"));


segTexList is of the type System.Collections.ArrayList Oh, and BTW the TextureLoad.FromFile function code above works fine when i'm assing it to a Texture reference. Here is the exact exception: An unhandled exception of type 'Microsoft.DirectX.Direct3D.InvalidDataException' occurred in microsoft.directx.direct3dx.dll Additional information: Error in the application. Will
zaniwhoop2
zaniwhoop2
It's throwing the exeception for one of a few reasons:
device is null
the path is not found (this is what happened to me a lot)
it can't load the file (bad file)

Try using an absolute path (Ex. C:\MyGame\ms_pods.tga) instead of a relative path.
AcidInjury
AcidInjury
Yea it turned out to be a bad filename on my part. I didn't think that was the issue because last time I had a bad file name I got a file not found exception.

Oh well, nothing like banging your head (and laptop) on the desk for 30 mins just to figure out you pluralized a word accidently in one place...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.