The Blog of Anders Nissen

torsdag, marts 31, 2005

Playing Around With DirectX

I've been playing a bit around with DirectX and the SDK samples that comes along with it, and I've managed to make a small deserted island in just a few hours.

Here's what it looks like:


They doesn't quite look like palm trees, do they?



Ahh, much better! ;)



Improved version with: Textured sea floor, semi-transparent water and a sky box textured with pictures from Microsoft's head quarter - I think I know what's next on the to-do list :P

A Couple Of New Tutorials

I've previously mentioned that I've experimented with SDL lately.

To simplify setting up and using SDL I wrote a small and very simple engine framework. I've written up a small article on this framework on the excellent Game Programming Wiki.

This article can be found here:
Simple Game Engine Framework Using SDL.


I've experimented with XML as well (as also previously mentioned).

This has lead to an extremely simple, flexible and quite useful logging system based on XML. I'm actually pretty proud of this. It's very small, code wise, but makes use of template functions to handle different variables types, and gets the job done without any hassle.
I've also written a tutorial based on this on the GPwiki as well.

It can be found here:
Simple XML Logging System.

tirsdag, marts 08, 2005

Experinces With SDL

SDL (Simple DirectMedia Layer) is a "cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer".

It makes it simple to use low-level communication with the hardware to draw single pixels on the screen, for instance. It's mostly used for making games, but could be used for almost any type of application.
Where the functionality of SDL ends, the huge selection of extra function-libraries take over, so the possibilities are almost endless, whatever you might need.

My experience with SDL has been quite positive. It's is really easy to use, but because it's pretty low-level you sometimes have to re-invent the wheel. That is both a good thing (you can implement things the way you like and make them more specific to what you need) and a bad thing (it takes time, introduces bugs and is almost always less optimized than "professional" solutions).
But, of course, if you don't want to implement functions for drawing basic geometry, playing and mixing sound and music or handling pictures, you can just download a library that does all the hard work for you.

If you need a simple, easy-to-use API for a platform independent 2D game that needs to be able to run on ancient hardware, SDL is the way to go! Even if you're doing something completely different you should go ahead and take a look at SDL.

SDL website: LibSDL.org

Experinces With Lua

Lua is a "a powerful light-weight programming language designed for extending applications". It's a scripting language and it's very easily extended. It can be used for any application, but is mostly used in games where it's gained a wide fan base.

After a lot of problems getting Lua to cooperate with Microsoft Visual C++ I finally got around to experimenting with Lua. And I must say that it's a great great scripting language!

No wonder why the good folk at Bioware and Black Isle (may they rest in peace) choose to use Lua for the huge scripting effort required in the Baldur's Gate-series and the rest of the games running on the Infinity engine.

Lua is small, has a clean easy-to-learn syntax and has excellent integration with C++ to allow for C++ functions to be called directly from the scripts. I'll recommended it greatly to anyone requiring scripting abilities in their game, applications, whatever - I know it'll be my very first choice when I need scripting!

Lua website: Lua.org