PDA

View Full Version : Simple 2D Libraries ver 2.00 has been Released



cairnswm
14-02-2007, 04:51 AM
My easy to use S2DL libraries for Delphi and Free Pascal (Windows, Linux and MacOS) has been upgraded to version 2.00. The new version of S2DL has some small name changes to the classes to conform to my new naming conventions.

S2DL ver 2.00 includes:
Image Management
Sound Management
Font Management
A state management system
A basic game template

The following Demos are included:
Hello World
Flies
StateDemo
TileMap

S2DL is free for anyone to use, for free, shareware or commercial games.

S2DL ver 2.00 can be downloaded from my web site: http://www.cairnsgames.co.za/files/s2dl.zip

cragwolf
14-02-2007, 05:18 AM
Good job, well done.

savage
14-02-2007, 10:03 AM
Great stuff William! Post bumped to News item.

This will probably work on Nintendo DS as well, as I just checked into CVS the changes to sdl.pas for DS support. Hopefully we will also add GBA support soon.

cairnswm
14-02-2007, 10:52 AM
S2DL is heavily depentant on OpenGL at the moment.

I am considering a S2DL Basic that is purely SDL or GDI based for other platforms such as NDS/GBA and Windows CE.

Arachanox
14-02-2007, 12:47 PM
Great work Will, I'm looking foward to using 2.0!

cairnswm
14-02-2007, 01:03 PM
2.0 will be updated soon with sprites (TS2DLSprite) and a sprite engine (TS2DLSpriteEngine) but will remain at version 2.00 when this is done. I pushed out 2.00 now to get an example tilemap system out as an example.

Actually I hope to do the Sprite stuff tonight and add trees tot he TileMap as the first step to my Multiplexity Contest entry.

Joshas
14-02-2007, 01:05 PM
I like S2DL. Tried with Delphi 7 PE, very quick setup (I had JEDI-SDL already installed), a perfect framework for beginners (like myself). It's a good thing that all dll's are included, but it could be an optional download (for full install, or something similar). There was a little trouble with tileMap demo, as image files referenced in LoadImages function were not available, and confusing error message of Access Violation made me ponder, what is wrong. Good exercise though.

cairnswm
14-02-2007, 01:07 PM
Thanks for the feedback - I'll check the missing images and update tonight.

Probably should put better error handling into the system for missing images - I did have it before and somehow it got lost (comes from working on 3 different machines while developing)

cairnswm
14-02-2007, 08:04 PM
Updated to include a Basic Sprite (TS2DLSprite) and Sprite Engine (TS2DLSpriteEngine).

Tile Map demo updated to make use of Sprite Engine to display trees.

savage
14-02-2007, 10:40 PM
Hi William,
I finally got a chance to download the library and run the demos. I know this is being picky, but...

1. Please reduce the number of Hints and Warning generated when building the demos?

2. The HelloWorld directory includes an *.lpr directory but not in any of the other directories.

3. Remove any spurious *.~ or *.dcu files

4. Include *.dof files with the distro so that the demos can just be opened up in Delphi and Run without the need to find out what is stopping it from compiling and then locating the Source directory.

5. When I include this in JEDI-SDL, can I change the directory structure so that it is similar to the other 3rd Party libraries?

The included demos are great. They really show the potential of the libraries.
Did you really get 1000 points on the swat game? I could only manage 300 odd.

technomage
14-02-2007, 11:34 PM
Great work William :D

All the demos worked first time in Delphi 2006 :D.

With your permission, I'd like to use this for some of the 2D games in Brain Drain (I might need to modify it slightly so it does not create the main SDL surface as my app will take care of that).

cairnswm
15-02-2007, 05:05 AM
Hi William,
I finally got a chance to download the library and run the demos. I know this is being picky, but...

1. Please reduce the number of Hints and Warning generated when building the demos?

2. The HelloWorld directory includes an *.lpr directory but not in any of the other directories.

