[Top][All Lists]

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

[Adonthell-devel] Regarding wxPython and different backends

From: Kai Sterker
Subject: [Adonthell-devel] Regarding wxPython and different backends
Date: Fri, 24 Jan 2003 19:21:12 +0100

Feel free to use wxPython, of course. Back then I nearly chose wxWindows
for dlgedit, but ended up using GTK in the end. (AFAIK, Linux version of
wxWindows sits on top of GTK).

What I really wanted to do is share some thoughts about the different
backends. Basically, what we will have is something similar to the

   Engine                       |   libgfx   |
                              / +------------+ \
                             /        |         \
   Adaption     +-----------+   +------------+   +------------+ 
   layer        |  sdl_gfx  |   |   cl_gfx   |   |  wxp_gfx   |
                +--+  +--+  |   +--+      +--+   |  +------+  |
                |  +--+  +--+   |  +------+  |   +--+      +--+
   Libraries    |    SDL    |   |   Clanlib  |   |  wxPython  |
                +-----------+   +------------+   +------------+

Basically, what you need is an adaption layer for each underlying
library. That adaption layer is specific to each library on one side,
but provides exactly the same interface to higher layers, like our gfx
stuff. Basically, that means that all adaption libs export the same
interface (which of course is completely independent from the underlying

For example, the interface could sit in the common_gfx.h header file.
Every part of libgfx would include common_gfx.h and would thus be
independent from the actual graphic library you use. All you need to do
is link against one of the available adaption libraries, i.e. libsdl_gfx
or libcl_gfx.

That seems to be the easiest way to me. That means you can't chose the
backend at runtime, only at compile time, but that should be okay for
our purpose.

Of course, there might be completely different ways to accomplish this.
The above is how I would go about it :). Feel free to improve stuff!


reply via email to

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