GL Studio API
frame_buffer_utility.h
Go to the documentation of this file.
1 
2 /*! \file
3  \brief Utility for common frame buffer support
4 
5  \par Copyright Information
6 
7  Copyright (c) 2015 by The DiSTI Corporation.<br>
8  11301 Corporate Blvd; Suite 100<br>
9  Orlando, Florida 32817<br>
10  USA<br>
11  <br>
12  All rights reserved.<br>
13 
14  This Software contains proprietary trade secrets of DiSTI and may not be
15 reproduced, in whole or part, in any form, or by any means of electronic,
16 mechanical, or otherwise, without the written permission of DiSTI. Said
17 permission may be derived through the purchase of applicable DiSTI product
18 licenses which detail the distribution rights of this content and any
19 Derivative Works based on this or other copyrighted DiSTI Software.
20 
21  NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
22 AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
23 PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
24 AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
25 IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
26 PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
27 
28  LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
29 IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
30 INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
31 DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
32 INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
33 INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
34 OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
35 EXCEED FIVE DOLLARS (US$5.00).
36 
37  The aforementioned terms and restrictions are governed by the laws of the
38 State of Florida and the United States of America.
39 
40 */
41 
42 
43 #ifndef INCLUDED_FRAME_BUFFER_UTILITY_H
44 #define INCLUDED_FRAME_BUFFER_UTILITY_H
45 
46 #include "gls_gl.h"
47 
48 #if defined(__APPLE__) || ( defined(GLES) && defined(LINUX) ) || defined( __VXWORKS__ )
49 
50 #define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES
51 #define GL_DEPTH_STENCIL GL_DEPTH_STENCIL_OES
52 #define GL_UNSIGNED_INT_24_8 GL_UNSIGNED_INT_24_8_OES
53 #define GL_DEPTH_COMPONENT24 GL_DEPTH_COMPONENT24_OES
54 
55 #ifndef GLES20
56 #define GL_FRAMEBUFFER GL_FRAMEBUFFER_OES
57 #define GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_OES
58 #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES
59 #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES
60 #define GL_FRAMEBUFFER_UNSUPPORTED GL_FRAMEBUFFER_UNSUPPORTED_OES
61 #define GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_OES
62 
63 #define GL_DEPTH_ATTACHMENT GL_DEPTH_ATTACHMENT_OES
64 #define GL_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING_OES
65 #define GL_RENDERBUFFER GL_RENDERBUFFER_OES
66 #define GL_DEPTH_COMPONENT16 GL_DEPTH_COMPONENT16_OES
67 
68 #define glCheckFramebufferStatus glCheckFramebufferStatusOES
69 #define glBindFramebuffer glBindFramebufferOES
70 #define glGenFramebuffers glGenFramebuffersOES
71 #define glDeleteFramebuffers glDeleteFramebuffersOES
72 #define glDeleteRenderbuffers glDeleteRenderbuffersOES
73 #define glFramebufferTexture2D glFramebufferTexture2DOES
74 #define glGenerateMipmap glGenerateMipmapOES
75 #define glClearBufferfv glClearBufferfvOES
76 #define glGenRenderbuffers glGenRenderbuffersOES
77 #define glBindRenderbuffer glBindRenderbufferOES
78 #define glRenderbufferStorage glRenderbufferStorageOES
79 #define glFramebufferRenderbuffer glFramebufferRenderbufferOES
80 #endif
81 
82 #endif
83 
84 namespace disti
85 {
87  {
88  public:
89 
90  /**
91  * Determine if the hardware supports Frame buffers.
92  * If it does, then the Frame buffer API is lazily instantiated
93  *
94  * \return True if frame buffers are supported
95  */
96  static bool frameBuffersAreSupported();
97 
98  /**
99  * Check the completeness status of the GL_FRAMEBUFFER.
100  *
101  * \return true if the status of the GL_FRAMEBUFFER is GL_FRAMEBUFFER_COMPLETE.
102  */
103  static bool checkFrameBufferStatus();
104 
105  private:
106  static bool frameBufferSupportAvailable; /*< True if frame buffer support is available. */
107  static bool frameBufferSupportInitialized; /*< True if frame buffer support has been initialized. Allows lazily initialzation. */
108 
109  /**
110  * Initialize frame buffer support.
111  */
112  static void initializeFrameBufferSupport();
113 
114  // Disallow, this class is designed to be a utiltiy class.
116  };
117 }
118 
119 #endif // INCLUDED_FRAME_BUFFER_UTILITY_H
Definition: frame_buffer_utility.h:86
static bool checkFrameBufferStatus()
static bool frameBuffersAreSupported()
Definition: bmpimage.h:46
The gls_gl.