OGLplus uses a CMake-based build/configuration system. The library itself is header only, which means that applications using it do not need to link to a compiled library, but need just to include the header files.
The build system handles several important tasks:
The CMake script defines and uses several variables to modify the build configuration, which can be specified on the command-line when invoking
cmake (with the -D option. see cmake manual for details):
(Currently available only for platforms with
bash - 'configure.sh') The 'configure' script is a more user-friendly way to invoke cmake and specify additional parameters for the configuration process.
Some of the more important command-line options are described below:
--prefixPATH: Specifies the installation prefix path for cmake (sets the value of the CMAKE_INSTALL_PREFIX variable). If this option is not specified, cmake's default prefix is used.
--include-dirPATH: This options allows to specify additional directiories to search when looking for header files. It may be used multiple times to specify multiple directories.
--without-glew: Do not use GLEW even if it is available.
--help option for the full description and detailed info on the usage of this script.
The library itself is header-only, i.e. all an application using it has to do is to include the necessary header files. The library does not need to be built nor linked to. The cmake-based build system can be used to install the necessary files to a platform-default or a user-specified directory.
One important thing that an application using OGLplus needs to take care of is to make sure that the OpenGL® 3 (or higher) function prototypes, typedefs, preprocessor symbols, etc. are defined before including any OGLplus header.
There are several different ways how to do this; one of the most convenient is to download the
gl3.h header file from www.opengl.org/registry/api/gl3.h and place it to a directory implicitly searched by the compiler or to add the
-I/path/to/include directive to your
CXXFLAGS. If the OpengGL dynamic library or shared object is located in a nonstandard location also update the
On Linux and similar systems using Bash as shell you can for example put the following to your ~/.bashrc file:
# if GL3/gl3.h is in $HOME/include export CXXFLAGS="$CXXFLAGS -I$HOME/include" # if libGL.so is in $HOME/lib export LDFLAGS="$LDFLAGS -L$HOME/lib"
Some other alternatives include using GLEW or a similar library or framework which includes gl3.h or defines the necessary symbols itself. See the standalone examples for working applications using these alternative libraries.
OGLplus is known to work with the following compilers:
Currently the limiting factor seems to be the support for C++11 features by the various compilers. Since C++11 is now an official standard we expect that the compiler vendors will implement these new features soon.