Sign in to follow this  
UHHH Internet

Jpegs in Directx

Recommended Posts

darookie    1441
You can just use the D3DX functions for loading them - D3DX supports them out-of-the-box. You can also save JPGs using D3DXSaveTextureToFile/D3DXSaveSurfaceToFile.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Are you sure? I just made a jpeg animation with photoshop.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
OOOO, well is there any way I can use that in Directx?

Share this post


Link to post
Share on other sites
darookie    1441
Nope. You will have to do that manually, which isn't that hard to do.
You just create your animation as usual and either save the frames to single images (easier to do that first) or assemble them into a single image layout into rows and columns of single frames.
In your game you load this image (or the the single images) along with extra information about time to next frame (or just a single frame-rate).
In your render loop you would then get the time that elapsed since the last frame and add that to an animation timer. If this timer equals or exceeds your animation frame rate you would switch to the next image and reset your animation timer to zero.
The last frame of animation has then to be treated in a special way, e.g. keeping it for one-shot animations or simply setting the animation frame counter back to zero for loops, etc. - you'll figure that out once you get started with it.

Share this post


Link to post
Share on other sites
UHHH Internet    122
OK, that's insulting. This photoshop program is from my work. Also I am currently making a fighting game so I wanted to make my own art at first and then get an artist to make some. And perhaps you did not read the posting rule for begginer forums.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
the gif file extensionis not a supported format under DX.I recommend making jpeg/bmp/tga (supported formats) with the extension pic01.tga,pic02.tga, pic03.tga, ect. then writing a simple file loader (utilizating the D3DXfunction that load single images).You can put these all in an nice texture array,and then change between them by referenceing them as your_textures[i], where i is the number of pics you loaded. If this does not make sense to you, no problem - then you need to start with a smaller project for practice. Tetris/pong is always recmmended,as they require movement animation of the images, but not animated sprites themselves. Plus there are many tutitorials you can find around the web. The photoshop comment was indeed not needed,but it does sound like you need a lot more practice with the tool since you do not know the differences in the file types you are saving in.Anyways,stick with it.

Share this post


Link to post
Share on other sites
darookie    1441
Quote:
Original post by UHHH Internet
So could you explain how to make the images side by side. If you can thanks and if you can't then keep the comments to yourself.

You can easily read it up in Photoshop's documentation.
Basically what you do is this: you have your animation frames (n images of equal width and height) and simply create a new new image that is n*width pixels wide (width being the width of a single animation frame) and has the same height as your animation frames.
You then simply copy each frame into the new image - side by side.
How to do this exactly (e.g. along the lines of "click this", "select that") can be read up in the Photoshop CS manual. Sorry, but I seriously think nobody here will explain the process more detailed than I just did.
And to be honest - even if I could explain it even more detailed (which I can't since I neither own nor use Photoshop) I simply wouldn't because that's what manuals are for [wink].

Good luck anyway,
Pat

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this