| GL Studio C++ Runtime 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) 2017 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#ifndef INCLUDED_FRAME_BUFFER_UTILITY_H
43#define INCLUDED_FRAME_BUFFER_UTILITY_H
44
45#include "gls_gl.h"
46
47#if defined( GLES ) || defined( __VXWORKS__ ) || defined( QNX )
48# ifndef DOXYGEN_IGNORE
49# define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES
50# define GL_DEPTH_STENCIL GL_DEPTH_STENCIL_OES
51# define GL_UNSIGNED_INT_24_8 GL_UNSIGNED_INT_24_8_OES
52# define GL_DEPTH_COMPONENT24 GL_DEPTH_COMPONENT24_OES
53
54# ifndef GLES20
55# define GL_FRAMEBUFFER GL_FRAMEBUFFER_OES
56# define GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_OES
57# define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES
58# define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES
59# define GL_FRAMEBUFFER_UNSUPPORTED GL_FRAMEBUFFER_UNSUPPORTED_OES
60# define GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_OES
61
62# define GL_DEPTH_ATTACHMENT GL_DEPTH_ATTACHMENT_OES
63# define GL_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING_OES
64# define GL_RENDERBUFFER GL_RENDERBUFFER_OES
65# define GL_DEPTH_COMPONENT16 GL_DEPTH_COMPONENT16_OES
66
67# define glCheckFramebufferStatus glCheckFramebufferStatusOES
68# define glBindFramebuffer glBindFramebufferOES
69# define glGenFramebuffers glGenFramebuffersOES
70# define glDeleteFramebuffers glDeleteFramebuffersOES
71# define glDeleteRenderbuffers glDeleteRenderbuffersOES
72# define glFramebufferTexture2D glFramebufferTexture2DOES
73# define glGenerateMipmap glGenerateMipmapOES
74# define glClearBufferfv glClearBufferfvOES
75# define glGenRenderbuffers glGenRenderbuffersOES
76# define glBindRenderbuffer glBindRenderbufferOES
77# define glRenderbufferStorage glRenderbufferStorageOES
78# define glFramebufferRenderbuffer glFramebufferRenderbufferOES
79# endif
80
81# endif
82#endif
83
84 namespace disti
85{
86/// \details The FrameBufferUtility class. A platform independent way of determining if frame buffer objects are supported.
87 class FrameBufferUtility
88{
89 public:
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.
115 FrameBufferUtility();
116};
117} // namespace disti
118
119#endif // INCLUDED_FRAME_BUFFER_UTILITY_H
disti::FrameBufferUtility
Definition: frame_buffer_utility.h:88
disti::FrameBufferUtility::frameBuffersAreSupported
static bool frameBuffersAreSupported()
disti::FrameBufferUtility::checkFrameBufferStatus
static bool checkFrameBufferStatus()
gls_gl.h
The gls_gl.
disti
Definition: bmpimage.h:47