View Full Version : Could ClanLib be ported to console?

06-04-2007, 07:23 PM
I have a question about ClanLib. I was wondering how hard would it be for someone to port it over to a console (Dreamcast, Xbox, Wii)?

For the sake of the question lets say I have access to the Official Dev kit as well, Would it be possible and any idea what would need to be done to get ClanLib up and running on a console?

06-05-2007, 02:57 AM
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. Having never coded anything for a console, I cannot say wether this is normally available or not. But it probably is.

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.

06-05-2007, 03:02 AM
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 management).

06-05-2007, 07:18 AM
This was the kind of info I was looking for.

I find of figured it wasn't going to be a quick port and that there was going to be some work in porting it. Me and my friends were just looking for something that we might be able to use so we don't have to write something from scratch.

I'm going to let my lead programmer look at it now, just wanted to see if it was going to be worth looking into.

Thanks again.