PDA

View Full Version : Graphics in FPC & Audio in FPC



DarknessX
01-04-2007, 08:02 PM
Hey everyone. Just wondering, whats the easiest way to make "modern" graphics in games that don't look like DOS graphics? I'm designing an RPG game, which I have a fair amount done, and it's currently text only, as I am unsure of how to do decent graphics.

Also, how would I go about playing an .mp3 file from a particular directory? I made the music for my RPG game, but I'm unsure as to running the files and stopping them...

Thanks,
DarknessX

Oh, and sorry if this isn't the place to put this... I think I posted it in the wrong place.

WILL
01-04-2007, 11:33 PM
Hey DarknessX, welcome to PGD! :)

I believe that there is some good information about this in previous posts if you care to sift through them. But for the sake of expediency, I'll put that info here for you.


Graphics:

I think one of the easiest game libraries that you can use for FPC is JEDI-SDL (http://sourceforge.net/projects/jedi-sdl). Not only is the graphics libraries of SDL (http://www.sdl.org/) very simple and straightforward, it comes with great interfaces for input, timers, sound, image format loaders and networking as well.

There is one limitation however, if you are seeking to go crazy with the kind of graphics that require hardware acceleration, you'll find limits as to what you can do. Baring that, it's great and works on pretty much ALL platforms.

There are 2 other packages that you can also look at; the Phoenix Engine and GLScene. Unfortunately GLScene is not 100% FPC compatible yet, however Phoenix, I believe is. There is a small group of people that are working on it here on PGD.

The other option is with the use of headers, either OpenGL or DirectX. For OpenGL there are many options; getting them from DelphiGL.com, Noeska, included with JEDI-SDL or the Free Pascal repository are a few places. I'm sure that the DirectX headers can be gotten from no better place than from Clootie's website.

One thing that I didn't mention is the difference between 2D and 3D. There are what are your options are:

JEDI-SDL -- 2D (or 3D using the OpenGL interface)
GLScene -- 3D (but it doesn't work 100% afaik)
Phoneix Engine -- 2D
OpenGL headers -- 2D and/or 3D
DirectX headers -- 2D or 3D (more information can be had from a more knowledgeable person than me though!)

No option is necessarily a wrong one, it just depends on what you want to do. Header options are usually chosen by the more experienced or ambitious though.


Sound:

There are quite a few options really. But in this case it depends on what type of release you are planning for your project. FMOD and BASS will playback MP3 and allow you to include their DLLs with your game provided that your game is freeware. There are licensing costs for including their library in Shareware and Commercial games though.

I'm not sure if JEDI-SDL will playback MP3s, but it has not such licensing restrictions as it's a completely free library.

There are others I'm sure, but this is not something I do much myself. You could take the option of using Ogg instead, which is a completely license free format and would also be cross-platform compatible. Also There are examples on Noeska's site to playback Ogg files using the OpenAL headers.

Perhaps others can provide more insight for you here... Hope this bit helps. :)

DarknessX
03-04-2007, 11:43 PM
THanks, I think Jedi-SDL is exactly what I need. I'll look into it.

OnYourMind
10-04-2007, 05:54 PM
Which version of Jedi-SDL should I download?

And how do you manually install it?

I'm such a clueless newbie when it comes to this.

savage
10-04-2007, 05:59 PM
What you want is this one...
http://downloads.sourceforge.net/jedi-sdl/JEDI-SDLv1.zip?use_mirror=switch

and just add the various SDL directories to your library path and you should be under way.

Latest changes are in CVS and can be downloaded to overwrite any files that are giving you problems from that archive.

Reiter
15-06-2007, 01:08 PM
@OnYourMind:

This site may help you: fp.sdl.de.vu (http://fp.sdl.de.vu)

DarknessX
17-06-2007, 02:46 PM
Or you can use my tutorial :D I have an article on installing Jedi-SDL with FreePascal on my forums...
http://pascalgamedevelopment.com/viewtopic.php?t=4552