Embedding Tiny Scheme in a Game

I have recently started to develop a game from scratch. This game is about drone races. I will write about it in future posts.

I wanted to have a scripting language in order to be able to:

  1. configure game object properties,
  2. draw the entities,
  3. draw the levels,
  4. etc.

I started implementing my own parser but it rapidly became very complicated. So I’ve then looked for many embeddable scripting languages, such as lua, tcl, squirell and finally scheme.

The last one is very interesting because the Lisp family languages are very well suited to implement Domain Specific Languages (DSL).

This article compares the embeddable scheme implementations and shows how to embed TinyScheme.

Continue reading “Embedding Tiny Scheme in a Game”

Grabbing frames from webcam with a Raspberry pi

I have just received my Raspberry pi.

My objective is to use webcams with the board, so the first step is to connect and test a webcam with the board.

So after installing the official debian image on my pi board, I have plugged a webcam on one of the USB ports. Then I have tried:

 

 

It shows an USB video device connected to the board.

The next step ti to look into the devices directory for a video device:

 

 

But… nothing!

After looking on the web it seems that the video for linux driver is not included in the official raspberry pi debian image…

So I have two choices, recompiling my  kernel, or trying another image.

I have tested the beta version and the archlinux image.

The second one works, I now have a video device in /dev!

But I’m connected in ssh to the board, so I need a sample tool to test the webcam.

I’have found on the official video for linux documentation API an example.

There is another example on another video for linux API documentation.

Here is the code:

 

Compile it and test it with :

And you will find some ppm pictures grabbed  from you webcam in the same directory.

EDIT:

With the new firmware version compile with:

How-To compile Mesa under Ubuntu GNU-Linux

This is a simple guide to build mesa under GNU-Linux.

The dependencies required are for Ubuntu 11.04,  they may differ.

General dependencies

GL_PROTO installation

The version or some libraries given with Ubuntu are quite old, so we will install our own up-to-date versions.

LIBDRM

dri2proto

Environment variables

In order to defines our locally installed dependencies the followings environment variables are required.

Some parameters can also be given with teh configure command.

Other informations

http://dri.freedesktop.org/wiki/Building