Sprite animation

Started by
12 comments, last by CryoVenom 16 years, 7 months ago
I've gone through the DirectXTutorial.com tutorials. Everything has gone smoothly and I understand it all except for this problem I have with sprite animation. http://www.directxtutorial.com/Tutorial9/D-GameDisplay/dx9D3.aspx Instead of reading one frame at a time, it wants to read two frames! I get this: http://i3.photobucket.com/albums/y58/CryoVenom/untitled-4.jpg Instead of: http://www.directxtutorial.com/Graphics/Tutorial9/GameDisplay/dx9D2-5.PNG I don't see why there should be any difference between what he/she gets and what I get using the exact same code. I thought maybe my direct-X had a problem using PNG but it does this with other formats too. Can anyone help me understand what is wrong here? All the code is listed on that page I provided above.
Advertisement
Works fine, if you rewrote the code it's an error on your part.
Nothing to say from it without seeing Your actual code.

Only modifications i did was WS_OVERLAPPEDWINDOW and d3dpp.Windowed = true;
Since the ESC key seems a little dodgy and don't necessarily work.
Hm, well that's no good at all...I'm using their code except windowed = TRUE.

Do you think that it's possible it's not working because of my drivers?
I am using Omega drivers for my radeon.
You could try using beyondcompare to find the differences in your code and hers. Sometimes you just consistently overlook small differences in your code and a tutorials. I have used beyondcampare before to help me get over the same thing that is happening to you. Here is the link. The last time I used it was a about a year ago so I do not know for sure that it is still shareware. I hope that helps.
My problem is that I am using his/her code and it still doesn't run the same! :o
A tip for screenshots: .jpg's are smaller in filesize, but their compression looses quality. .png's use lossless compression. In other words, your image is too low quality to properly see what's going wrong. I can't even see if it's the same image twice, but scaled, or if it's split up somehow. :)

Anyway, did you understand the concept that the tutorial explained? If so, did you try to step through the code to see how exactly it is done? Also, a single screenshot isn't representative for an animation, so how does the animation behave?
Create-ivity - a game development blog Mouseover for more information.
The program is supposed to use an image of different frames of a sprite to make it seem as if it is animating. The box that it shows is supposed to start off as a line and then grow larger into a box. What I'm seeing is two different frames from the image at once.

This is the sprite sheet being used:
http://www.directxtutorial.com/Graphics/Textures/Panel3.PNG

Here you can see the frame that is in the correct image, and the two frames that show up in mine.

It's almost as if mine is using twice the width. What I don't understand is why do I have different(and strange) results when using the exact same code as the one in the tutorial. Have any of you read the code?

Maybe it's compressing the width.
Yeah.. I just tried it on my laptop and it didn't display right. It did the same thing you said it would. But I compiled it on my desktop and it worked perfectly.
What are your graphics cards and drivers?
Both my laptop and desktop are pretty ancient. My laptop has a Radeon IGP 340m. My Desktop has an old walmart special. A NVIDIA Geforce FX 5500. I have the proper drivers installed for both.

This topic is closed to new replies.

Advertisement