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( 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_EXPOSE, /**< The display frame is only redrawn when the window is uncovered */
132  REDRAW_CONSTANT /**< The display frame is constantly redrawn at a specified rate */
134 
135 /** Enumeration for the type of picking for an object */
136 typedef enum
137 {
138  PICK_NEVER, /**< Picking will be disabled for this object and all children */
139  PICK_FIRST, /**< Picking will be based on draw order only. The first geometry hit wins. */
140  PICK_BEST, /**< Picking will find the best geometry hit of all available children */
141  PICK_ALWAYS /**< Picking will ignore geometry of this object, and always return a pick as if hit.
142  This is still only found through normal draw order traversal.*/
144 
145 /** Enumeration for an object's usage of glColorMaterial */
146 typedef enum
147 {
148  NO_COLOR_MATERIAL, /**< glColorMaterial will be disabled for the object */
149  DIFFUSE_COLOR_MATERIAL, /**< glColorMaterial will be enabled for the diffuse material */
150  AMBIENT_COLOR_MATERIAL, /**< glColorMaterial will be enabled for the ambient material */
151  DIFFUSE_AND_AMBIENT_COLOR_MATERIAL, /**< glColorMaterial will be enabled for the diffuse & ambient materials */
152  EMISSION_COLOR_MATERIAL, /**< glColorMaterial will be enabled for the emission material */
153  SPECULAR_COLOR_MATERIAL /**< glColorMaterial will be enabled for the specular material */
155 
156 /////////////////////////////////////////////////////////////////////////
157 //
158 // Default field values
159 //
160 /////////////////////////////////////////////////////////////////////////
161 #define DEF_WINDOW_SIZE 500
162 #define DEF_FILE_NAME "Untitled"
163 
164 #define DEF_LINE_RCOLOR 0
165 #define DEF_LINE_GCOLOR 0
166 #define DEF_LINE_BCOLOR 0
167 #define DEF_LINE_ALPHA 255
168 
169 #define DEF_FILL_RCOLOR 255
170 #define DEF_FILL_GCOLOR 255
171 #define DEF_FILL_BCOLOR 255
172 #define DEF_FILL_ALPHA 255
173 
174 #define DEF_GRID_RCOLOR 0
175 #define DEF_GRID_GCOLOR 0
176 #define DEF_GRID_BCOLOR 0
177 #define DEF_GRID_ALPHA 255
178 
179 #define DEF_AXES_RCOLOR 0
180 #define DEF_AXES_GCOLOR 0
181 #define DEF_AXES_BCOLOR 0
182 #define DEF_AXES_ALPHA 255
183 
184 #define DEF_TEXTURE_BLEND_RCOLOR 255
185 #define DEF_TEXTURE_BLEND_GCOLOR 255
186 #define DEF_TEXTURE_BLEND_BCOLOR 255
187 #define DEF_TEXTURE_BLEND_ALPHA 255
188 
189 #define DEF_BACKGROUND_RCOLOR 160
190 #define DEF_BACKGROUND_GCOLOR 168
191 #define DEF_BACKGROUND_BCOLOR 176
192 #define DEF_BACKGROUND_ALPHA 255
193 
194 #define DEF_LIGHT_COLOR 255
195 
196 #define DEF_LINE_WIDTH 1.0
197 #define DEF_LINE_STIPPLE_PATTERN 65535
198 #define DEF_LINE_STIPPLE_MULTIPLIER 1
199 
200 #define DEF_QUAD_WIDTH 25.0
201 #define DEF_QUAD_HEIGHT 25.0
202 
203 #define DEF_CIRCLE_WIDTH 25.0
204 #define DEF_CIRCLE_HEIGHT 25.0
205 #define DEF_SHADING SHADING_FLAT
206 #define DEF_LIGHTING_ENABLED 0
207 #define DEF_USE_PARENT_LIGHTING true
208 #define DEF_POLY_MODE POLY_MODE_OUTLINE
209 #define DEF_POLY_END POLY_CLOSED
210 #define DEF_TEXTURE_REPEAT TRUE
211 #define DEF_TEXTURE_MAGNIFICATION TEXTURE_FILTER_LINEAR
212 #define DEF_TEXTURE_MINIFICATION TEXTURE_FILTER_LINEAR
213 #define DEF_TEXTURE_MAP TEXTURE_MAP_REPLACE
214 #define DEF_POLYGON_MIN_DIMENSION 1
215 
216 #define DEF_POLYGON_OFFSET 0
217 
218 #define DEF_DOUBLE_CLICK 500
219 #define DEF_DOUBLE_CLICK_TOLERANCE 5
220 
221 #define DEF_STATIC_FLAG FALSE
222 #define DEF_ALPHAMODE ALPHA_MODE_256_LEVEL
223 #define DEF_VISIBILITY TRUE
224 #define DEF_CULLBACKFACE FALSE
225 #define DEF_ZBUFFER DEPTH_BUFFER_TEST_NO_WRITE
226 #define DEF_ANTIALIAS FALSE
227 #define DEF_CIRCLE_SEGMENTS 30
228 #define DEF_PROTECTION_MODE PUBLIC
229 #define DEF_ARC_ANGLE_AMOUNT 90.0
230 #define DEF_ARC_START_ANGLE 270.0
231 #define DEF_PROJECTION ORTHOGRAPHIC
232 #define DEF_BUFFER DOUBLE_BUFFER
233 #define DEF_FRAME_RATE 30
234 #define DEF_REDRAW REDRAW_CONSTANT
235 #define DEF_BLINK false
236 #define DEF_BLINK_RATE 2.0
237 #define DEF_PICKABLE PICK_FIRST
238 #define DEF_MATERIAL_INDEX 0
239 
240 #define DEF_TEXTURE_PALETTE_SIZE 50
241 
242 static const int MULTIPLE_TEXTURES_ON_OBJECT = -2;
243 
244 //////////////////////////////////////////////////////////////////////////
245 //
246 // "View" of a window, either in runtime or in the editor
247 //
248 //////////////////////////////////////////////////////////////////////////
249 /**
250  View
251 */
252 enum Views
253 {
254  VIEW_XY = 1,
255  VIEW_XZ = 2,
256  VIEW_ZY = 4,
257  VIEW_PERSPECTIVE = 8,
258  VIEW_EYEPOINT = 16
259 };
260 
261 //////////////////////////////////////////////////////////////////////////
262 //
263 // Used in Generated Code
264 //
265 //////////////////////////////////////////////////////////////////////////
266 /**
267  Initializers
268 */
269 typedef enum
270 {
271  GLS_INSTANCE_NAME = 1,
272  GLS_LOCATION,
273  GLS_ROTATION_POINT,
274  GLS_ACTION_CALLBACK,
275  GLS_OBJECT_NAME,
276  GLS_ATTRIBUTE_NAME,
277  GLS_TEXTURE_INDEX,
278  GLS_TEXTURE_REPEAT,
279  GLS_TEXTURE_MAP_MODE,
280  GLS_TEXTURE_MIN_FILTER,
281  GLS_TEXTURE_MAG_FILTER,
282  GLS_TEXTURE_BLEND_COLOR,
283  GLS_TEXTURE_ROTATION,
284  GLS_TEXTURE_SCALE_H,
285  GLS_TEXTURE_SCALE_V,
286  GLS_TEXTURE_OFFSET_X,
287  GLS_TEXTURE_OFFSET_Y,
288  GLS_POLYGON_MODE,
289  GLS_POLYGON_END,
290  GLS_POLYGON_OFFSET,
291  GLS_COLOR,
292  GLS_COLOR_MATERIAL_MODE,
293  GLS_LINE_WIDTH,
294  GLS_LINE_STIPPLE_PATTERN,
295  GLS_LINE_STIPPLE_MULTIPLIER,
296  GLS_VISIBILITY,
297  GLS_CULLBACKFACE,
298  GLS_ALPHAMODE,
299  GLS_ANTIALIAS,
300  GLS_ZBUFFER,
301  GLS_SHADING,
302  GLS_BLINKING,
303  GLS_BLINK_RATE,
304  GLS_PICKABLE,
305  GLS_LIGHTING_ENABLED,
306  GLS_MATERIAL_INDEX,
307  GLS_MATERIAL_INDICES,
308  GLS_DCS_MATRIX,
309  GLS_COMPONENT_ABSOLUTE_PLACEMENT,
310  GLS_COMPONENT_EDITOR_TRANSFORM,
311  GLS_TEXTURE_POINTS,
312  GLS_LAST_INITIALIZER
314 
315 } // namespace disti
316 
317 #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:140
GLS_Initializers
Definition: display_types.h:269
RedrawBehavior_e
Definition: display_types.h:129
Definition: display_types.h:132
Definition: display_types.h:131
PolygonMode_e
Definition: display_types.h:88
TextureFilter_e
Definition: display_types.h:68
Definition: display_types.h:152
Definition: display_types.h:150
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:252
Definition: display_types.h:101
Definition: display_types.h:123
Definition: display_types.h:151
Definition: display_types.h:64
Definition: display_types.h:62
DepthBuffer_e
Definition: display_types.h:79
ColorMaterialMode_e
Definition: display_types.h:146
Definition: display_types.h:61
AlphaMode_e
Definition: display_types.h:98
PickableType_e
Definition: display_types.h:136
Definition: display_types.h:94
TextureMap_e
Definition: display_types.h:59
Definition: display_types.h:71
Definition: display_types.h:149
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:138
PolygonClose_e
Definition: display_types.h:107
Definition: display_types.h:72
Definition: display_types.h:153
Definition: display_types.h:125
Definition: display_types.h:124
Definition: bmpimage.h:46
Definition: display_types.h:148
Definition: display_types.h:139
Definition: display_types.h:141
Definition: display_types.h:109