Pliant + SDL & PliGame

Introduction | News | Installation | Documentation | Screenshots | Contact

» Introduction

Welcome. The purpose of this project is to experiment using Pliant language and the SDL library. Pliant uses a trivial syntax and a dynamic compiler. This combination provides programmers with a very high level language, with the ease and flexibility of scripting langauges and the performance of compiled code. Pliant's dynamic compiler doesn't require any linking and compiles on the fly (for the most part). Pliant is aware of its own implementation and can be used to change the way it parses and compiles expressions. It may be possible that Pliant can form the basis for a high-level programming language for high-performance multimedia applications.

Pliant can easily interface with C libraries. For this reason, the SDL library was chosen because its a library with the richest API for cross platform multimedia software. Pliant+SDL is simply a set of modules that wrap the SDL library functions for use in Pliant programs. These modules however provide a very thin wrapper and require some knowledge of the relationships between Pliant and C code. This project will produce some examples and documentation ( comming soon) to show this. The API resembles the C SDL API, so the SDL documentation a useful source of reference. The code written by this project is licenced under any version of the LGPL.

The project page can be found here:

The ultimate goal is to produce another, more thicker wrapper written ontop of Pliant+SDL. This will be PliGame. It will use Pliant's native data types and conventions. Its API will resemble that of Pygame and likewise provide bindings to popular support libraries for SDL like SMPEG.

» News

April 30th 2003 -- Desperate Asteroid demo

Due date. Well, it time to show where it is now. A lot of corners needed to be cut, asteroids are static, and they don't even move! All you can do is shoot at them and see them explode. The explosions are also static. Download the archive here or view the source. You simply have to unarchive it under /pliant/ and type

pliant-debug0.exe asteroids.pli

I've been working on this project after hours at my co-op workplace. But now its over, I'm going to have to wait until I get set-up again at home before I continue this summer. BTW, I posted my proposal for this project to. I'll make a download section later for all this stuff.

April 25th 2003 -- Documentation is up

Well, it still under construction actually. The table of contents are available, and I'll be adding more info as I go along. I'm adapting the SDL project's documentation for Pliant+SDL.

April 24th 2003 -- CVS cleaned

I got a responce from, the CVS is now cleaned and wiped. I haven't decided whether I'm going to use it yet. When, if I get active help on this project, I'll go back to using the public CVS repository. Until then, tarballs will be fine.

April 22nd 2003 -- Examples available as seperate archive

Minor change: I took out the examples subdirectory and put it in its own archive. This is because the bitmaps used in the examples were collectively large, much geater than the bindings themselves. I left the testsprite.pli demo in Pliant+SDL so that you can test your installation.

CVS is not back yet, I sent a support reqest But I'm beginning to think I should stay with using tarballs, until I fully understand how to manage CVS safely.

April 22nd 2003 -- CVS is Broken!

Please do not use CVS right now. I admit I don't know CVS, and I'm beginning to hate it. Until I figure this out, you're going to have to fetch the tarballs. Sorry.

April 21st 2003 -- Tutorials

I finally provided some, however meager documentation for Pliant+SDL. Its a section called "Getting Started". I've decided that I can't assume that any person who visits here will know much about SDL, let alone Pliant. The only thing I'll safely assume is that they know some programming, either in C or Java. I guess this means Pliant+SDL will really be for first year students.

Since Pliant+SDL uses a similar interface as the C API for SDL, I see no reason to re-write the documentation thats already available. What I plan to do is provide anotated versions of my demos and other examples in the same fashion as I did for the "Getting Started" section. Along the way, I introduce SDL and Pliant, API, language and concepts. I know that if I wanted a preview of a new langauge or library, I would first look for a good tutorial.

April 14th 2003 -- Project posted on

Isn't that nice: Post a project on SDL, and you become news on the site's front page. I think my hits went up like > 300 today... Anyways, I think its a great idea to get SDL projects visible. I sent and e-mail prior, to let them know about my little project too. Update 04/15: I got an e-mail from Sam Lantinga and Pliant is on their list of supported languages. Thats very nice!

April 11th 2003 -- Still hooked on Asteroids...

It seems like this asteroids demo is the feature of this site, but its still just a sub project. I'm pretty much done with the source graphics, so I'm posting them here now. I've added some style to the site. Its nothing I'm too attached to, but this color scheme fits my mood today. I guess its because I'm hard at work with the asteroids demo.

I also finally created my own backdrop for use in the game. I've created explostions for the asteroids, as seen below. I've created 3 different animated asteroids, each spins differently and each has their own explosion effect, I've captured these into animated gifs. Give them time to load. These are the source images I will be using in the demo. Actually they are in BMP format, but since they're too big to put here for download I compressed them into gifs and PNG, non-lossy formats.Update 04/13: I put up the source files including my Blender and Gimp files as well as the BMP versions of the graphics. This is a tarball of my workspace and it contains a lot of undeleted junk. This is an open-source project after all, so here's the "source" for my graphics.

