3D
Presentation of Clanlib - by hackervalley - Sunday 29th FebruaryClanlib Games SDK Presentation of Clanlib
Since long time, I search for game engine. My request are : mutliplatform library
licensed under the GNU Lesser General Public License (LGPL)
C++
handle Opengl , image, font, sound , network, ...
easy to install, to use
After look :
SDL http://www.libsdl.org
Crystalspace http://crystal.sourceforge.net
Allegro http://www.allegro.cc
I focus me to use Clanlib.
Also Clanlib Game SDK provides : a platform independent (as much as that is possible in C++) way of dealing with display, sound, input, networking, files, threadding and such under LGPL.
a resource system to keep track of images, fonts, samples and music.
Let’s start a little practice in Opengl.
Practice 1
Display a textured Opengl Cube. It ’s really a non commun practice ! Please refer to attached sources files.
First we have to initialise application and libraries we will use.
[global.hh]
#include <ClanLib/display.h>
#include <ClanLib/gl.h>
#include <ClanLib/core.h>
#include <ClanLib/application.h>
[application.hh application.cc]
We instantiate CApplication App(width,height); who derives from CL_ClanApplication In methode int CApplication::main (int argc, char **argv); we found the init and deinit from module of Clanlib.
CL_SetupDisplay::init ();
CL_SetupGL::init ();
CL_SetupGL::deinit ();
CL_SetupDisplay::deinit ();
CL_SetupCore::deinit ();
Also in this methode we instanciate display and declare the ressource we will use :
CL_ResourceManager *resources;
resources = new CL_ResourceManager("data/ClCube.xml");
Resource file ClCube.xml refer to the texture we will use for the cube.
[ClCube.xml]
<?xml version="1.0"?>
<resources>
<surface name="fire" file="fire.jpg" />
</resources>
With this resource systeme it is possible to handle informations without recompiling codes.
class CScene define in [scene.hh scene.cc] describe opengl scene and use classical functions of Opengl.
CL_System::keep_alive (30);
provide swap buffer and checks for system events, updates input.
So see now result.
![]() ClCube |
Last word...
I hope you will have fun to discover Clanlib games SDK ...
Author : hackervalley@free.fr http://hackervalley.free.fr
Copyright (c) 2003 hackervalley Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".
References :
ClCube.tar.bz2
BZip - 54.1 kb