elguignardo

i want to load a texture from a custom image format file.

i have loaded my datas in an Image object, i can draw them on screen using gdi

i try to load them like this :

Bitmap bmp = new Bitmap( img );
Texture t = new Texture( device,bmp,0,Pool.Default );

and i get an exception.

in order to validate i haven't make any mistake i try this:
Bitmap bmp = new Bitmap( filePath );
Texture t = new Texture( device,bmp,0,Pool.Default );

i got the same exception

finaly i try:
Texture t = TextureLoader.FromFile(device,filePath);

and it works

how can i made my original solution work


Re: Game Technologies: DirectX 101 [directx]loading Texture from custopm format

GeniusLife

Well there is one side effect to that... you cannot pass your project to someone else or anywhere else unless you got the correct path for your resources. That the problem I am trying to deal with and it is the greatest conflict to game programming we are having right now.