GL Studio Safety Critical Embedded C++ Runtime Library
gls_render_settings.h
Go to the documentation of this file.
1#ifndef _GLS_RENDER_SETTINGS_H
2#define _GLS_RENDER_SETTINGS_H
3
4/*! \file gls_render_settings.h
5\brief This header defines the basic render setting types used in
6 the GL Studio DO-178B Runtime Library.
7
8\par Copyright Information
9Copyright (C) 1999-2012 The DiSTI Corporation<br>
10Orlando, FL USA<br>
11All rights reserved.<br>
12
13 This file is copyrighted software and contains proprietary trade secrets of
14DiSTI, and embodies substantial creative efforts as well as confidential
15information, ideas, and expressions.
16
17 Permission to use, and copy this software and its documentation for any
18purpose is hereby granted per the Distribution Agreement and/or the Licensing
19Agreement signed with DiSTI. This permission is granted provided that:
20 1. The above copyright notice appears in all copies.
21 2. That both the copyright notice and this permission notice appear in
22 the supporting documentation.
23 3. That the names DiSTI and GL Studio not be used in advertising or
24 publicity pertaining to distribution of the software without specific,
25 written prior permission of DiSTI.
26
27 Permission to modify the software is granted, but not the right to
28distribute the source code whether modified, or non-modified. Modifying the
29software might invalidate the DO-178B certification package.
30
31 Permission to distribute binaries produced by compiling source code, or
32modified source code is granted, provided you:
33 1. Provide your name and address as the primary contact for the support
34 of your modified version.
35 2. Retain our contact information in regard to use of the base software.
36
37 DiSTI does not provide warranty for this software or guarantee that it
38satisfies any specification or requirement unless otherwise stated in a
39specific contractual arrangement between the customer and DiSTI.
40
41*/
42
43#include "gls_include.h"
44#include "gls_types.h"
45
46/** Enumeration for texture mapping mode of the object */
48{
49 GLS_TEXTURE_MAP_MODE_MODULATE, /**< Texture color and alpha is modulated with polygon color and alpha */
50 GLS_TEXTURE_MAP_MODE_DECAL, /**< Texture color is blended with polygon color */
51 GLS_TEXTURE_MAP_MODE_REPLACE, /**< Texture color and alpha replace polygon color and alpha */
52
53 #if defined( GLS_DEBUG )
54 GLS_TEXTURE_MAP_MODE_INVALID /**< Invalid texture map mode ( GLS_DEBUG ) only */
55 #endif
56};
57
58#if defined( GLS_DEBUG )
59#pragma BullseyeCoverage save off
60/**
61 * Determine if the given texture map mode is valid ( GLS_DEBUG only )
62 * \param mode texture map mode in question
63 * \return GLS_TRUE if mode is valid else GLS_FALSE
64 * \pre none
65 * \post none
66 */
67inline GlsBool GlsTextureMapModeIsValid( const GlsTextureMapMode mode )
68{
69 return( ( GLS_TEXTURE_MAP_MODE_MODULATE == mode ) ||
70 ( GLS_TEXTURE_MAP_MODE_DECAL == mode ) ||
71 ( GLS_TEXTURE_MAP_MODE_REPLACE == mode ) );
72}
73#pragma BullseyeCoverage restore
74#endif // GLS_DEBUG
75
76/** Enumeration for texture filtering mode of the object */
78{
79 GLS_TEXTURE_FILTER_MODE_NEAREST, /**< Nearest pixel filtering */
80 GLS_TEXTURE_FILTER_MODE_LINEAR, /**< Bilinear interpolation filtering */
81
82 #if defined( GLS_DEBUG )
83 GLS_TEXTURE_FILTER_MODE_INVALID /**< Invalid texture filter mode ( GLS_DEBUG only )*/
84 #endif
85};
86
87#if defined( GLS_DEBUG )
88#pragma BullseyeCoverage save off
89/** Determine if the given texture filter mode is valid
90 * \param mode texture filter mode in question
91 * \return GLS_TRUE if valid else GLS_FALSE
92 * \pre none
93 * \post none
94 */
95inline GlsBool GlsTextureFilterModeIsValid( const GlsTextureFilterMode mode )
96{
97 return( ( GLS_TEXTURE_FILTER_MODE_NEAREST == mode ) ||
99}
100#pragma BullseyeCoverage restore
101#endif // GLS_DEBUG
102
103/** Enumeration for the Depth Testing and Writting mode */
105{
106 GLS_DEPTH_BUFFER_MODE_TEST, /**< test against depth buffer */
107 GLS_DEPTH_BUFFER_MODE_NO_TEST, /**< do not test against depth buffer */
108
109 #if defined( GLS_DEBUG )
110 GLS_DEPTH_BUFFER_MODE_INVALID /**< Invalid depth buffer mode ( GLS_DEBUG only ) */
111 #endif
112};
113
114#if defined( GLS_DEBUG )
115#pragma BullseyeCoverage save off
116/** Determine if the given depth buffer mode is valid ( GLS_DEBUG only )
117 * \param mode depth buffer mode in nquestion
118 * \return GLS_TRUE if valid else GLS_FALSE
119 * \pre none
120 * \post none
121 */
122inline GlsBool GlsDepthBufferModeIsValid( const GlsDepthBufferMode mode )
123{
124 return( ( GLS_DEPTH_BUFFER_MODE_TEST == mode ) ||
125 ( GLS_DEPTH_BUFFER_MODE_NO_TEST == mode ) );
126}
127#pragma BullseyeCoverage restore
128#endif // GLS_DEBUG
129
130/** Enumeration for polygon drawing mode of the object */
132{
133 GLS_POLYGON_MODE_POINTS, /**< Polygon will be rendered with a point at each vertex */
134 GLS_POLYGON_MODE_OUTLINE, /**< Polygon will be rendered as an outline */
135 GLS_POLYGON_MODE_FILLED, /**< Polygon will be rendered filled-in */
136 GLS_POLYGON_MODE_FILL_AND_OUTLINE, /**< Polygon will be rendered filled-in and with an outline */
137
138 #if defined( GLS_DEBUG )
139 GLS_POLYGON_MODE_INVALID /**< Invalid polygon mode ( GLS_DEBUG only ) */
140 #endif
141};
142
143#if defined( GLS_DEBUG )
144#pragma BullseyeCoverage save off
145/** Determine if the given polygon mode is valid
146 * \param mode polygon mode in question
147 * \return GLS_TRUE if valid else GLS_FALSE
148 * \pre none
149 * \post none
150 */
151inline GlsBool GlsPolygonModeIsValid( const GlsPolygonMode mode )
152{
153 return( ( GLS_POLYGON_MODE_POINTS == mode ) ||
154 ( GLS_POLYGON_MODE_OUTLINE == mode ) ||
155 ( GLS_POLYGON_MODE_FILLED == mode ) ||
157}
158#pragma BullseyeCoverage restore
159#endif // GLS_DEBUG
160
161/** Enumeration for Alpha Blending/Testing mode */
163{
164 GLS_ALPHA_MODE_OPAQUE, /**< Alpha testing and blending are disabled */
165 GLS_ALPHA_MODE_2_LEVEL, /**< Alpha testing with a threshold of 0.5 is enabled, alpha blending is enabled. */
166 GLS_ALPHA_MODE_256_LEVEL, /**< Alpha blending is enabled, alpha testing is disabled. */
167
168 #if defined( GLS_DEBUG )
169 GLS_ALPHA_MODE_INVALID /**< Invalid alpha mode ( GLS_DEBUG only ) */
170 #endif
171};
172
173#if defined( GLS_DEBUG )
174#pragma BullseyeCoverage save off
175/** Determine if the given alpha mode is valid
176 * \param mode alpha mode in question
177 * \return GLS_TRUE if valid else GLS_FALSE
178 * \pre none
179 * \post none
180 */
181inline GlsBool GlsAlphaModeIsValid( const GlsAlphaMode mode )
182{
183 return( ( GLS_ALPHA_MODE_OPAQUE == mode ) ||
184 ( GLS_ALPHA_MODE_2_LEVEL == mode ) ||
185 ( GLS_ALPHA_MODE_256_LEVEL == mode ) );
186}
187#pragma BullseyeCoverage restore
188#endif // GLS_DEBUG
189
190/** Enumeration for whether or not polygon is closed or open */
192{
193 GLS_POLYGON_END_MODE_OPEN, /**< Polygon will be drawn open */
194 GLS_POLYGON_END_MODE_CLOSED, /**< Polygon will be drawn close */
195
196 #if defined( GLS_DEBUG )
197 GLS_POLYGON_END_MODE_INVALID /**< Invalid polygon close mode ( GLS_DEBUG only ) */
198 #endif
199};
200
201#if defined( GLS_DEBUG )
202#pragma BullseyeCoverage save off
203/** Determine if the given polygon end mode is valid
204 * \param mode polygon end mode in question
205 * \return GLS_TRUE if valid else GLS_FALSE
206 */
207inline GlsBool GlsPolygonEndModeIsValid( const GlsPolygonEndMode mode )
208{
209 return( ( GLS_POLYGON_END_MODE_OPEN == mode ) ||
210 ( GLS_POLYGON_END_MODE_CLOSED == mode ) );
211}
212#pragma BullseyeCoverage restore
213#endif // GLS_DEBUG
214
215/** Enumeration for the type of shading used when drawing */
217{
218 GLS_SHADING_MODE_FLAT, /**< The object will be drawn with flat shading (monochromatic) */
219 GLS_SHADING_MODE_GOURAUD, /**< The object will be drawn with gouraud shading (linear color interpolation) */
220
221 #if defined( GLS_DEBUG )
222 GLS_SHADING_MODE_INVALID /**< Invalid shading mode ( GLS_DEBUG only ) */
223 #endif
224};
225
226#if defined( GLS_DEBUG )
227#pragma BullseyeCoverage save off
228/** Determine if the given shading mode is valid
229 * \param mode shading mode in question
230 * \return GLS_TRUE if valid else GLS_FALSE
231 */
232inline GlsBool GlsShadingModeIsValid( const GlsShadingMode mode )
233{
234 return( ( GLS_SHADING_MODE_FLAT == mode ) ||
235 ( GLS_SHADING_MODE_GOURAUD == mode ) );
236}
237#pragma BullseyeCoverage restore
238#endif // GLS_DEBUG
239
240#endif // _GLS_RENDER_SETTINGS_H
This header defines any preprocessor defines needed to configure the GL Studio DO-178B Runtime Librar...
GlsAlphaMode
Definition: gls_render_settings.h:163
@ GLS_ALPHA_MODE_OPAQUE
Definition: gls_render_settings.h:164
@ GLS_ALPHA_MODE_2_LEVEL
Definition: gls_render_settings.h:165
@ GLS_ALPHA_MODE_256_LEVEL
Definition: gls_render_settings.h:166
GlsPolygonEndMode
Definition: gls_render_settings.h:192
@ GLS_POLYGON_END_MODE_CLOSED
Definition: gls_render_settings.h:194
@ GLS_POLYGON_END_MODE_OPEN
Definition: gls_render_settings.h:193
GlsDepthBufferMode
Definition: gls_render_settings.h:105
@ GLS_DEPTH_BUFFER_MODE_NO_TEST
Definition: gls_render_settings.h:107
@ GLS_DEPTH_BUFFER_MODE_TEST
Definition: gls_render_settings.h:106
GlsPolygonMode
Definition: gls_render_settings.h:132
@ GLS_POLYGON_MODE_OUTLINE
Definition: gls_render_settings.h:134
@ GLS_POLYGON_MODE_FILL_AND_OUTLINE
Definition: gls_render_settings.h:136
@ GLS_POLYGON_MODE_FILLED
Definition: gls_render_settings.h:135
@ GLS_POLYGON_MODE_POINTS
Definition: gls_render_settings.h:133
GlsShadingMode
Definition: gls_render_settings.h:217
@ GLS_SHADING_MODE_FLAT
Definition: gls_render_settings.h:218
@ GLS_SHADING_MODE_GOURAUD
Definition: gls_render_settings.h:219
GlsTextureFilterMode
Definition: gls_render_settings.h:78
@ GLS_TEXTURE_FILTER_MODE_NEAREST
Definition: gls_render_settings.h:79
@ GLS_TEXTURE_FILTER_MODE_LINEAR
Definition: gls_render_settings.h:80
GlsTextureMapMode
Definition: gls_render_settings.h:48
@ GLS_TEXTURE_MAP_MODE_DECAL
Definition: gls_render_settings.h:50
@ GLS_TEXTURE_MAP_MODE_REPLACE
Definition: gls_render_settings.h:51
@ GLS_TEXTURE_MAP_MODE_MODULATE
Definition: gls_render_settings.h:49
This header defines the basic types used by the GL Studio DO-178B Runtime Library.
bool GlsBool
Definition: gls_types.h:96