GL Studio C++ Runtime API
display_types.h
Go to the documentation of this file.
1 /*! \file
2  \brief GL Studio Enumerations and constants.
3 
4  \par Copyright Information
5 
6  Copyright (c) 2017 by The DiSTI Corporation.<br>
7  11301 Corporate Blvd; Suite 100<br>
8  Orlando, Florida 32817<br>
9  USA<br>
10  <br>
11  All rights reserved.<br>
12 
13  This Software contains proprietary trade secrets of DiSTI and may not be
14 reproduced, in whole or part, in any form, or by any means of electronic,
15 mechanical, or otherwise, without the written permission of DiSTI. Said
16 permission may be derived through the purchase of applicable DiSTI product
17 licenses which detail the distribution rights of this content and any
18 Derivative Works based on this or other copyrighted DiSTI Software.
19 
20  NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
21 AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
22 PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
23 AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
24 IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
25 PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
26 
27  LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
28 IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
29 INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
30 DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
31 INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
32 INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
33 OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
34 EXCEED FIVE DOLLARS (US$5.00).
35 
36  The aforementioned terms and restrictions are governed by the laws of the
37 State of Florida and the United States of America.
38 
39 */
40 #ifndef _DISPLAY_TYPES_H
41 #define _DISPLAY_TYPES_H
42 
43 #include "gls_include.h"
44 
45 namespace disti
46 {
47 #if !defined( GLES ) && !defined( _WIN32 ) && !defined( __APPLE__ ) && !defined( GL_VERSION_1_2 )
48 # define REPLACE_TEXTURE_MODE GL_REPLACE_EXT
49 #else
50 # define REPLACE_TEXTURE_MODE GL_REPLACE
51 #endif
52 
53 // Number of texture points per object
54 #define NUM_TEXTURE_POINTS 4
55 
56 #define OBJECT_SETTING_UNDEFINED -1
57 
58 /** Enumeration for texture mapping mode of the object */
59 typedef enum
60 {
61  TEXTURE_MAP_MODULATE, /**< Texture color and alpha are modulated with polygon color and alpha */
62  TEXTURE_MAP_DECAL, /**< Texture color is blended with polygon color */
63  TEXTURE_MAP_BLEND, /**< Texture color is blended with polygon color, texture alpha is modulated with polygon alpha */
64  TEXTURE_MAP_REPLACE /**< Texture color and alpha replace polygon color and alpha */
65 } TextureMap_e;
66 
67 /** Enumeration for texture filtering mode of the object */
68 typedef enum
69 {
70  TEXTURE_FILTER_NEAREST, /**< Nearest pixel filtering */
71  TEXTURE_FILTER_LINEAR, /**< Bilinear interpolation filtering */
72  TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST, /**< Selects nearest pixel in the nearest mipmap */
73  TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR, /**< Linearly interpolates in two mipmaps then linearly interpolates between them */
74  TEXTURE_FILTER_NEAREST_MIPMAP_LINEAR, /**< Selects nearest pixel in two mipmaps then linearly interpolates between them */
75  TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST /**< Linearly interpolates in the nearest mipmap */
77 
78 /** Enumeration for the Depth Testing and Writting mode */
79 typedef enum
80 {
81  DEPTH_BUFFER_NO_TEST_NO_WRITE = 0, //Save as 0 for compatability /**< Doesn't Test or Write */
82  DEPTH_BUFFER_TEST_AND_WRITE, //Save as 1 for compatability /**< Both Tests and Writes */
83  DEPTH_BUFFER_TEST_NO_WRITE, /**< Tests but doesn't write */
84  DEPTH_BUFFER_NO_TEST_AND_WRITE /**< Doesn't test but does write*/
86 
87 /** Enumeration for polygon drawing mode of the object */
88 typedef enum
89 {
90  POLY_MODE_UNDEFINED, /**< Polygon draw style is not defined; not a drawable type. Used with the properties page */
91  POLY_MODE_POINTS, /**< Polygon will be rendered with a point at each vertex */
92  POLY_MODE_OUTLINE, /**< Polygon will be rendered as an outline */
93  POLY_MODE_FILLED, /**< Polygon will be rendered filled-in */
94  POLY_MODE_FILL_AND_OUTLINE /**< Polygon will be rendered filled-in and with an outline */
96 
97 /** Enumeration for Alpha Blending/Testing mode */
98 typedef enum
99 {
100  ALPHA_MODE_UNDEFINED, /**< Alpha mode is not defined. Used by the properties page */
101  ALPHA_MODE_OPAQUE, /**< Alpha testing and blending are disabled */
102  ALPHA_MODE_2_LEVEL, /**< Alpha testing with a threshold of 0.5 is enabled, alpha blending is enabled. */
103  ALPHA_MODE_256_LEVEL /**< Alpha blending is enabled, alpha testing is disabled. */
104 } AlphaMode_e;
105 
106 /** Enumeration for whether or not polygon is closed or open */
107 typedef enum
108 {
109  POLY_OPEN, /**< Polygon will be drawn open */
110  POLY_CLOSED /**< Polygon will be drawn closed */
112 
113 /** Enumeration for the type of rendering projection for a display frame */
114 typedef enum
115 {
116  SHADING_FLAT, /**< The object will be drawn with flat shading (monochromatic) */
117  SHADING_GOURAUD /**< The object will be drawn with gouraud shading (linear color interpolation) */
118 } ShadingType_e;
119 
120 /** Enumeration for the C++ protection status of an object */
121 typedef enum
122 {
123  PUBLIC, /**< The object will be C++ public status */
124  PRIVATE, /**< The object will be C++ private status */
125  PROTECTED /**< The object will be C++ protected status */
127 
128 /** Enumeration for the redraw behavior for a display frame */
129 typedef enum
130 {
131  REDRAW_CONDITIONAL, /**< The display frame is only redrawn when the scene changes */
132  REDRAW_CONSTANT, /**< The display frame is constantly redrawn at a specified rate */
133  REDRAW_CONTINUOUS /**< The display frame is constantly redrawn as fast as possible */
135 
136 /** Enumeration for the type of picking for an object */
137 typedef enum
138 {
139  PICK_NEVER, /**< Picking will be disabled for this object and all children */
140  PICK_FIRST, /**< Picking will be based on draw order only. The first geometry hit wins. */
141  PICK_BEST, /**< Picking will find the best geometry hit of all available children */
142  PICK_ALWAYS /**< Picking will ignore geometry of this object, and always return a pick as if hit.
143  This is still only found through normal draw order traversal.*/
145 
146 /** Enumeration for an object's usage of glColorMaterial */
147 typedef enum
148 {
149  NO_COLOR_MATERIAL, /**< glColorMaterial will be disabled for the object */
150  DIFFUSE_COLOR_MATERIAL, /**< glColorMaterial will be enabled for the diffuse material */
151  AMBIENT_COLOR_MATERIAL, /**< glColorMaterial will be enabled for the ambient material */
152  DIFFUSE_AND_AMBIENT_COLOR_MATERIAL, /**< glColorMaterial will be enabled for the diffuse & ambient materials */
153  EMISSION_COLOR_MATERIAL, /**< glColorMaterial will be enabled for the emission material */
154  SPECULAR_COLOR_MATERIAL /**< glColorMaterial will be enabled for the specular material */
156 
157 /////////////////////////////////////////////////////////////////////////
158 //
159 // Default field values
160 //
161 /////////////////////////////////////////////////////////////////////////
162 #define DEF_WINDOW_SIZE 500
163 #define DEF_FILE_NAME "Untitled"
164 
165 #define DEF_LINE_RCOLOR 0
166 #define DEF_LINE_GCOLOR 0
167 #define DEF_LINE_BCOLOR 0
168 #define DEF_LINE_ALPHA 255
169 
170 #define DEF_FILL_RCOLOR 255
171 #define DEF_FILL_GCOLOR 255
172 #define DEF_FILL_BCOLOR 255
173 #define DEF_FILL_ALPHA 255
174 
175 #define DEF_GRID_RCOLOR 0
176 #define DEF_GRID_GCOLOR 0
177 #define DEF_GRID_BCOLOR 0
178 #define DEF_GRID_ALPHA 255
179 
180 #define DEF_AXES_RCOLOR 0
181 #define DEF_AXES_GCOLOR 0
182 #define DEF_AXES_BCOLOR 0
183 #define DEF_AXES_ALPHA 255
184 
185 #define DEF_TEXTURE_BLEND_RCOLOR 255
186 #define DEF_TEXTURE_BLEND_GCOLOR 255
187 #define DEF_TEXTURE_BLEND_BCOLOR 255
188 #define DEF_TEXTURE_BLEND_ALPHA 255
189 
190 #define DEF_BACKGROUND_RCOLOR 160
191 #define DEF_BACKGROUND_GCOLOR 168
192 #define DEF_BACKGROUND_BCOLOR 176
193 #define DEF_BACKGROUND_ALPHA 255
194 
195 #define DEF_LIGHT_COLOR 255
196 
197 #define DEF_LINE_WIDTH 1.0
198 #define DEF_LINE_STIPPLE_PATTERN 65535
199 #define DEF_LINE_STIPPLE_MULTIPLIER 1
200 
201 #define DEF_QUAD_WIDTH 25.0
202 #define DEF_QUAD_HEIGHT 25.0
203 
204 #define DEF_CIRCLE_WIDTH 25.0
205 #define DEF_CIRCLE_HEIGHT 25.0
206 #define DEF_SHADING SHADING_FLAT
207 #define DEF_LIGHTING_ENABLED 0
208 #define DEF_USE_PARENT_LIGHTING true
209 #define DEF_POLY_MODE POLY_MODE_OUTLINE
210 #define DEF_POLY_END POLY_CLOSED
211 #define DEF_TEXTURE_REPEAT TRUE
212 #define DEF_TEXTURE_MAGNIFICATION TEXTURE_FILTER_LINEAR
213 #define DEF_TEXTURE_MINIFICATION TEXTURE_FILTER_LINEAR
214 #define DEF_TEXTURE_MAP TEXTURE_MAP_REPLACE
215 #define DEF_POLYGON_MIN_DIMENSION 1
216 
217 #define DEF_POLYGON_OFFSET 0
218 
219 #define DEF_DOUBLE_CLICK 500
220 #define DEF_DOUBLE_CLICK_TOLERANCE 5
221 
222 #define DEF_STATIC_FLAG FALSE
223 #define DEF_ALPHAMODE ALPHA_MODE_256_LEVEL
224 #define DEF_VISIBILITY TRUE
225 #define DEF_CULLBACKFACE FALSE
226 #define DEF_ZBUFFER DEPTH_BUFFER_TEST_NO_WRITE
227 #define DEF_ANTIALIAS FALSE
228 #define DEF_CIRCLE_SEGMENTS 30
229 #define DEF_PROTECTION_MODE PUBLIC
230 #define DEF_ARC_ANGLE_AMOUNT 90.0
231 #define DEF_ARC_START_ANGLE 270.0
232 #define DEF_PROJECTION ORTHOGRAPHIC
233 #define DEF_BUFFER DOUBLE_BUFFER
234 #define DEF_FRAME_RATE 30
235 #define DEF_REDRAW REDRAW_CONSTANT
236 #define DEF_BLINK false
237 #define DEF_BLINK_RATE 2.0
238 #define DEF_PICKABLE PICK_FIRST
239 #define DEF_MATERIAL_INDEX 0
240 
241 #define DEF_TEXTURE_PALETTE_SIZE 50
242 
243 static const int MULTIPLE_TEXTURES_ON_OBJECT = -2;
244 
245 //////////////////////////////////////////////////////////////////////////
246 //
247 // "View" of a window, either in runtime or in the editor
248 //
249 //////////////////////////////////////////////////////////////////////////
250 /**
251  View
252 */
253 enum Views
254 {
255  VIEW_XY = 1,
256  VIEW_XZ = 2,
257  VIEW_ZY = 4,
258  VIEW_PERSPECTIVE = 8,
259  VIEW_EYEPOINT = 16
260 };
261 
262 //////////////////////////////////////////////////////////////////////////
263 //
264 // Used in Generated Code
265 //
266 //////////////////////////////////////////////////////////////////////////
267 /**
268  Initializers
269 */
270 typedef enum
271 {
272  GLS_INSTANCE_NAME = 1,
273  GLS_LOCATION,
274  GLS_ROTATION_POINT,
275  GLS_ACTION_CALLBACK,
276  GLS_OBJECT_NAME,
277  GLS_ATTRIBUTE_NAME,
278  GLS_TEXTURE_INDEX,
279  GLS_TEXTURE_REPEAT,
280  GLS_TEXTURE_MAP_MODE,
281  GLS_TEXTURE_MIN_FILTER,
282  GLS_TEXTURE_MAG_FILTER,
283  GLS_TEXTURE_BLEND_COLOR,
284  GLS_TEXTURE_ROTATION,
285  GLS_TEXTURE_SCALE_H,
286  GLS_TEXTURE_SCALE_V,
287  GLS_TEXTURE_OFFSET_X,
288  GLS_TEXTURE_OFFSET_Y,
289  GLS_POLYGON_MODE,
290  GLS_POLYGON_END,
291  GLS_POLYGON_OFFSET,
292  GLS_COLOR,
293  GLS_COLOR_MATERIAL_MODE,
294  GLS_LINE_WIDTH,
295  GLS_LINE_STIPPLE_PATTERN,
296  GLS_LINE_STIPPLE_MULTIPLIER,
297  GLS_VISIBILITY,
298  GLS_CULLBACKFACE,
299  GLS_ALPHAMODE,
300  GLS_ANTIALIAS,
301  GLS_ZBUFFER,
302  GLS_SHADING,
303  GLS_BLINKING,
304  GLS_BLINK_RATE,
305  GLS_PICKABLE,
306  GLS_LIGHTING_ENABLED,
307  GLS_MATERIAL_INDEX,
308  GLS_MATERIAL_INDICES,
309  GLS_DCS_MATRIX,
310  GLS_COMPONENT_ABSOLUTE_PLACEMENT,
311  GLS_COMPONENT_EDITOR_TRANSFORM,
312  GLS_TEXTURE_POINTS,
313  GLS_LAST_INITIALIZER
315 
316 } // namespace disti
317 
318 #endif
Definition: display_types.h:75
Definition: display_types.h:84
Definition: display_types.h:100
Definition: display_types.h:73
ShadingType_e
Definition: display_types.h:114
Definition: display_types.h:141
GLS_Initializers
Definition: display_types.h:270
RedrawBehavior_e
Definition: display_types.h:129
Definition: display_types.h:132
PolygonMode_e
Definition: display_types.h:88
TextureFilter_e
Definition: display_types.h:68
Definition: display_types.h:153
Definition: display_types.h:151
Definition: display_types.h:91
Definition: display_types.h:103
Definition: display_types.h:92
Definition: display_types.h:102
Definition: display_types.h:110
A file for all GL Studio files to include.
Definition: display_types.h:63
Definition: display_types.h:116
Definition: display_types.h:90
Views
Definition: display_types.h:253
Definition: display_types.h:101
Definition: display_types.h:133
Definition: display_types.h:123
Definition: display_types.h:152
Definition: display_types.h:64
Definition: display_types.h:62
DepthBuffer_e
Definition: display_types.h:79
Definition: display_types.h:131
ColorMaterialMode_e
Definition: display_types.h:147
Definition: display_types.h:61
AlphaMode_e
Definition: display_types.h:98
PickableType_e
Definition: display_types.h:137
Definition: display_types.h:94
TextureMap_e
Definition: display_types.h:59
Definition: display_types.h:71
Definition: display_types.h:150
Definition: display_types.h:117
Definition: display_types.h:83
MemberAccess_e
Definition: display_types.h:121
Definition: display_types.h:93
Definition: display_types.h:74
Definition: display_types.h:70
Definition: display_types.h:139
PolygonClose_e
Definition: display_types.h:107
Definition: display_types.h:72
Definition: display_types.h:154
Definition: display_types.h:125
Definition: display_types.h:124
Definition: bmpimage.h:46
Definition: display_types.h:149
Definition: display_types.h:140
Definition: display_types.h:142
Definition: display_types.h:109