Milos Cvjeticanin

Hello!
I am coding in C# and I have encountered rather strange behaviour in Direct3D. Texture loader takes about 2 minutes to load 1201x1201 RGB bitmap!!!

texture = Texture.FromBitmap(device, bmp, 0, Pool.Managed);

In contrary, this takes much less but would be absurd to use it as I'd have to save a bitmap to file and then load it as a texture:

texture = TextureLoader.FromFile(device, "image.bmp");

Please help me tame Texture class!
Thanx in advance.


Re: Game Technologies: Graphics Texture loading problem!

Ralf Kornmann

Unfortunately this is a known problem. For performance reason you should avoid using bitmaps and textures together.






Re: Game Technologies: Graphics Texture loading problem!

Milos Cvjeticanin

Thanx for replying!
But how do use bitmap as a texture in Direct3D then




Re: Game Technologies: Graphics Texture loading problem!

The ZMan

The issue only occurs when you run under the debugger... not sure that will help you much but it might.

Convert your texture to DDS using the DirectX texture tool in the SDK - I think that will stop the conversion process.

See http://forums.microsoft.com/msdn/showpost.aspx postid=138755&siteid=1 for all the details. I was hoping that the VIsual studio service pack would speed this up.






Re: Game Technologies: Graphics Texture loading problem!

Milos Cvjeticanin

This problem appears in both debug and release versions of program. How is it that TextureLoader.FromFile works just fine
That unsafe routine does not work for me! It crashes on first line (texture = new Texture(device, bitmap.Width, bitmap.Height, 1, Usage.Dynamic, Format.A8R8G8B8, Pool.Default);)
Please help!