3. Remove any spurious *.~ or *.dcu files

4. Include *.dof files with the distro so that the demos can just be opened up in Delphi and Run without the need to find out what is stopping it from compiling and then locating the Source directory.

5. When I include this in JEDI-SDL, can I change the directory structure so that it is similar to the other 3rd Party libraries?

The included demos are great. They really show the potential of the libraries.
Did you really get 1000 points on the swat game? I could only manage 300 odd.

1. Ok :)
2. Mmmm, I suppose I should do the conversion to Lazarus for all the demos. (Not sure when though)
3. Oops
4. Oops
5. No problems with changing the directory structure. Maybe you should let me know what you'd expect it to be and I'll change mine to match.
6. Thanks, those are really simple little demos but show (I hope) how easy it is to create stuff :)

cairnswm
15-02-2007, 05:09 AM
All the demos worked first time in Delphi 2006 :D.

With your permission, I'd like to use this for some of the 2D games in Brain Drain (I might need to modify it slightly so it does not create the main SDL surface as my app will take care of that).

Cool - I've only tried it in Delphi 7 and Lazarus :)

This stuff follows my normal license - Free - Free for any use, take it modify it as you need and use it, credit to me would be cool but is not needed or expected.

S2DLDraws auto creates the surface, you might need to make some adjustments to skip this step. But TS2DLImage might need somethign from S2DLDraw so just check it carefully.

(PS. Did I get the original Texture unit from you? - I wanted to put in some credits and could not remember who I got it from).

technomage
15-02-2007, 09:06 AM
That texture unit does not look like one of mine :wink:

Thanks for allowing the use in brain drain, it should make developing any 2D games allot easier. :D

JC_
19-02-2007, 11:10 PM
good work :wink:

S2DL have vsync on ? If somebody have LCD so have 60 FPS.. are you going to implement vsync on/off and frame limiter function in future ?

cairnswm
20-02-2007, 05:03 AM
S2DL does not have vsync on. I use the FPS displayed to get an idea of how much power the rest of my game is taking up.

Adding an option for VSync is possible. I'll look into doing it sometime.

cairnswm
20-02-2007, 05:21 AM
A S2DL Wish List page has been opened on my Blog (http://thegamedeveloper.co.za). If there is something you'd like to see added please PM and I'll add it to the list

cairnswm
20-02-2007, 05:24 AM
A S2DL Wish List page has been opened on my Blog (http://thegamedeveloper.co.za). If there is something you'd like to see added please PM and I'll add it to the list

paul_nicholls
20-02-2007, 05:45 AM
Great stuff William! Post bumped to News item.

This will probably work on Nintendo DS as well, as I just checked into CVS the changes to sdl.pas for DS support. Hopefully we will also add GBA support soon.

Hi :)

at this ]http://abalonegl.eonclash.com/SDL_with_GP2X_Modifications.zip[/url] I have hosted the SDL.pas that was modified to include GP2X compile defs, and 1 line commented out.

I have done a small test and it works under Windows and GP2X for my small example program.

Perhaps it could be checked and added to the SDL changes for the relase :)

PS. the SDL.pas file that was modified was from the 1.0 beta release.

cheers,
Paul.

WILL
20-02-2007, 07:22 AM
Hey how about 2 point heuristic polygon drawing? :)

savage
20-02-2007, 08:43 AM
Perhaps it could be checked and added to the SDL changes for the release

Hi Paul,
I'd definately like to. I had a quick look through the file and noticed the IFDEFs with gp2x, which is fine, but which line was commented out and why?

PS can we have a screen shot of something runninn on the GP2X.

JC_
20-02-2007, 05:50 PM
I made easy test, you can add objects with various textures and rendering state (alpha, rotating..).

On 2GHz Celeron and GeForce4 MX440 i can have cca:
- 2500x sheep's without lost framerate
- 200x 128x128 texures without lost framerate
.. etc

