how to load JPEG

Started by
8 comments, last by Binomine 19 years, 4 months ago
hello everybody,i am a newbie,i just know use auxDIBImageLoad to load BIT as texture.but now i want to use JPEG,can you tell me how to deal with it ,which functions i can use. thanks
Advertisement
If you are using OpenGL, take a look at Texture Mapping Part3 (JPEG) If you are using DirectX, take a look at Texture Mapping if you are using SDL look at SDL_Image. Regardless, you will have to use a custom library. I hope this helps! Good luck.
thank you.i use opengl.how about you?if compare with DX,which one is better for network game.
Quote:Original post by CNBABY
thank you.i use opengl.how about you?if compare with DX,which one is better for network game.
DirectX all the way. OpenGL is a graphics library, it only does graphics.
Quote:Original post by Binomine
Quote:Original post by CNBABY
thank you.i use opengl.how about you?if compare with DX,which one is better for network game.
DirectX all the way. OpenGL is a graphics library, it only does graphics.


OpenGL is a lot easier to use and learn the DirectX - I don't think anyone can argue me about that.

Now DirectX sure does have a lot more features than OpenGL: graphics, input, audio, networking as well as great documentation that make it a godo choice for having all the components in one package to devlop a game.

OpenGL *is* just a graphics api, BUT you have to look at all the avaliable stuff you can use with it. If you need fast and easy input you can use SDL, which will also take care of the opengl video. For audio there is FMOD and SDL_Mizer - both easy to use. For support of multiple images, there is SDL_Image. For networking, there is SDL_Net. There are also many other libraries to interface with OpenGL to give it all the features that DX has.

If you have the time and patience to learn DX, definitly go for it, but if you are just starting, or want something a little bit easier, that is just as comparable in performance and expectations, I'd go for using OpenGL/SDL libraries.

As for which one is better for network play, I'd say go for anything but DX. I've read in several game programming books as well as network game programming books (I have tons) that DirectPlay is the last thing you want to use. As of now with the new DX 9 *this may not be accurate anymore*. Ive heard some good things about Dx9, but I have no experience in it *yet*.

If you are serious about networks, take a look at this book: "Developer's Guide to Multiplayer Games" (ISBN 1-55622-868-6) I have not read much of it, but from what I have skimmed, it has about everything you will need to learn about multiplayer games. There are other books as well, but this is the main one I remember for this topic. I hope this helps and good luck!
I personally prefer Direct3D8 but for n00b go with OpenGL.
---http://www.michaelbolton.comI constantly dream about Michael Bolton.
Wow.. turning into a flame war. Stop now :D.

You have a few options. You can use a premade library for whatever API you decide to use. You can use libjpeg. Or, you could read the file specification and do it yourself.

Your choice :)


Oh yeah, preemptive IBTL.
Quote:Original post by Binomine
Quote:Original post by CNBABY
thank you.i use opengl.how about you?if compare with DX,which one is better for network game.
DirectX all the way. OpenGL is a graphics library, it only does graphics.


yes, but so what? if you wanted to, you could still use Direct X components for everything else, and use OpenGL for rendering. i just don't understand why it matters that OpenGL "only does graphics". D3D also only does graphics... they are graphics libraries [smile].
FTA, my 2D futuristic action MMORPG
Quote:Original post by graveyard filla
Quote:Original post by Binomine
Quote:Original post by CNBABY
thank you.i use opengl.how about you?if compare with DX,which one is better for network game.
DirectX all the way. OpenGL is a graphics library, it only does graphics.


yes, but so what? if you wanted to, you could still use Direct X components for everything else, and use OpenGL for rendering. i just don't understand why it matters that OpenGL "only does graphics". D3D also only does graphics... they are graphics libraries [smile].


DirectX is a full game library so all of it's component would work perfectly together. It just seems more like a mess to user various different libraries together since most of the time the coding conventions of those different libraries are completely different. Using OpenGL with Corona, Audiere or FMOD, SDL_ttf with HawkNL(whatever its called) would be much more of a mess then using Direct3D[with DirectSound, DirectPlay, etc.]. The best setup for an OGL coder would be : OpenGL, OpenAL, DevIL, and WinAPI. Setting up OpenAL is a little difficult though....
---http://www.michaelbolton.comI constantly dream about Michael Bolton.
Quote:Original post by graveyard filla
Quote:Original post by Binomine
Quote:Original post by CNBABY
thank you.i use opengl.how about you?if compare with DX,which one is better for network game.
DirectX all the way. OpenGL is a graphics library, it only does graphics.


yes, but so what? if you wanted to, you could still use Direct X components for everything else, and use OpenGL for rendering. i just don't understand why it matters that OpenGL "only does graphics". D3D also only does graphics... they are graphics libraries [smile].
I'm not endorcing DirectX, it's simply answering the question in once sentence: OpenGL does not have networking so it's unsuited for a network game. XD

Khaosifix, the whole arguement that since DirectX is a unified structure that it's better to use all D3D is silly as well. DirectX components are dis-simular enough that learnning a brand new library not too dissimular to learning a new component. And of course, many libraries work well with DirectX, like D3D with Bass Audio and HawkNL.

This topic is closed to new replies.

Advertisement