GL Studio C++ Runtime API
gls_state_manager.h
Go to the documentation of this file.
1/// \file gls_state_manager.h
2/// \brief The disti::GlsStateManager factory class. Creates an instance of a
3/// state manager that manages the GL Studio runtime library's use of
4/// the OpenGL context, minimizing unnecessary state changes.
5///
6/// \par Copyright Information
7///
8/// Copyright (c) 2017 by The DiSTI Corporation.<br>
9/// 12249 Science Drive; Suite 300<br>
10/// Orlando, Florida 32826<br>
11/// USA<br>
12/// <br>
13/// All rights reserved.<br>
14///
15/// This Software contains proprietary trade secrets of DiSTI and may not be
16/// reproduced, in whole or part, in any form, or by any means of electronic,
17/// mechanical, or otherwise, without the written permission of DiSTI. Said
18/// permission may be derived through the purchase of applicable DiSTI product
19/// licenses which detail the distribution rights of this content and any
20/// Derivative Works based on this or other copyrighted DiSTI Software.
21///
22/// NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
23/// AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
24/// PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
25/// AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
26/// IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
27/// PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
28///
29/// LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
30/// IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
31/// INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
32/// DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
33/// INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
34/// INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
35/// OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
36/// EXCEED FIVE DOLLARS (US$5.00).
37///
38/// The aforementioned terms and restrictions are governed by the laws of the
39/// State of Florida and the United States of America.
40
41#ifndef DISTI_GLS_STATE_MANAGER_H_INCLUDED
42#define DISTI_GLS_STATE_MANAGER_H_INCLUDED
43
45
46#ifdef GLES20
48#endif
49
50/// \cond INTERNAL
51#ifdef GLS_GL_DEBUGGING
52# define ERROR_CHECK() DistiAssert( GL_NO_ERROR == GlsStateManager::CheckError() );
53#else
54# define ERROR_CHECK()
55#endif
56/// \endcond
57
58namespace disti
59{
60/** The GlsStateManager singleton class that holds an instance of a
61 * state manager that manages the GL Studio runtime library's use of
62 * the OpenGL context, minimizing unnecessary state changes.
63 */
65{
66public:
67 /** The singleton accessor method for an implementation of an IGlsStateManager, which manages
68 * the GL Studio runtime library's use of the OpenGL context, minimizing unnecessary state changes
69 * \return Returns a pointer to the IGlsStateManager implementation singleton.
70 * For OpenGL ES 2.0, returns an implementation of an IGlsStateManagerES20
71 */
73
74 /// \return The value of glGetError(), and prints the value if not equal to GL_NO_ERROR.
75 GLS_EXPORT static GLenum CheckError();
76
77private:
78 /** ctor */
80
81 /** dtor */
83
84 // Creates the proper instance for management by GlsGlobals
85 static IGlsStateManager* CreateStateManager();
86 friend class GlsGlobals;
87};
88
89} // namespace disti
90
91#endif // DISTI_GLS_STATE_MANAGER_H_INCLUDED
Hold global objects so we can control order of destruction.
Definition: util.h:2067
Definition: gls_state_manager.h:65
static IGlsStateManager * Instance()
static GLenum CheckError()
Definition: gls_state_manager_interface.h:65
#define GLS_EXPORT
Macro denoting which functions should be visible from the runtime library.
Definition: gls_include.h:50
IGlsStateManager, interface to a state manager that manages the GL Studio runtime library's use of th...
IGlsStateManager, interface to a state manager that manages the GL Studio runtime library's use of th...
Definition: bmpimage.h:46