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
15reproduced, in whole or part, in any form, or by any means of electronic,
16mechanical, or otherwise, without the written permission of DiSTI. Said
17permission may be derived through the purchase of applicable DiSTI product
18licenses which detail the distribution rights of this content and any
19Derivative Works based on this or other copyrighted DiSTI Software.
20
21 NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
22AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
23PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
24AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
25IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
26PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
27
28 LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
29IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
30INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
31DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
32INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
33INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
34OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
35EXCEED FIVE DOLLARS (US$5.00).
36
37 The aforementioned terms and restrictions are governed by the laws of the
38State 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
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
83namespace disti
84{
85/// \details The FrameBufferUtility class. A platform independent way of determining if frame buffer objects are supported.
87{
88public:
89 /**
90 * Determine if the hardware supports Frame buffers.
91 * If it does, then the Frame buffer API is lazily instantiated
92 *
93 * \return True if frame buffers are supported
94 */
96
97 /**
98 * Check the completeness status of the GL_FRAMEBUFFER.
99 *
100 * \return true if the status of the GL_FRAMEBUFFER is GL_FRAMEBUFFER_COMPLETE.
101 */
103
104private:
105 static bool frameBufferSupportAvailable; /*< True if frame buffer support is available. */
106 static bool frameBufferSupportInitialized; /*< True if frame buffer support has been initialized. Allows lazily initialzation. */
107
108 /**
109 * Initialize frame buffer support.
110 */
111 static void initializeFrameBufferSupport();
112
113 // Disallow, this class is designed to be a utiltiy class.
115};
116} // namespace disti
117
118#endif // INCLUDED_FRAME_BUFFER_UTILITY_H
Definition: frame_buffer_utility.h:87
static bool frameBuffersAreSupported()
static bool checkFrameBufferStatus()
The gls_gl.
Force inclusion of the DirectShow library.
Definition: bmpimage.h:47