Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

  • 2 weeks later...
Posted
Hi,

 

 

But i get InvalidCallException !

 

 

I think its because directX can only read bitmaps or jpg's -

view http://www.xtremedotnettalk.com/showthread.php?threadid=82842 for info about how to display textures.. a file's attached - it should show you how to display an image..

unfortunately im having the same problem - the image is blurry

My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!)

vbprogramming.8k.com

My Project (Need VB.NET Programmers)

http://workspaces.gotdotnet.com/ResolutionRPG

Posted

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

Posted (edited)

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

Edited by ThePentiumGuy

My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!)

vbprogramming.8k.com

My Project (Need VB.NET Programmers)

http://workspaces.gotdotnet.com/ResolutionRPG

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...