Main Page | Class Hierarchy | Class List | Directories | File List

Introduction

Organisation of ApiG

In the following documentation APIG_ROOT will denote the root of this api (usually /usr/local/api_graphics). It is organised as follows :

ApiG projects compilation

Using qmake is the simplest way to compile a project making use of ApiGraphics classes. There is a template project file in APIG_ROOT.

A typical qmake project configuration file (.pro) looks like this :

TARGET   = Prog             # name of the produced executable
TEMPLATE = app              # make an application, not a library
CONFIG *= warn_on debug     # to get warnings and debug info
CONFIG *= apig              # necessary to use ApiG classes

HEADERS = sources/*.h       # all the C++ headers of the project
SOURCES = sources/*.cpp     # all the C++ sources of the project

OBJECTS_DIR = .obj          # the directory where will be placed object (.o) files.

Once this project file is created just run the following commands in a shell, in the directory containing the .pro file :

> qmake
> make

The program should be compiled.

How does that work?

qmake works with configuration files indentified by a .prf extension.

For each token (e.g. apig) put in the CONFIG variable, qmake will search for a corresponding .prf file (e.g. apig.prf) in standard Qt locations and also in directories listed in the QMAKEFEATURES environment variable (or the corresponding Qt "property variable" whose value can be queried using qmake -query or set using qmake -set QMAKEFEATURES ...).

The directory APIG_ROOT/qmake contains useful .prf files for ApiG projects configuration. So simply adding a CONFIG += apig line to your project file makes automatic and transparent the necessary includes and dependencies resolution for ApiG classes.

ApiG headers inclusion.

To avoid any name collisions with other's libs headers, all ApiG files are located in a ApiGraphics subdirectory. Only the parent of this directory is put in the INCLUDEPATH, so that it makes necessary to explicitly specify the full names to include ApiG headers, e.g.:
#include <ApiGraphics/ProgGLSL.h>
Furthermore, all ApiG classe belong to the apig namespace.
Generated on Fri Nov 14 20:49:47 2008 for Api Graphics by  doxygen 1.4.4