[gluon] Refactor branch merged to master, changes

[ Thread Index | Date Index | More lists.tuxfamily.org/gluon Archives ]


So, today I have merged refactor to master and pushed this back to gitorious. 
All changes in refactor are thus in master now. I wanted to list the most 
important of these so people can have a look and possible y comment on them.

===== Renaming =====
First off, as discussed quite a while ago, the most important change is that 
the libraries have been renamed. The directory names have changes accordingly. 
The changes are as follows:

- KAL -> Gluon Audio (audio directory)
- KGL -> Gluon Graphics (graphics directory)
- KCL -> Gluon Input (input directory)

What previously was called "common" is now "Gluon Core" and has become a full-
fledged library, which can be found in the "core" directory. This library 
contains common things available to all Gluon related applications and 
libraries. This includes some parts from what was previously in the "src" 
directory, such as GluonObject.

The contents of the "src" directory have been reorganized a bit and are now 
called "Gluon Engine", to be found in the "engine" directory. This contains 
most of the GameObject hierarchy structure, such as Components, Assets and the 
GameObject itself.

All other content has mostly been removed. Some of the examples have been 
moved to {libraryname}/examples , such as the former KAL tutorials which can 
now be found at audio/examples/tutorial*. When we add more examples for 
libraries, they should be added to their respective library example directory.

===== Buildsystem Cleanup =====
Another major change is a hefty cleanup of the build process. Where the 
original build system was quite messed up, requiring multiple build 
directories and whatnot, the new one is, if I may say so myself, quite nice.

The build system has been structured as follows:

There is a single CMakeLists.txt file in the root directory. This contains 
options for building of all libraries and provides the general "glue" for 
building everything in one go. It has options for disabling or enabling 
specific parts of the build process. It will also disable the build of Gluon 
Creator and Player if there is no KDE4 available.

Then there are the library and application directories. Each of them also 
contains a single CMakeListst.txt . These files handle dependencies and 
building of individual libraries. I have set them up in such a away that they 
can be quite simply be built individually, instead of as part of the entire 
build process. When built on their own, they declare a project and will look 
for the required libraries that are normally built as part of the entire build 
process.

Each library directory also contains a cmake directory. This directory 
includes all the required Find*.cmake files for finding dependent libraries that 
do not supply their own Find*.cmake files. It also contains the 
FindGluon*.cmake file for locating the Gluon library by third parties. Note 
that each library should really only supply those files it requires. These files 
are installed into {prefix}/share/gluon/cmake, There is an option available to 
also install these files into {cmake_root}/modules, this is be default set to 
on.

The FindGluon* cmake files each define four variables if the library is found: 
The normal "{LIB}_INCLUDE_DIR" and "{LIB}_LIBRARY" but also two 
"{LIB}_INCLUDES" and "{LIB}_LIBS". The last two variables define all includes 
and all libraries required to use the library. They are mostly convenience, so 
one can do "include_directories({LIB}_INCLUDES)" and 
target_link_libraries(target {LIB}_LIBS).

===== Individual Library Changes =====
All libraries now use a namespace equal to their library name without spaces 
but camelcased. For example, all classes in Gluon Audio now reside in 
namespace GluonAudio. Any library-specific prefixes to classes have been removed 
in favor of the namespace convention.

The libraries use a single file that has an export macro for exporting symbols. 
This file is called {lib}_export.h (all lowercase, underscores instead of 
spaces) and the macro is {LIB}_EXPORT (all uppercase, also underscores). To 
continue with my example of Gluon Audio, the file is called 
gluon_audio_export.h and the macro is GLUON_AUDIO_EXPORT . These are mostly 
conventions, but I would like to keep everything clean and consistent.

The Gluon Core library is new and contains only a few classes. These are the 
Singleton template we use across Gluon, the Gluon Object class, its factory, 
the GDL handler class and also the Game Project class (which I would like to 
move back to Engine at some point). The GluonObject and GDL Handler classes 
have been moved to core to make the GDL parsing available to all libraries, so 
we will be able to do things like material definitions in GDL. Currently almost 
only the singleton template is used in Gluon Audio/Graphics/Input, but that 
will hopefully change later on.

The Gluon Audio library did not receive a whole lot of changes compared to the 
one in master, apart from the renaming. One of the things I would like to do 
for Gluon Audio is use Phonon to read audio files, but that is something which 
does not have a whole lot priority at the moment.

Gluon Graphics was quite heavily changed by DrIDK and Sandroandrade mostly, 
they removed the physics related items and started using several Qt 4.6 
features. They can probably better explain those changes. The ones I made are 
mostly related to supporting components more cleanly. I modified the 
transformation code to make use of 3d coordinates, which means that now items 
are positioned in 3d space, which gets us "free" depth sorting. I modified the 
camera to use an orthogonal projection instead of perspective projection, so 
the items can be moved in 3d space but it will still look like 2d. I also 
changed the "Engine" class to be a singleton, as without that, it would be 
nearly impossible to cleanly implement the current SpriteRenderer component.

Gluon Input received an update as well. A lot of duplicate code was removed 
and in general the structure seems to be a bit cleaner now. Adopta did most of 
the work for that, I am unsure about the specifics of the changes.

Gluon Engine also received some changes. Of course there are the classes that 
were moved to core, which had a bit of impact on Engine. Another major change 
is that components and assets are now built as plug-ins by default. This makes 
them more of a stand-alone piece of code, making them easier to maintain and 
it also becomes easier to exclude those components that depend on libraries 
that are not available.

There were no major changes to the structure of Gluon Creator, apart from the 
build system related fixes. However, together with all the other fixes in the 
library I can safely say that it works much better now. I wrote a quick 
rendering widget for it so now it is actually possible to see what you are 
doing. :)

===== Final Note =====
I removed quite a lot of things from the repository as well. The examples 
directory is mostly gone. We should create some new examples where necessary. 
All the widgets have been removed from the libraries, except for GLWidget in 
Gluon Graphics. They were becoming rather unusable and do not really fit our 
vision of the libraries. Together with the widgets the KCMs have also been 
removed.

Box2D has been completely removed as well. Once we start working on the 
physics components we will need Box2D again, but I would prefer to keep it 
outside the repository and use shared libraries instead. Kubuntu at least has 
packages for it, and probably other distributions as well. The icons and 
resources directories have also been removed, although at least the icons 
should probably be put back in, if only as a part of Gluon Creator. These 
removed parts are of course still available in the git history so we can 
always revive them where necessary.

All in all, I hope that these changes make everything a bit more clean and a 
bit better structured. With these changed done, we can now fix the last 
remaining issues and release out alpha. :)


---
+----------------------------------------------+
Gluon is a high-level game development library for the KDE desktop enviornment.
http://gluon.tuxfamily.org/
http://gitorious.org/gluon



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/