Textures in 3D get's nasty

LDV

Freshman
Joined
Dec 29, 2003
Messages
31
Hi,
I'm having some troubles with Textures in DirectX3D.

I'm trying to create textures: like:
m_texture = new Texture(dev, m_bitmap, Usage.SoftwareProcessing, Pool.Default);

But i get InvalidCallException !

So i'm using:
m_texture = TextureLoader.FromFile(dev, fileName);

But when i try to show part of the texuture using Sprite class:
sprite.Draw(m_texture, m_rect[num], new Vector3(0, 0, 0), new Vector3(x, y, 1), Color.FromArgb(255, 255, 255, 255));

I get it all very deformed.

Any ideas?
Thansk, LDV.
 
the really problems isn't image format (it read jpeg, gif and tga) but image dimension. Most graphics card when load an image deform it on one of this format
2x2 -4x4 - 8x8 16 x16 and go on
the if you load a bitmap of 250 x 300 it load it as 256 x256 or 256 x 512

the use only square texture

howerver tha first metod isn't correct
m_texture = new Texture(dev, m_bitmap, 0, Pool.Default);
if you use 0 directX'll found the best possible
sorry for bad inglish but I'm Italian
 
no probs,

m_texture = new Texture(dev, m_bitmap, 0, Pool.Default); <--

i'd use m_texture = TExtureLoaded.LoadFile(etc..),
im sorry - i dont remember the exact arguments but i'll get back to you when i am on the computer with .net


edit: try this - m_texture = new Texture(dev, m_bitmap, Usage.SoftwareProcessing, Pool.Default); i found it on another post lol
 
Last edited:
Back
Top