adonthell-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Adonthell-devel] Mapeditor and GTK+ backend


From: Kai Sterker
Subject: [Adonthell-devel] Mapeditor and GTK+ backend
Date: Sun, 1 Mar 2009 18:37:08 +0100

A first progress report on how things came along so far:

I haven't really started on a true GTK+ backend yet. However, I have
evaluated the available alternatives and implemented a test program
that already has a lot of the functionality required for the surface
class. Since gdk_pixbufs do not come with any compositing functions, I
chose cairo to implement the surface. For screen, I'll probably use
gtk_drawing_area, although there's some question on how to design it.

With SDL, there's only one screen to draw on, but with GTK we might
have multiple drawing areas. Not quite sure how to handle this yet.
(The problem is, that when no target surface is given during
rendering, the SDL backend will pick the screen surface for drawing.
In GTK, we just might require to always set the target and raise an
error otherwise ...


Anyway, attached is the small test program plus test image. Compile with

g++ `pkg-config adonthell cairo gtk+-2.0 --cflags` -g test.cc
`pkg-config adonthell cairo gtk+-2.0 --libs` -o gtktest

then run as './gtktest' in the same directory that contains test.png.

It'll open a window and draw NG in various modes: masked, per-surface
alpha, masked & per-surface alpha and clipped. Earlier, I've also
tested with an RBGA test image, to make sure that per-pixel alpha
works too.


With that code in place, I can now start on the actual backend. The
first goal would be to render the worldtest map.

Btw, since the GTK+ backend is meant for use by the tools, I won't
write any backends for the input, audio and main modules. I will also
put the code into the tools CVS, so that adonthell will not have to
depend on GTK+.

Comments or suggestions welcome!

Kai

Attachment: test.cc
Description: Binary data

Attachment: test.png
Description: PNG image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]