This section describes compile-time preprocessor symbols that can be used to configure several aspects of OGLplus.
Most of the options are set either to a zero or a non-zero integer value to disable or enable the behavior controlled by the option.
All options have a default value which can be overriden by setting the
option (by defining the PP symbol) before the appropriate header file (one
of oglplus/config/*.hpp
) is processed, either by editing
the oglplus/site_config.hpp
file or by using the -D
compiler option (or its equivalent
for defining preprocessor symbols on the command-line or in an IDE).
#include
<oglplus/config/site.hpp>
The cmake
-based build system detects the compiler-capabilities,
installed third-party libraries and supported GL version and extensions
and generates two site configuration files oglplus/config/site.hpp
and oglplus/config/fix_gl_version.hpp
(located in
the $(BUILD_DIR)/include
subdirectory). User applications
can reuse these files if the same compiler, GL API library and external
libraries are used or can disable their use by defining the OGLPLUS_NO_SITE_CONFIG
preprocessor symbol.
Alternatively the user can define their own oglplus/config/site.hpp
file (either as a system-wide or application-specific configuration)
and set the options described below to values (either zero or non-zero
integer) appropriate to their system setup and used compiler.
This header should generally not be used by the library end-users. In order to detect the compiler capabilities use the compiler configuration header.
The first set of options concerns the availability of third-party libraries used by some parts of the code.
#define OGLPLUS_OPENAL_FOUND <UNSPECIFIED> #define OGLPLUS_PNG_FOUND <UNSPECIFIED> #define OGLPLUS_PANGO_CAIRO_FOUND <UNSPECIFIED> #ifndefOGLPLUS_LOW_PROFILE
#defineOGLPLUS_LOW_PROFILE
<UNSPECIFIED> #endif
The following options select which GL API library (GL/glcorearb.h
,
GL3/gl3.h
, GL/glew.h
, etc.) is
used when the OGLplus' oglplus/gl.hpp
header is
included. The first one defined as a non-zero integer value in the
order as listed here, is used. At least one of the options listed here
must be non-zero.
#ifndef OGLPLUS_USE_GLCOREARB_H # define OGLPLUS_USE_GLCOREARB_H <UNSPECIFIED> #endif #ifndef OGLPLUS_USE_GL3_H # define OGLPLUS_USE_GL3_H <UNSPECIFIED> #endif #ifndef OGLPLUS_USE_GLEW # define OGLPLUS_USE_GLEW <UNSPECIFIED> #endif #ifndef OGLPLUS_USE_GL3W # define OGLPLUS_USE_GL3W <UNSPECIFIED> #endif
The next option enables or disables the usage of the Boost.Config library
for compiler configuration. If set to a non-zero integer the boost/config.hpp
header is included, otherwise it is not.
#ifndef OGLPLUS_USE_BOOST_CONFIG # define OGLPLUS_USE_BOOST_CONFIG <UNSPECIFIED> #endif
The following options indicate compiler capabilities. If one of these
options is set to a non-zero integer value, the corresponding capability
is not implemented. The first set of options listed right below are
overridden by Boost.Config (when OGLPLUS_USE_BOOST_CONFIG
is set to a non-zero value), if they are not defined before including
this header by other means.
#if !OGLPLUS_USE_BOOST_CONFIG #ifndef OGLPLUS_NO_SCOPED_ENUMS # define OGLPLUS_NO_SCOPED_ENUMS <UNSPECIFIED> #endif #ifndef OGLPLUS_NO_VARIADIC_MACROS # define OGLPLUS_NO_VARIADIC_MACROS <UNSPECIFIED> #endif #ifndef OGLPLUS_NO_VARIADIC_TEMPLATES # define OGLPLUS_NO_VARIADIC_TEMPLATES <UNSPECIFIED> #endif #ifndef OGLPLUS_NO_UNIFIED_INITIALIZATION_SYNTAX # define OGLPLUS_NO_UNIFIED_INITIALIZATION_SYNTAX <UNSPECIFIED> #endif #ifndef OGLPLUS_NO_INITIALIZER_LISTS # define OGLPLUS_NO_INITIALIZER_LISTS <UNSPECIFIED> #endif #ifndef OGLPLUS_NO_DEFAULTED_FUNCTIONS # define OGLPLUS_NO_DEFAULTED_FUNCTIONS <UNSPECIFIED> #endif #ifndef OGLPLUS_NO_DELETED_FUNCTIONS # define OGLPLUS_NO_DELETED_FUNCTIONS <UNSPECIFIED> #endif #ifndef OGLPLUS_NO_EXPLICIT_CONVERSION_OPERATORS # define OGLPLUS_NO_EXPLICIT_CONVERSION_OPERATORS <UNSPECIFIED> #endif #ifndef OGLPLUS_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS # define OGLPLUS_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS <UNSPECIFIED> #endif #ifndef OGLPLUS_NO_UNICODE_LITERALS # define OGLPLUS_NO_UNICODE_LITERALS <UNSPECIFIED> #endif #ifndef OGLPLUS_NO_USER_DEFINED_LITERALS # define OGLPLUS_NO_USER_DEFINED_LITERALS <UNSPECIFIED> #endif #ifndef OGLPLUS_NO_TEMPLATE_ALIASES # define OGLPLUS_NO_TEMPLATE_ALIASES <UNSPECIFIED> #endif
Indicates that C++11 strongly typed enumerations are not supported. |
|
Indicates that preprocessor variadic macros are not supported. |
|
Indicates that C++11 variadic templates are not properly supported. |
|
Indicates that C++11 unified initialization syntax is not implemented. |
|
Indicates that C++11 initializer lists are not supported. |
|
Indicates that C++11 |
|
Indicates that C++11 |
|
Indicates that C++11 explicit conversion operators are not supported. |
|
Indicates that C++11 default template arguments cannot be used. |
|
Indicates that C++11 unicode string literals are not supported. |
|
Indicates that C++11 user-defined literals are not supported. |
|
Indicates that C++11 template aliases are not supported. |
#ifndef OGLPLUS_NO_CONSTEXPR # define OGLPLUS_NO_CONSTEXPR <UNSPECIFIED> #endif #ifndef OGLPLUS_NO_OVERRIDE # define OGLPLUS_NO_OVERRIDE <UNSPECIFIED> #endif #ifndef OGLPLUS_NO_NOEXCEPT # define OGLPLUS_NO_NOEXCEPT <UNSPECIFIED> #endif #ifndef OGLPLUS_NO_LAMBDAS # define OGLPLUS_NO_LAMBDAS <UNSPECIFIED> #endif #endif //!OGLPLUS_USE_BOOST_CONFIG
Indicates that C++11 generalized constant expressions are not supported. |
|
Indicates that C++11 explicit virtual override is not supported. |
|
Indicates that C++11 |
|
Indicates that C++11 lambdas are not supported. |
The next options are not influenced by Boost.Config.
#ifndef OGLPLUS_NO_INHERITED_CONSTRUCTORS # define OGLPLUS_NO_INHERITED_CONSTRUCTORS <UNSPECIFIED> #endif #ifndef OGLPLUS_NO_CHRONO # define OGLPLUS_NO_CHRONO <UNSPECIFIED> #endif #ifndef OGLPLUS_NO_THREADS # define OGLPLUS_NO_THREADS <UNSPECIFIED> #endif #ifndef OGLPLUS_NO_SCOPED_ENUM_TEMPLATE_PARAMS #define OGLPLUS_NO_SCOPED_ENUM_TEMPLATE_PARAMS <UNSPECIFIED> #endif
Indicates that C++11 inherited constructors are not supported. |
|
Indicates that the standard |
|
Indicates that the C++11 threads implementation is not available. |
|
Indicates that using C++11 scoped enumerations as template parameters is not supported or not implemented correctly. |
#include
<oglplus/config/compiler.hpp>
This header is used by the rest of the library to determine the capabilities of the currently used compiler. The values are taken either externally from the build system through the compiler command-line or an IDE or from the site-configuration header or from the Boost.Config library.
#ifndef OGLPLUS_NO_SITE_CONFIG # include <oglplus/config/site.hpp> #endif #ifndef OGLPLUS_USE_BOOST_CONFIG # define OGLPLUS_USE_BOOST_CONFIG 0 #endif #if OGLPLUS_USE_BOOST_CONFIG # include <boost/config.hpp> #endif // The default values for the preprocessor symbols indicating // compiler capabilities are also defined here.
Disables the usage of the automatically-generated site configuration header. |
|
Enables the use of the Boost.Config library for the detection of compiler capabilities. If not set in the site-config nor defined otherwise, the use of Boost.Config is disabled by default. |
#include
<oglplus/config/basic.hpp>
This section lists general compile-time configuration options of OGLplus.
#ifndef OGLPLUS_LOW_PROFILE # define OGLPLUS_LOW_PROFILE 0 #endif #ifndef OGLPLUS_LINK_LIBRARY # define OGLPLUS_LINK_LIBRARY 0 #endif #ifndef OGLPLUS_NO_SITE_CONFIG # include <oglplus/config/site.hpp> #endif
Compile-time option enabling the low-profile mode. In the low-profile mode some features (like object descriptions, enumeration value names, some file and line info atached to exceptions, etc. useful during development and debugging) are disabled, resulting in both smaller binary executable sizes and lower run-time overhead for release builds of applications using OGLplus. Setting this option to a non-zero integer value enables the low-profile mode, setting it to zero disables it. By default the low-profile mode is disabled. This option influences the default value of several other configuration options. Their values can of course be set independently if required. |
|
Compile-time switch enabling linking of some parts of OGLplus from a binary library. Certain parts of OGLplus (mostly complicated functions and functions where static variables or long string literals are used) can be built into a separate library that can be then linked to applications. If this option is set to zero, then everything is inlined. If it is set to a nonzero integer value, then some functions are just declared and must be built separatelly and linked to the final executable.
The By default this option is set to 0 - everything is inlined. |
|
Disables the usage of the automatically-generated site configuration header. |
#include
<oglplus/config/gl.hpp>
The preprocessor options in this category influence behaviour related to interfacing between OGLplus and the GL API.
#define GLAPIENTRY
#ifndef OGLPLUS_NO_GLFUNC_CHECKS # define OGLPLUS_NO_GLFUNC_CHECKSOGLPLUS_LOW_PROFILE
#endif #ifndef OGLPLUS_NO_UNIFORM_TYPECHECK # define OGLPLUS_NO_UNIFORM_TYPECHECKOGLPLUS_LOW_PROFILE
#endif
Compile-time switch disabling checks of validity of pointers to GL
functions. Setting this preprocessor symbol to a nonzero value causes
that if the OpenGL functions are called through a pointer, then that
pointer is checked before it is used to call the function. If enabled
and a pointer to a GL function is |
|
Compile-time switch entirely disabling typechecking of uniforms.
Setting this preprocessor symbol to a nonzero value causes the Uniform
variables are not typechecked. By default this option is set to the
same value as |
#include
<oglplus/config/string.hpp>
The following options influence the behaviour of OGLplus string wrappers.
#ifndef OGLPLUS_NO_UTF8_CHECKS
# define OGLPLUS_NO_UTF8_CHECKS OGLPLUS_LOW_PROFILE
#endif
Compile-time switch disabling UTF-8 validity checks in various functions.
Setting this preprocessor symbol to a nonzero value causes that the
String constructors
skip their UTF-8 validity checks. By default this option is set to
the same value as |
#include
<oglplus/config/error.hpp>
The following options disable some of the attributes
of OGLplus' exception classes.
By disabling we mean, that various member functions
of Error or its descendants,
(like SourceFunc, SourceLine, etc.) return a default value (nullptr
,
zero, empty string, etc.) instead of the real value related to a raised
error.
When fully enabled, Error provides quite a lot of information about an error that occured during the execution of OGLplus code. While this information may be useful during debugging, it also requires additional memory to store and program instructions to initialize in an instance of Error.
Disabling certain attributes may be useful in release builds when most bugs have been fixed and such a detailed diagnostic is not required. Doing so will most probably lead to both a decrease in code size and CPU overhead.
#ifndef OGLPLUS_ERROR_NO_FILE # define OGLPLUS_ERROR_NO_FILEOGLPLUS_LOW_PROFILE
#endif #ifndef OGLPLUS_ERROR_NO_LINE # define OGLPLUS_ERROR_NO_LINEOGLPLUS_LOW_PROFILE
#endif #ifndef OGLPLUS_ERROR_NO_FUNC # define OGLPLUS_ERROR_NO_FUNCOGLPLUS_LOW_PROFILE
#endif #ifndef OGLPLUS_ERROR_NO_GL_LIB # define OGLPLUS_ERROR_NO_GL_LIB 0 #endif #ifndef OGLPLUS_ERROR_NO_GL_FUNC # define OGLPLUS_ERROR_NO_GL_FUNC 0 #endif #ifndef OGLPLUS_ERROR_NO_GL_SYMBOL # define OGLPLUS_ERROR_NO_GL_SYMBOL 0 #endif
Disables the |
|
Disables the |
|
Disables the |
|
Disables the |
|
Disables the |
|
Disables the |
#include
<oglplus/config/enums.hpp>
The preprocessor options defined here control behavior related to the OGLplus enumerations. The functions for iteration through all available values in an enumerated type and the functions for returning the GL names of the enumeration values can be either enabled or disabled by these options.
#ifndef OGLPLUS_NO_ENUM_VALUE_NAMES # define OGLPLUS_NO_ENUM_VALUE_NAMESOGLPLUS_LOW_PROFILE
#endif #ifndef OGLPLUS_NO_ENUM_VALUE_RANGES # define OGLPLUS_NO_ENUM_VALUE_RANGES OGLPLUS_LOW_PROFILE #endif #ifndef OGLPLUS_NO_ENUM_VALUE_CLASSES # define OGLPLUS_NO_ENUM_VALUE_CLASSESOGLPLUS_NO_SCOPED_ENUM_TEMPLATE_PARAMS
#endif
Compile-time switch disabling the functions returning enumerated value names. Setting this preprocessor symbol to a non-zero value causes that the EnumValueName functions always return an empty string. When set to zero these functions return a textual name of an enumerated value passed as argument.
By default this option is set to the same value as |
|
Compile-time switch disabling the functions returning enumerated value ranges. Setting this preprocessor symbol to a nonzero value causes that the EnumValueRange functions always return an empty range. When set to zero these functions return a range of all values in the enumeration passed as the template argument.
By default this option is set to the same value as |
|
Compile-time switch disabling the specializations of enums::EnumToClass. Setting this preprocessor symbol to a nonzero value causes that the enums::EnumToClass templates to be unspecialized for the individual enums. By default this option is set to zero (except on compilers where template specializations for enum-class is not implemented properly). |
#include
<oglplus/config/object.hpp>
The following preprocessor options influence behaviour related to OGLplus objects.
The following options enable or disable the texture OGLplus object descriptions.
Note | |
---|---|
Object descriptions use statically initialized data which may cause
problems if the final executable is built together from several different
object files. Because of this, if object descriptions are enabled it
is recommended that OGLplus applications are built with |
#ifndef OGLPLUS_NO_OBJECT_DESC
# define OGLPLUS_NO_OBJECT_DESC OGLPLUS_LOW_PROFILE
#endif
Compile-time switch disabling textual object descriptions. Setting
this preprocessor option to a non-zero integer value disables the
OGLplus object description attached to various instantiations of
the Object
template (like Program,
Shader, Texture,
etc.) during construction, by the means of the ObjectDesc
parameter in constructor of Object.
By default this option is set to the same value as |