No extra speed, but i think good (for wrapper) Btw. with various sdl.dll i have different FPS +-10-20 frames.

(* you can see max. FPS=reflesh rate of your monitor/LCD, because SDL vsync :/, you can turn vsync off in videocard control panel - cca 600FPS on the start)

download: http://rapidshare.com/files/17417061/test.rar.html

http://img403.imageshack.us/img403/3770/sheepsmq4.jpg

cairnswm
20-02-2007, 06:34 PM
Cool demo

Would you like me to include it as part of the S2DL download :)

paul_nicholls
20-02-2007, 10:16 PM
Perhaps it could be checked and added to the SDL changes for the release

Hi Paul,
I'd definately like to. I had a quick look through the file and noticed the IFDEFs with gp2x, which is fine, but which line was commented out and why?

PS can we have a screen shot of something runninn on the GP2X.

Sorry, about that.

In the SDL.pas (in the function around line 4040) the change below was made. I don't know if it affects any other programs though at this stage, and someone else made all these changes.

The // was added to the result line in the code below


function SDL_getenv(const name: PChar): PChar;
begin
{$IFDEF WIN32}

{$IFDEF __GPC__}
Result := getenv( string( name ) );
{$ELSE}
Result := getenv( name );
{$ENDIF}

{$ELSE}

{$IFDEF UNIX}

{$IFDEF FPC}
// Result := fpgetenv(name);
{$ELSE}
Result := libc.getenv(name);
{$ENDIF}

{$ENDIF}

{$ENDIF}
end;

I will update my GP2X program so it outputs something besides random filling the screen of colours and post a screenshot :)

cheers,
Paul.

JC_
20-02-2007, 10:38 PM
Cool demo

Would you like me to include it as part of the S2DL download :)

np, i make some changes and send it to you with source code :)

savage
21-02-2007, 12:58 AM
Hi Paul,
The IFDEFed version of sdl.pas has been checked into CVS. I'm a little reluctant to comment out that line as that would raise a compiler warning without knowing for sure if there is a GP2X equivalent of getenv();

Is there any way of knowing for sure?

paul_nicholls
21-02-2007, 02:27 AM
Hi Paul,
The IFDEFed version of sdl.pas has been checked into CVS. I'm a little reluctant to comment out that line as that would raise a compiler warning without knowing for sure if there is a GP2X equivalent of getenv();

Is there any way of knowing for sure?

I have screwed up my program somehow, so I am having trouble testing the SDL_getenv() now...

I will get back to you.

cheers,
Paul.

paul_nicholls
21-02-2007, 03:21 AM
Hi Paul,
The IFDEFed version of sdl.pas has been checked into CVS. I'm a little reluctant to comment out that line as that would raise a compiler warning without knowing for sure if there is a GP2X equivalent of getenv();

Is there any way of knowing for sure?

I have screwed up my program somehow, so I am having trouble testing the SDL_getenv() now...

I will get back to you.

cheers,
Paul.

I have fixed my program.

Here are my SDL_getenv findings:

Call SDL_getenv but don't store the result - works
call SDL_getenv and store the result in either PChar or AnsiString - doesn't work (hangs the GP2X...)

Does this help?

cheers,
Paul.

savage
21-02-2007, 10:03 AM
Paul I've created a GP2X specific thread over at
http://www.pascalgamedevelopment.com/viewtopic.php?p=31403 and asked you a question there, so that we don't spam William thread with this info anymore.

paul_nicholls
21-02-2007, 10:18 PM
Paul I've created a GP2X specific thread over at
http://www.pascalgamedevelopment.com/viewtopic.php?p=31403 and asked you a question there, so that we don't spam William thread with this info anymore.

good idea :)

cheers,
Paul.

gintasdx
25-03-2010, 08:56 PM
Does somebody still has the library? Please upload it to www.box.net :)