[maemo-developers] Porting ClanLib to maemo...

From: Antonio Orlando ant.o at libero.it
Date: Sun Jul 15 21:03:47 EEST 2007
ClanLib [1] is a free cross platform C++ framework under an extremely  
friendly license.
It is very cross-platform and already works in Linux (and Windows and OS  

I wonder if it can be ported to maemo because it is very nice to use. I'm  
not the one who can do that, but I think it could be an interesting idea  
for someone capable, e.g. those coders @INdT in Brazil who have already  
successfully ported Python (ok, of course there are some others capable,  
but they pop up in my mind as better candidates).

ClanLib could be an intermediate level between coding in C/Gtk (run-speed  
= sweat = max) and coding in Python/PyGtk (run-speed = sweat = min). It  
also provides a built-in GUI system, although it won't be "hildonized"  
(who cares).

Searching in ClanLib's official forum, I've found a question [2] by a user  
asking if it could be ported to game consoles (xbox, wii, etc.), and  
Magnus Norddahl (ClanLib's creator and main developer) answers:

[quote begin]
"In order to port ClanLib to a console, at least as a minimum requirement  
would be to have a working C++ compiler with the Standard Template  
Library. [...] ClanLib's code is in general split into generic cross  
platform code and then platform specific code. Normally the platform  
specific classes each implement a generic interface - CL_Thread_Impl is  
derived by CL_Thread_Win32 and CL_Thread_PThreads (or whatever they are  
called - forgotten their names). So in order to port a clanlib module, you  
need to implement each of the classes in the platform specific directories  
- or if the new platform shares the same APIs (i.e. possix threads) you  
simply need to fix the #ifdefs that toggle which impl is used. In other  
words, the amount of porting required depends on how much these console  
development environments have in common with unix or win32 basic  
libraries. Oh btw, those consoles most likely don't have WGL, AGL or GLX  
as their platform specific OpenGL, and probably don't use the Win32 or X11  
windowing systems. If you intend to use clanGL as the display target for  
the console, you will most likely have to implement your own version of  
the CL_DisplayWindow_Impl class and the other (relatively) few references  
to platform specific stuff (such as OpenGL context creation and  
[quote end]

ClanLib, however, has two possible rendering targets: OpenGL, and SDL [3],  
although the SDL one does not support every feature. As SDL works on  
maemo, it should be possible to make ClanLib using it. In the answer,  
Norddahl speaks of the need of a C++ compiler, and even if currently the  
official APIs for maemo are for the C programming language [4], unofficial  
C++ bindings for Hildon exist [5].

Do you think a port is possible? Do you think it could be useful?
In case of overall positive answers, I'll post this question and a link to  
this thread on ClanLib's forum too.

[1] http://clanlib.org/
[2] http://www.rtsoft.com/forums/showthread.php?t=1677
[3] http://clanlib.org/docs/clanlib-0.8.0/Overview/display-1.html
[4] http://maemo.org/development/documentation/apis/
[5] http://garage.maemo.org/projects/maemomm/


More information about the maemo-developers mailing list