apanjocko Posted September 3, 2003 Posted September 3, 2003 (edited) thank you for reading this. i'm currently using direct3d for 2d graphics and are having different kinds of small problems. 1. i am loading graphics for my sprites using the Direct3D.TextureLoader.FromFile method, and gathering information from the file, like width and height, using the Direct3D.TextureLoader.ImageInformationFromFile. i assume there must be a better way to do this than to read the file physically twice. i can't find the information in the texture. 2. i would like to get a hold of the pixel data inside the texture to be able to [1] scan the picture to find its _actual_ size rather than the 2^x texture size and [2] do pixel perfect collision detection. where is the data hidden? 3. the little game runs fine on my computer (directx9.0b) but does not run at all at my friends computer (directx9.0a). it doesn't even enter the main method as all exceptions are catched and none are apparently thrown. just a standard windows error of some sort. anyone knows what this is related to? a/b? EDIT: he has no developping libraries as i do. thank you plenty apanjocko Edited September 3, 2003 by apanjocko Quote
AndreRyan Posted September 3, 2003 Posted September 3, 2003 Has it got the .Net framework? And you may need to copy Microsoft.DirectX*.dll into the program directory on the other computer to. Quote .Net allows software to be written for any version of Windows and not break like Unmanaged applications unless using Unmanaged procedures like APIs. If your program uses large amounts of memory but releases it when something else needs it, then what's the problem?
apanjocko Posted September 3, 2003 Author Posted September 3, 2003 yes, he has the 1.1 .net framwork. are you sure about the .dll's? where can i find these? it seems ridiculus that you have to ship all the unmanaged directx dll's with the game. where can you read about that? thanks :) Quote
apanjocko Posted September 3, 2003 Author Posted September 3, 2003 ok he has now downloaded the 9.0b runtime and it still doesn't work. it's obvious that he LACKS the managed direct 9 dll's. i found those in the directx 9 dev-runtime download from microsoft's site but as he is not a developper where does he find a download for that? thanks. Quote
apanjocko Posted September 3, 2003 Author Posted September 3, 2003 i'm now creating the texture with Texture.FromBitmap so i can analyse the contents in the Bitmap itself before creating the texture. this eliminates question 1 and 2! :) Quote
*Experts* mutant Posted September 3, 2003 *Experts* Posted September 3, 2003 There is small installer for Managed DirectX9 (about 1.1 MB), it should come with the redistributable. Quote
apanjocko Posted September 3, 2003 Author Posted September 3, 2003 thanks, i've seen something like that. i'll take a look at it. Quote
*Experts* Nerseus Posted September 3, 2003 *Experts* Posted September 3, 2003 For step 1 and 2, you can also use the GetLevelDescription method to return a SurfaceDescription structure full of detailed info about the bitmap you loaded. Keep in mind that the built in texture loading methods will stretch your bitmap to meet the power of 2 requirements. Meaning, if you have a 120x96 texture, you might end up with a 128x128 or 256x256 bitmap with all of your original bitmap data stretched out. At least, that's what I've seen (and read that that's pretty much how it works). To read the pixel data, I use LockRectangle, a method of the Surface object. You can get a surface from a texture using the Texture's GetSurfaceLevel method. LockRectangle is its own little beast. See if you can find some help on Google. If not, I can dig up some old code that uses it :) -Ner Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
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.