LDV Posted February 4, 2004 Posted February 4, 2004 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. Quote
ThePentiumGuy Posted February 16, 2004 Posted February 16, 2004 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 Quote 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
RobyDx Posted February 17, 2004 Posted February 17, 2004 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 Quote Come to visit
ThePentiumGuy Posted February 17, 2004 Posted February 17, 2004 (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 February 17, 2004 by ThePentiumGuy Quote 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
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.