I'm trying to pick up the pace, and get this demo done quickly and out of the way so that I can get back to working on Pligame.


April 7th, 2003 -- A 5 Step Plan

Its been almost a month. I'm back to work. I'm going to cut some corners on the demo, it should still do the job. I'm still in the planning phase of the code, but I should have something by next week. Off the top of my head, here's how I think the demo is going to progress:

  1. Panning viewport: Simple image panning with viewport and backdrop (or starfield).
  2. Animated Sprites: I almost figured out how this will work.
  3. Shooting Asteroids: Detecting hits and misses. Should be easy.
  4. Special Effects: Explosions, sound effects, etc.
  5. Pliant+SDL features: This is when I start testing and employ new features in the library.

March 13th, 2003 -- Mockups!

Mockups! I've been working on the asteroids demo game for Pliant and SDL. I've never wrote a game before, so the process is quite new to me. I decided to create the graphics that I would use in the game first. I first created animated asteroids, rolling in space. Three of them, different shapes and rotating on different axis. These asteroids will scale as they approach closer to you. Then I created these mockups. These are useful as it helps me figure out how I expect the game to look in the end:

Yep, these aren't from the real game but the graphics are mine and will be used in the game -- EXCEPT for the backdrop. The beatiful backdrop is wishful thinking and it doesn't belong to me. It was created in Blender (the same tool I used along with Gimp) by Enrico Valenza. He has a tutorial on how to do this but it doesn't appear complete. The game will use a panorama, with some degree range for panning up and down, left and right. In the end however, I may have to settle for a simple starfield simulation. I have only one month and a bit left, so I'm running out of time!

The game however will be boring. Its really just meant to demo what a game might look like in Pliant+SDL or Pligame. It will also be a testing platform for new features in SDL as I expose them to Pliant and add them to the modules.

March 5th, 2003 -- Project Goes Online

I apologize with the sparce amount of information here. I have been working on this project for a while, but mainly for myself. But then I was ignoring the golden rule of Open Source: release early, release often. So I'm taking a break in my devlopments and making my first release available now. I've setup the cvs so expect regular updates, especially with the examples. If you want to know how to use Pliant+SDL, refer to the examples under the examples/ subdirectory (also poorly documented :-( ) and the official SDL library documents.

I'm making a small demo game (Asteroids) to demonstrate Pliant+SDL. It will feature most if not all of the important SDL functions, so I will be adding the existing modules as I write this game. For example, when I get to including sound effects I'll make those audio routines available in the Pliant+SDL wrapper. Also remember that Pliant's interface with DLLs is trivial, and one could easily add support themselves just by reading the module files. It's practically no work at all implement (but a whole lot of work to test).

Currently, Pliant+SDL only works in Linux. It should be able to work in Windows also, but for some reason I can't figure why Pliant doesn't open win32 DLLs properly. When thats figured out, then it should work just as well under Windows as Linux. Linux's still better and it will be the main target platform. Update: 03/10 Hubert Tonneau responds:

You need DLLs that use WINAPI calling convention as opposed to native compiler calling convention for all the functions exported by the DLL. This is what many DLLs comming from Unix word fail to do (good samples are Zlib and libjpeg that I had to recompile myself because none was properly packaged nor written).
This is from a thread in the talk forum from

» Documentation

» Installation

First, you must have the latest version of Pliant and libsdl installed. If you compile SDL from sources, please make sure that your LD_LIBRARY_PATH includes where the libraries are installed.

CVS method

Most recommended method, as it will get you the most recent in-development version. Requires CVS tools. Set the CVSROOT environment variable to "". Then cd to /pliant/pliant and do "cvs co SDL". Press enter when asked for password. Thats it. Go and try to run the examples in /pliant/pliant/SDL/examples. It may be possible that CVS is blocked by your firewall, if this method doesn't work. In such case, you're better of just installing by the arball method.Update 04/ 22: CVS troubles, use tarballs instead.

Tarball method

Download pliant+SDL.tar.bz2 and unpack it in $HOME/pliant/pliant/. To do this, cd to $HOME/pliant/pliant and:

tar jxvf pliant+SDL.tar.bz2
To make sure you have Pliant+SDL installed, go into $HOME/pliant/pliant/SDL/testsprite then:
$HOME/pliant/binary/pliant-debug0.exe testsprite.pli
Download examples.tar.bz2 for some more demos and examples.


You can download latest and other versions from the file section of the project site.

» Screenshots

testsprite.pli: 192 lines.

Bouncing sprites. 100's or more at once!

roto.pli: 92 lines.

Realtime image rotation and zooming, completely implemented in Pliant.

mode7_flight.pli: 123 lines.

Realtime 3D image zoom and rotation. Mode7 effect from Super Nintendo days. Use keys to fly around.

mode7_flight2.pli: 126 lines.

Another Mode7 effect, with two layers of clouds (neat hack). Use keys to fly around.

» Contact

Created with Vim
Mujtaba Hasni
e-mail: mujtaba (at)