PDA

View Full Version : Developing a game - stuck at choosing a graphics library



Ixy
13-01-2009, 08:49 PM
First of all, I want to say hi to all the members of PGD.

In my school, we're all required to make a simple game for our Computers class at the end of our graduate year.
The only bigger restriction is that it's developed in Free Pascal.
Which is not a problem, as I have quite some experience with it.

We're allowed to use any graphics and such libraries we want. So I'm kinda stuck at choosing one (I was thinking OpenAL for sound).

The game would be a 2D sidescrolling (or not if it's too complicated) platformer OR a simple 2D shooter like Soldat, only not so advanced. :)
That are my two ideas for now.

So, basically, I'm looking for a graphics library that's not too complicated, but not too restrictive either. Savage recommended using SDL. What do you think? (just looking for different opinions :) )

We have about a month to complete, so I think the platformer is a better idea, since it doesn't require advanced stuff like AI and such. But then again, I love a challenge, so I would LOVE to make a 2D FPS, but I just don't know if it is possible to finish it in such a short time...

jdarling
13-01-2009, 09:19 PM
I'm going to agree with Savage here, SDL is the way to go. In fact, I'll even give myself a bit of a bump here and say that a good place to start would be with my SDL, LUA, and Freepascal Game Engine Demo (http://eonclash.com/ViewProduct.php?ProductID=23). Its not a complete engine, but it is quite flexible and a decent starting point. I've made it work in Linux and Windows, never got around to the MAC port thanks to the difficulty of getting LUA to link on a MAC.

Hope it helps.

arthurprs
13-01-2009, 11:10 PM
SDL,

you will not have trouble to find help or demos

WILL
13-01-2009, 11:51 PM
If you want to try a simple game with SDL you can have a look at my small tutorial series here: http://www.pascalgamedevelopment.com/viewarticle.php?a=18&p=1#article

Ixy
20-01-2009, 09:27 PM
Okay, so I downloaded SDL files...

... and I have a problem at the very beginning. When I write a simple program that initializes SDL, initializes Video and writes success, I CAN compile it... there's no error. But when I run the program, it stops responding and exits with exitcode 309.

What am I doing wrong? :?

arthurprs
21-01-2009, 04:01 AM
Okay, so I downloaded SDL files...

... and I have a problem at the very beginning. When I write a simple program that initializes SDL, initializes Video and writes success, I CAN compile it... there's no error. But when I run the program, it stops responding and exits with exitcode 309.

What am I doing wrong? :?

post some code, so we can try to find out where is the problem :D

XProger
21-01-2009, 05:21 AM
Pure OpenGL will give you most better experience in graphic programming 8)

Ixy
21-01-2009, 07:55 AM
Heh, I'm not sure if I'll even manage simple 2D SDL graphics in a month, let alone OpenGL. :D

The code:


program sdltest;
uses sdl;
var scr: PSDL_Surface;

begin
SDL_Init (SDL_INIT_VIDEO);
scr:= SDL_SetVideoMode (640, 480, 8, SDL_ANYFORMAT);
SDL_Quit;
end.


Oh, and also - which compiler are the SDL tutorials (the ones that come with it) written for? There is end; instead of end. and some other differences.
One more thing. I don't get the error checking code.
Something like this...



if &#40; SDL_Init &#40;SDL_INIT_VIDEO&#41; < 0 &#41; then
begin

MessageBox &#40;0, PChar &#40;Format &#40;'Couldn't initialize SDL &#58; %s', &#91;SDL_GetError&#93;&#41;&#41;, 'Error', MB_OK or MB_ICONHAND&#41;;

SDL_Quit;
exit;
end;

Okay, the code itself is pretty straightforward and self explanatory. But this PChar and Format in the MessageBox part... I always get an error there. Using Windows and SDL. Am I forgetting something or what? :?

Srki_82
21-01-2009, 03:24 PM
AFAIK exitcode 309 means that your program can't find all dynamic libraries it wants to link to.

Did you copy SDL.dll in your Bin folder?