PDA

View Full Version : Simple 2D library



cairnswm
04-11-2004, 06:33 PM
Version 1 of my new Simple 2D Library has been released :wink:

(Ok not really :oops: - just new game development engines always sound cool).

http://www.cairnsgames.co.za/downloads/S2DLv100.zip

Currently the folloing units exist
:arrow: S2DLDraws - sets up the screen - automatic dont try to do it yourself
:arrow: S2DLImages - Image and Image List unit
:arrow: S2DLText - Text Writter
Also includes a Template or example application - (you need to add your own images)

It will stay version 1 for a while.

Have fun and let me know what you think.

PS. If anyone has the time I'd appreciate it if you could
:arrow: Test it on linux :shock:
:arrow: Tell me why it wont compile in Delphi :shock:
:arrow: Why the heck are the Exes so large! Over 2MB - this bloat is about 3times Delphi Bloat :roll:

:twisted:

Robert Kosek
04-11-2004, 06:43 PM
Why the heck are the Exes so large! Over 2MB - this bloat is about 3times Delphi Bloat :roll:All I know is if you make it with Lazarus ... It's bloated. I'll check the library out, it may be what I need.

{MSX}
04-11-2004, 07:32 PM
PS. If anyone has the time I'd appreciate it if you could
:arrow: Test it on linux :shock:
:arrow: Tell me why it wont compile in Delphi :shock:
:arrow: Why the heck are the Exes so large! Over 2MB - this bloat is about 3times Delphi Bloat :roll:
:twisted:

I've tryed it under Kylix and Linux.
First, i've renamed the units to dpr/pas for compatibility.

It firstly didn't compiled becouse in linux unit importing cares of case.
You should import "sdl" instead of "SDL" and "sdl_ttf" instead of "SDL_ttf". That sux, i know, but kylix works that way :P (AFAIK)

Another thing, you used local variable initialization, that is not supported in Kylix.

procedure XXX();
var y : integer = 3;
begin
....
end;

should be:

procedure XXX();
var y : integer;
begin
y:=3;
....
end;


That said i was able to compile. But then i was missing "libSDL_ttf.so" and i wasn't able to run it.. :(
I'll try and find that lib :P

cairnswm
05-11-2004, 03:18 AM
Cool!

Robert - I make nice simple games - basically 2D puzzle games mostly though I would like to make an isometric game soon (probably an Isometric puzzle game).

I'll try compile with the command line compiler and see if I can get the size down - I was expecting something really small based on the other FreePAscal stuff I've done.

MSX - Thanks - great to know that it is (almost) cross platform :) I'll remove the initializations and make more small letter stuff :)

The SDL_TTF stuff came with JEDI-SDL. Does linux use True type fonts? If not I'll go back to bmp fonts and write my own font object.

Thanks for your help guys. If this works we could have a very easy to use Simple 2D Library.

{MSX}
05-11-2004, 07:01 AM
The SDL_TTF stuff came with JEDI-SDL. Does linux use True type fonts? If not I'll go back to bmp fonts and write my own font object.


Well it's not a problem of supporting true type (which it does) but i just was missing the ".so" file (equivalent to .dll in windows). I'll try to find it around (on www.libsdl.org maybe).
If someone has the direct link, please post it :P

WILL
05-11-2004, 07:54 AM
For Linux you just have to install the SDL package. It's called devsdllib0 or something like that. Only the Win32 copies of your game require the .DLL with your main executable.

cairnswm
06-11-2004, 05:29 PM
Version 1.01 of the Simple 2D library has been released:

http://www.cairnsgames.co.za/downloads/S2DLv101.zip

// Simple 2D Library
// version 1.01
//
// This file is part of the Free Pascal Simple 2D Libraries
// Copyright (c) 2004 by William Cairns (CairnsGames) and
// the Delphi Game Development (DGDev) Site
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// (I got this from the JEDI-SDL files and it sounds Cool!)
//
// By using this work you have immediatly agreed with the above.
//
// The work can be used for any purpose. You may sell it, use it in a game
// delete it or change it as you wish with no reward to the the original
// developers.
//
// We do however ask that if this work is used that some mention of it be made
// on the DGDev or PGDev web sites.
//
//** With FreePascal the files must be compiled with the -Sd switch on as
//** Delphi language conventions are used.
//
// Units:
// S2DLDraws - Sets up screen automatically - Change code directly for
// other screen resolutions.
// (Requires SDL.dll)
// S2DLImages -
// TS2DLImage : Manages image in memory. Enables Drawing and Transparancy
// TS2DLImageList : Maintains list of images. Enables searching of images.
// (Requires SDL.dll and SDL_image.dll)
// S2DLText -
// TS2DLFont : Manages a TTF font. Loads and Draws.
// TS2DLFontList : Maintains a list of Fonts. Enabled Search for Fonts
// (Requires SDL.dll and SDL_ttf.dll)
// S2DLSound -
// TS2DLSound : Loads and Manages a Wav file in memory. Enables playing
// and simple volume control
// TS2DLSoundEngine : Controls and manages Sounds.
// (Requires SDL.dll, SDL_mixer.dll and smeg.dll)
// S2DLTemplate - A basic template that enables a screen and manages images.
// Balls - an example game utilizing all the available units
//
//


Changes since version 1.00
- TGameImage renamed to TS2DLImage
- TS2DLFontList created to manage fonts
- TS2DLSound and TS2DLSoundEngine have been added.
- TGameImage.SetPallette has been removed as it wasn't doing anything.
- Memory leak (BIG one) in TS2DLFont removed.
- I've tried making it more linux friendly - cant really check though
- DEMO of everything included in a complete game called BALLS - based on jawbreaker for Pocket PC.

Once again I'm quite keen to hear any feedback

cairnswm
23-12-2004, 03:12 PM
Version 1.03 has been released

http://www.cairnsgames.co.za/download.asp?file=downloads/s2dlv103.zip

Added a simple sprite engine.
Move flip functionality into the S2DLDraw object so that the class can calculate FPS with each flip.
Minor changes made to some other code as well.

This has some of the additional code created for the 72hour GDC contest. More code will be added to the library after I've cleaned it up a bit.

PS: No demos included. 3 demos will be released later, balls (no code changes), shooter (2d up scrolling shooter) and the full code for the Foogs game released for 72hour GDC. I just need to make sure I have the right files in the right places for the demos to work.

Robert Kosek
23-12-2004, 03:33 PM
I had forgotten you did this. Got the version 1 and it slipped my mind. :oops:

Looks like you've come a really long way. I will try this out, and maybe even release what I make .... I'm a perfectionist and it's really hard for me to release alpha/beta/unfinished stuff.

cairnswm
24-12-2004, 03:14 AM
The goal of S2DL is to make 2D game development simple. To the point where not knowing object orientated development will not be a problem. The libraries do as much as possible in the background (creation, initialization etc).

S2DL is free, not open source, GPL or anything like that - its free. Your own add ons to the library can have whatever license you want to add.

Anonymous
19-12-2005, 11:24 PM
I downloaded v103 and managed to get it compiling (wish their would have been a links and required section). Now I am trying to figure out how to use it, saw the post about some demos some day, but no demos on the site. Any word?

- Jeremy

cairnswm
21-12-2005, 05:10 AM
All my games produced after that date use a version of S2DL. Try look at Wumpus Hunt, Dragon Flight or Run-A-War for Demos.