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:
libPNG. Some examples and some classes provided by OGLplus use libPNG to load PNG files. These are however not required for the general use of OGLplus, applications may use other means to load binary image files.
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):
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.
–library-dirPATH: This options allows to specify additional directiories to search when looking for binary libraries. It may be used multiple times to specify multiple directories.
–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
GL/glcorearb.h header file from www.opengl.org/registry/api/glcorearb.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:
Some other alternatives include using GLEW or a similar library or framework which includes glcorearb.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: