GL Studio C++ Runtime API
gls_state_manager.h
Go to the documentation of this file.
1 /*! \file
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  11301 Corporate Blvd; Suite 100<br>
10  Orlando, Florida 32817<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. Use, distribution,
40 duplication, or disclosure by the U. S. Government is subject to
41 "Restricted Rights" as set forth in DFARS 252.227-7014(c)(1)(ii).
42 
43 */
44 
45 #ifndef DISTI_GLS_STATE_MANAGER_H_INCLUDED
46 #define DISTI_GLS_STATE_MANAGER_H_INCLUDED
47 
49 
50 #ifdef GLES20
52 #endif
53 
54 #ifdef GLS_GL_DEBUGGING
55 # define ERROR_CHECK() DistiAssert( GL_NO_ERROR == GlsStateManager::CheckError() );
56 #else
57 # define ERROR_CHECK()
58 #endif // GLS_GL_DEBUGGING
59 
60 namespace disti
61 {
62 /** The GlsStateManager singleton class that holds an instance of a
63  * state manager that manages the GL Studio runtime library's use of
64  * the OpenGL context, minimizing unnecessary state changes.
65  */
67 {
68 public:
69  /** The singleton accessor method for an implementation of an IGlsStateManager, which manages
70  * the GL Studio runtime library's use of the OpenGL context, minimizing unnecessary state changes
71  * \return Returns a pointer to the IGlsStateManager implementation singleton.
72  * For OpenGL ES 2.0, returns an implementation of an IGlsStateManagerES20
73  */
74  GLS_EXPORT static IGlsStateManager* Instance( void );
75 
76  /** returns the value of glGetError(), and prints the value if not equal to GL_NO_ERROR
77  */
78  GLS_EXPORT static GLenum CheckError();
79 
80 private:
81  /** ctor */
82  GlsStateManager( void );
83 
84  /** dtor */
85  ~GlsStateManager();
86 
87  // Creates the proper instance for management by GlsGlobals
88  static IGlsStateManager* CreateStateManager();
89  friend class GlsGlobals;
90 };
91 
92 } // namespace disti
93 
94 #endif // DISTI_GLS_STATE_MANAGER_H_INCLUDED
static IGlsStateManager * Instance(void)
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...
Hold global objects so we can control order of destruction.
Definition: util.h:1684
Definition: gls_state_manager_interface.h:67
Definition: gls_state_manager.h:66
Definition: bmpimage.h:46
static GLenum CheckError()