Sign in to follow this  

[.net] Trouble loading textures

Recommended Posts

I've tested my game on 4 computers, and it so far works perfectly on 2 of them. One of them gives me the following message, source, and stacktrace: Message: Error in the application. Source: Microsoft.DirectX.Direct3D Stack Trace: at Microsoft.DirectX.Direct3D.Texture.CreateTextureFromBitmap(Device device, Bitmap image, Usage usage, Pool pool) at Microsoft.DirectX.Direct3D.Texture..ctor(Device device, Bitmap image, Usage usage, Pool pool) at Nova.Form1.InitializeGraphics() at Nova.Begin.Main() To me, this looks like it's failing to load the texture. The only call in InitializeGraphics() that uses textures is the following: tex=new Texture(device, new Bitmap("art\\starfieldold.bmp"), Usage.Dynamic, Pool.Default); On the computer on which it fails, the file is there, and image viewers load it fine. Anyone know what could be causing this to fail? Thanks. -Nick

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
Texture loading is effected by the capibilities of the graphics hardware on each computer. And could be any number of things: The memory size of the texture, the dimensions, the format are just a few that come to mind.
Take a look at the texture caps in the caps viewer on each machine, what are the differences?
Some graphics cards require square power of two sized textures, most(all) cards have an upper limit on the dimensions of a texture. Some cards may not support dynamic textures at all. Many cards only support a limited set of texture formats that may be different for static and dynamic textures.

Also, a stack trace is great, but what was the exception? InvalidCallException, OutOfVideoMemoryException, OutOfMemoryException ?

You may want try running with the Debug Runtime to get more helpful error output.

hope this helps.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this