| GL Studio C++ Runtime API

gls_mimic_group.h
Go to the documentation of this file.
1/*! \file
2 \brief
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
41#ifndef INCLUDED_GLS_MIMIC_GROUP_H
42#define INCLUDED_GLS_MIMIC_GROUP_H
43
44#include "frame_buffer_utility.h"
45
46#include "gls_cpp_lang_support.h"
47#include "group.h"
48#include "image.h"
49
50/// Provides support for creating DLLs.
51#if( defined( GLSGEN_EXPORT_GLSMIMICGROUP ) || defined( GLSGEN_IMPORT_GLSMIMICGROUP ) || defined( GLS_EXPORT_GENERATED ) || defined( GLS_IMPORT_GENERATED ) ) \
52 && defined( _MSC_VER )
53# if defined( GLSGEN_EXPORT_GLSMIMICGROUP ) || defined( GLS_EXPORT_GENERATED )
54# define GLSGEN_GLSMIMICGROUP_EXPORT __declspec( dllexport )
55# else
56# define GLSGEN_GLSMIMICGROUP_EXPORT __declspec( dllimport )
57# endif
58#else
59# define GLSGEN_GLSMIMICGROUP_EXPORT
60#endif
61///////////////////////////////////////////////////////////////////////////////
62
63/// Automatically link the runtime library plugin (on Windows).
64#define LIB_BASE_NAME "gls_mimic_group"
65#include "gls_auto_lib.h"
66#undef LIB_BASE_NAME
67
68 namespace disti
69{
70#ifdef GLES
71 class GlsGloFile;
72#endif
73
74// SetValue enumerations
75 enum
76{
77 GLS_MIMIC_GROUP_STATE = GLS_LAST_INITIALIZER + 1,
78 GLS_MIMIC_GROUP_MIMIC_ACTIVE,
79 GLS_MIMIC_GROUP_BOTTOM_LEFT_CORNER,
80 GLS_MIMIC_GROUP_TOP_RIGHT_CORNER,
81 GLS_MIMIC_GROUP_SHOW_OUTLINE,
82 GLS_MIMIC_GROUP_TEXTURE_HEIGHT,
83 GLS_MIMIC_GROUP_TEXTURE_WIDTH,
84 GLS_MIMIC_GROUP_HAS_DEPTH_BUFFER,
85 GLS_MIMIC_GROUP_DEPTH_TEST,
86 GLS_MIMIC_GROUP_GENERATE_MIPMAPS,
87 GLS_MIMIC_GROUP_DRAW_MIMIC_POLYGON,
88 GLS_MIMIC_GROUP_ATTACHED_TEXTURE_INDEX,
89 GLS_MIMIC_GROUP_CLEAR_COLOR,
90 GLS_MIMIC_GROUP_USE_OPAQUE_TEXTURE,
91 GLS_MIMIC_GROUP_MIMIC_AUTO_REDRAW
92};
93
94/**
95* The GlsMimicGroup class provides a way to group objects that change
96* infrequently into a single textured polygon such that performance is increased due
97* to not having to render the objects every frame. Instead, since all of the objects
98* in the group are replaced with a single texture, performance is saved by updating the texture
99* ONLY through handling a display event of name "MimicGroupUpdate". Whenever an object
100* placed in this group is modified, you must write code to emit a "MimicGroupUpdate" ObjectEvent
101* so that any changes made to its appearance will be reflected in the rendered texture.
102*
103* For example:
104* EmitObjectEvent( objectThatChanged, "MimicGroupUpdate" );
105*
106* Picking and event handling for objects within the GlsMimicGroup work the same as
107* for a regular Group, so it can contain interactive objects such as buttons, switches, etc.
108* The GlsMimicGroup will only redraw the texture when it receives a "MimicGroupUpdate"
109* ObjectEvent so you must write code to emit these events whenever a
110* press, toggle, etc. affect the appearance of the object.
111*
112* The GlsMimicGroup can contain 2D or 3D objects. All of these objects will be replaced
113* with a 2D texture polygon so the GlsMimicGroup is best suited for use with panels that are mostly 2D.
114* The GlsMimicGroup can also be useful with a collection of 3D objects as long as the
115* GlsMimicGroup remains screen-aligned.
116*
117* On older hardware that does not support the render-to-texture capabilities required by the
118* GlsMimicGroup, the GlsMimicGroup will fall-back to rendering like a regular Group.
119*/
120 class GlsMimicGroup : public Group
121 , virtual public GlsPainter
122{
123 private:
124 GlsMimicGroup& operator=( const GlsMimicGroup& ) DISTI_SPECIAL_MEM_FUN_DELETE;
125 GlsMimicGroup( const GlsMimicGroup& ) DISTI_SPECIAL_MEM_FUN_DELETE;
126
127 public:
128 friend class GlsMimicGroupEditor;
129 DISTI_DEPRECATED( "This identifier is forbidden by the C++ standard. Use BaseClass instead." )
130 typedef Group _BaseClass; ///< Deprecated typedef for the base class.
131 typedef Group BaseClass; ///< Typedef for the base class.
132
133 /// Constructor
134 /// \param generateInstance Whether or not to generate an instance name for this mimic group.
135 GLSGEN_GLSMIMICGROUP_EXPORT GlsMimicGroup( bool generateInstance = false );
136
137 /// Copy constructor
138 /// \param that The object to copy from.
139 /// \param generateNames Whether or not to generate an instance name for this mimic group.
140 GLSGEN_GLSMIMICGROUP_EXPORT GlsMimicGroup( const GlsMimicGroup& that, const bool generateNames );
141
142 /**
143 * Destructs a GlsMimicGroup object
144 */
145 virtual GLSGEN_GLSMIMICGROUP_EXPORT ~GlsMimicGroup();
146
147 /// \return A pointer to a new GlsMimicGroup object.
148 static GLSGEN_GLSMIMICGROUP_EXPORT DisplayObject* CreateInstance();
149
150 virtual GLSGEN_GLSMIMICGROUP_EXPORT void SetAvailableAttributes( unsigned int value ) DISTI_METHOD_OVERRIDE;
151 virtual GLSGEN_GLSMIMICGROUP_EXPORT DisplayObject* CloneObject( bool generateNames = false ) DISTI_METHOD_OVERRIDE;
152 virtual GLSGEN_GLSMIMICGROUP_EXPORT void CopyProperties( DisplayObject* src ) DISTI_METHOD_OVERRIDE;
153
154#ifndef GLES
155 virtual GLSGEN_GLSMIMICGROUP_EXPORT InterfaceListType* GetCppInterfaceDescription( InterfaceListType* addToThisList = NULL ) DISTI_METHOD_OVERRIDE;
156 virtual GLSGEN_GLSMIMICGROUP_EXPORT void GetCppInterfaceDescriptionFree( InterfaceListType* array ) DISTI_METHOD_OVERRIDE;
157#endif
158
159 virtual GLSGEN_GLSMIMICGROUP_EXPORT void Draw() DISTI_METHOD_OVERRIDE;
160 virtual GLSGEN_GLSMIMICGROUP_EXPORT void SetValue( int spec, va_list& args ) DISTI_METHOD_OVERRIDE;
161
162 //////////////////////////////////////////////////
163 // GlsMimicGroup specific operations
164 //////////////////////////////////////////////////
165
166 /**
167 * Accessor for the mimic texture width.
168 *
169 * \return the width, in pixels, of the mimic texture.
170 */
171 virtual GLSGEN_GLSMIMICGROUP_EXPORT unsigned int TextureWidth() const { return _textureWidth; }
172
173 /**
174 * Set the mimic texture width.
175 *
176 * \param textureWidth the width, in pixels, of the mimic texture.
177 */
178 virtual GLSGEN_GLSMIMICGROUP_EXPORT void TextureWidth( unsigned int textureWidth );
179
180 /**
181 * Accessor for the mimic texture height.
182 *
183 * \return the height, in pixels, of the mimic texture.
184 */
185 virtual GLSGEN_GLSMIMICGROUP_EXPORT unsigned int TextureHeight() const { return _textureHeight; }
186
187 /**
188 * Set the mimic texture height.
189 *
190 * \param textureHeight the height, in pixels, of the mimic texture.
191 */
192 virtual GLSGEN_GLSMIMICGROUP_EXPORT void TextureHeight( unsigned int textureHeight );
193
194 /**
195 * Whether or not the mimic will render a depth buffer.
196 *
197 * \return true if the mimic will render a depth buffer.
198 */
199 virtual GLSGEN_GLSMIMICGROUP_EXPORT bool HasDepthBuffer() const { return _hasDepthBuffer; }
200
201 /**
202 * Set whether or not the mimic will render a depth buffer.
203 *
204 * \param hasDepthBuffer true if the mimic will render a depth buffer.
205 */
206 virtual GLSGEN_GLSMIMICGROUP_EXPORT void HasDepthBuffer( bool hasDepthBuffer );
207
208 /**
209 * Whether or not the mimic will generate mip maps.
210 *
211 * \return true if the mimic will generate mip maps.
212 */
213 virtual GLSGEN_GLSMIMICGROUP_EXPORT bool GenerateMipMaps() const { return _generateMipMaps; }
214
215 /**
216 * Set whether or not the mimic will generate mip maps.
217 *
218 * \param generate true if the mimic will generate mip maps.
219 */
220 virtual GLSGEN_GLSMIMICGROUP_EXPORT void GenerateMipMaps( bool generate );
221
222 /**
223 * Whether or not a mimic polygon will be drawn.
224 *
225 * \return true if a mimic polygon will be drawn.
226 */
227 virtual GLSGEN_GLSMIMICGROUP_EXPORT bool DrawMimicGroupPolygon() const { return _drawMimicGroupPolygon; }
228
229 /**
230 * Set whether or not a mimic polygon will be drawn.
231 *
232 * \param draw true if a mimic polygon will be drawn.
233 */
234 virtual GLSGEN_GLSMIMICGROUP_EXPORT void DrawMimicGroupPolygon( bool draw );
235
236 /**
237 * Accessor for the mimic depth test settings.
238 *
239 * \return the depth settings
240 */
241 virtual GLSGEN_GLSMIMICGROUP_EXPORT unsigned char MimicGroupDepthTest() const { return _mimicGroupDepthTest; }
242
243 /**
244 * Set the mimic depth test settings.
245 *
246 * \param depthSettings the depth settings
247 */
248 virtual GLSGEN_GLSMIMICGROUP_EXPORT void MimicGroupDepthTest( unsigned char depthSettings );
249
250 /**
251 * Accessor for the mimic auto-redraw for conditional rendering settings.
252 *
253 * \return the depth settings
254 */
255 virtual GLSGEN_GLSMIMICGROUP_EXPORT bool AutoRedraw() const { return _autoRedraw; }
256
257 /**
258 * Set the mimic auto-redraw for conditional rendering.
259 *
260 * \param autoRedrawSetting the enable to automatically update.
261 */
262 virtual GLSGEN_GLSMIMICGROUP_EXPORT void AutoRedraw( bool autoRedrawSetting );
263
264 /**
265 * Accessor for the mimic scene background clear color.
266 *
267 * \return the RGBA color that the mimic will use to clear mimic scene background with
268 */
269 virtual GLSGEN_GLSMIMICGROUP_EXPORT GlsColor ClearColor() const { return _clearColor; }
270
271 /**
272 * Set the mimic scene background clear color.
273 *
274 * \param color the RGBA color that the mimic will use to clear mimic scene background with
275 */
276 virtual GLSGEN_GLSMIMICGROUP_EXPORT void ClearColor( const GlsColor& color );
277
278 /**
279 * Accessor for the GL Studio texture index the mimic will generate into.
280 *
281 * \return the GL Studio texture index the mimic will generate into. If -1, then mimic will generate its own texture.
282 */
283 virtual GLSGEN_GLSMIMICGROUP_EXPORT int AttachedTextureIndex() const { return _attachedTextureIndex; }
284
285 /**
286 * Set the GL Studio texture index the mimic will generate into.
287 *
288 * \param textureIndex the GL Studio texture index to generate mimic into. If -1, then mimic will generate its own texture.
289 */
290 virtual GLSGEN_GLSMIMICGROUP_EXPORT void AttachedTextureIndex( int textureIndex );
291
292 /**
293 * Whether or not the mimic is active for this group.
294 * If not active, mimic group behaves as a normal group
295 *
296 * \return true if mimic is active for this group
297 */
298 GLSGEN_GLSMIMICGROUP_EXPORT bool MimicGroupActive() { return _mimicGroupActive; }
299
300 /**
301 * Sets if mimic is active for this group
302 * If not active, mimic group behaves as a normal group
303 *
304 * \param activate whether or not to activate the mimic
305 */
306 GLSGEN_GLSMIMICGROUP_EXPORT void MimicGroupActive( bool activate );
307
308 /**
309 * Set the bottom left corner of mimic scene region
310 *
311 * \param bottomLeftCorner (in object coordinates)
312 */
313 GLSGEN_GLSMIMICGROUP_EXPORT void BottomLeftCorner( const Vector& bottomLeftCorner );
314
315 /**
316 * Accessor for the bottom left corner coordinate of the mimic scene region.
317 *
318 * \return the bottom left corner of mimic scene region (in object coordinates)
319 */
320 GLSGEN_GLSMIMICGROUP_EXPORT Vector BottomLeftCorner() { return _bottomLeftCorner; }
321
322 /**
323 * Set the top right corner of mimic scene region
324 *
325 * \param topRightCorner (in object coordinates)
326 */
327 GLSGEN_GLSMIMICGROUP_EXPORT void TopRightCorner( const Vector& topRightCorner );
328
329 /**
330 * Accessor for the top right corner coordinate of the mimic scene region.
331 *
332 * \return the top right corner of mimic scene region (in object coordinates)
333 */
334 GLSGEN_GLSMIMICGROUP_EXPORT Vector TopRightCorner() const { return _topRightCorner; }
335
336 /**
337 * Whether or not the outline of the mimic polygon region should be shown in the editor.
338 *
339 * \return true if region should always be drawn in the editor
340 */
341 GLSGEN_GLSMIMICGROUP_EXPORT bool ShowOutline() const { return _showOutline; }
342
343 /**
344 * Set whether or not the mimic polygon region should always be drawn in the editor.
345 *
346 * \param showOutline true if outline should always be drawn in editor
347 */
348 GLSGEN_GLSMIMICGROUP_EXPORT void ShowOutline( bool showOutline );
349
350 /**
351 * Whether or not the mimic group needs to redraw.
352 *
353 * \return true if the mimic group needs to redraw.
354 */
355 GLSGEN_GLSMIMICGROUP_EXPORT bool Redraw() const { return _redraw; }
356
357 /**
358 * Set whether or not the mimic group needs to redraw
359 *
360 * \param redraw the new redraw value
361 */
362 GLSGEN_GLSMIMICGROUP_EXPORT void Redraw( bool redraw );
363
364 /**
365 * Whether or not the mimic group texture is RGB.
366 *
367 * \return true if the mimic group texture is RGB.
368 */
369 GLSGEN_GLSMIMICGROUP_EXPORT bool UseOpaqueTexture() const { return _useOpaqueTexture; }
370
371 /**
372 * Set whether the mimic group texture is RGB or RGBA
373 *
374 * \param opaque true for RGB, false for RGBA
375 */
376 GLSGEN_GLSMIMICGROUP_EXPORT void UseOpaqueTexture( bool opaque );
377
378 GLSGEN_GLSMIMICGROUP_EXPORT void SetPainter( GlsPainter* painter ) DISTI_METHOD_OVERRIDE;
379
380 virtual GLSGEN_GLSMIMICGROUP_EXPORT void InsertObject( DisplayObject* obj, bool reparent = true, bool recalculateBoundingbox = true, int loc = -1 ) DISTI_METHOD_OVERRIDE;
381 virtual GLSGEN_GLSMIMICGROUP_EXPORT void PushObject( DisplayObject* obj ) DISTI_METHOD_OVERRIDE;
382
383 GLSGEN_GLSMIMICGROUP_EXPORT void Invalidate() DISTI_METHOD_OVERRIDE;
384 GLSGEN_GLSMIMICGROUP_EXPORT bool IsInvalidated() const DISTI_METHOD_OVERRIDE;
385
386protected:
387 /**
388 * Set up the matrices for the root of the mimic scene. The mimic scene is drawn without regard to any
389 * parent matrices of the mimic group.
390 */
391 virtual GLSGEN_GLSMIMICGROUP_EXPORT void SetMatrices();
392
393 /// Predraw case for when the mimic scene redraws.
394 /// \note Not normally called by users.
395 /// \param parentMatrices The parent draw matrices for this object (as passed into PreDraw).
396 /// \param culler The culler state for this object (as passed into PreDraw).
397 virtual GLSGEN_GLSMIMICGROUP_EXPORT void PreDrawMimicGroupChildren( const OpenGLMatrices& parentMatrices, Culler& culler );
398
399 /**
400 * Set depth buffer settings when rendering the mimic polygon
401 */
402 GLSGEN_GLSMIMICGROUP_EXPORT void SetupMimicGroupDepthTest();
403
404 /**
405 * Get the four corners of the region transformed by the current DCS and offset by the group's location
406 *
407 * \param topLeftCorner [out] receives top left corner
408 * \param topRightCorner [out] receives top right corner
409 * \param bottomRightCorner [out] receives bottom right corner
410 * \param bottomLeftCorner [out] receives bottom left corner
411 */
412 GLSGEN_GLSMIMICGROUP_EXPORT void GetRegionCorners( Vector& topLeftCorner, Vector& topRightCorner, Vector& bottomRightCorner, Vector& bottomLeftCorner );
413
414 /**
415 * Apply texture settings for mimic polygon
416 */
417 GLSGEN_GLSMIMICGROUP_EXPORT void ApplyMimicGroupTextureSettings();
418
419 /**
420 * Allocate and create the diffuse texture map
421 */
422 GLSGEN_GLSMIMICGROUP_EXPORT void CreateDiffuseTexture();
423
424 /**
425 * Allocate and create the depth texture map
426 */
427 GLSGEN_GLSMIMICGROUP_EXPORT void CreateDepthTexture();
428
429 /// Allocate and create the mimic quad.
430 GLSGEN_GLSMIMICGROUP_EXPORT void CreateMimicGroupQuad();
431
432 /// Update the vertices of the mimic quad.
433 GLSGEN_GLSMIMICGROUP_EXPORT void UpdateMimicGroupQuad();
434
435 /// Delete the mimic quad (if it has been allocated).
436 GLSGEN_GLSMIMICGROUP_EXPORT void DeleteMimicGroupQuad();
437
438 /**
439 * Allocate and create the frame buffer
440 */
441 GLSGEN_GLSMIMICGROUP_EXPORT void CreateFrameBuffer();
442
443 /**
444 * Delete the frame buffer (if it has been bound)
445 */
446 GLSGEN_GLSMIMICGROUP_EXPORT void DeleteFrameBuffer();
447
448 /**
449 * Redraw the scene
450 */
451 GLSGEN_GLSMIMICGROUP_EXPORT void RedrawScene();
452
453 /**
454 * Draw the polygon for the mimic
455 */
456 GLSGEN_GLSMIMICGROUP_EXPORT void DrawPolygon();
457
458 /**
459 * Regenerate the mip maps
460 */
461 GLSGEN_GLSMIMICGROUP_EXPORT void RegenerateMipMaps();
462
463 GLSGEN_GLSMIMICGROUP_EXPORT DisplayObject* handle( DisplayEvent* displayEvent ) DISTI_METHOD_OVERRIDE;
464
465 /**
466 * The GlsMimicGroup requres specific extensions of OpenGL which are not required
467 * elsewhere in GL Studio. This method will check that those features are supported.
468 *
469 * \return True if the required features are supported.
470 */
471 GLSGEN_GLSMIMICGROUP_EXPORT bool RequiredGlFeaturesSupported();
472
473 /**
474 * Logs the unsupported features that the GlsMimicGroup class requires to function properly.
475 */
476 GLSGEN_GLSMIMICGROUP_EXPORT void LogUnsupportedFeatures();
477
478 /**
479 * Determines if vertex buffer objects are supported on this platform.
480 *
481 * \return True if vertex buffer objects are supported on this platform.
482 */
483 GLSGEN_GLSMIMICGROUP_EXPORT bool VertexBuffersAreSupported();
484
485 /**
486 * Draw the mimic group. Care should be taken to call this method only when it is safe to draw
487 * the mimic group. The Draw() has the conditional structure necessary to
488 * make this decision.
489 *
490 */
491 GLSGEN_GLSMIMICGROUP_EXPORT void DrawMimicGroup();
492
493#ifdef GLES
494 /**
495 * Set a single attribute from the GLO file.
496 *
497 * \param data The attribute to set and its associated data.
498 */
499 virtual GLSGEN_GLSMIMICGROUP_EXPORT void SetFromGloData( GlsGloFileAttribute& data ) DISTI_METHOD_OVERRIDE;
500#endif
501
502 bool _mimicGroupActive; ///< Whether or not the mimic is active. If not active, mimic group behaves as a normal group.
503 bool _autoRedraw; ///< Whether or not the mimic group should automatically update via conditional rendering.
504 bool _redraw; ///< Whether or not the mimic scene needs to redraw.
505 bool _hasDepthBuffer; ///< Whether or not the mimic will render a depth buffer.
506 bool _generateMipMaps; ///< Whether or not the mimic will generate mip maps.
507 bool _showOutline; ///< Outline is only visible in editor.
508 bool _drawMimicGroupPolygon; ///< Whether or not a mimic polygon will be drawn.
509 unsigned char _mimicGroupDepthTest; ///< Mimic depth test settings (affects whether or not the mimic polygon is depth tested).
510 bool _textureIndexChanged; ///< Unused, kept for backward compatibility.
511 GlsColor _clearColor; ///< RGBA color to clear mimic scene background with.
512 Vector _bottomLeftCorner; ///< Bottom Left Corner of the mimic scene region.
513 Vector _topRightCorner; ///< Top Right Corner of the mimic scene region.
514 int _attachedTextureIndex; ///< GL Studio texture index to generate mimic into. If -1, then mimic will generate its own texture.
515 unsigned int _textureWidth; ///< Width of the mimic texture in pixels.
516 unsigned int _textureHeight; ///< Height of the mimic texture in pixels.
517 unsigned int _frameBufferHandle; ///< Handle for frame buffer object.
518 unsigned int _depthBufferHandle; ///< Handle for depth buffer object.
519 Image* _mimicGroupTexture; ///< Image object for texture.
520 unsigned int _vertexBufferHandle; ///< Vertex buffer handle for mimic quad.
521 bool _frameBuffersEnabledAndAttached; ///< True when frame buffer support is detected and frame buffers were attached successfully.
522 bool _useOpaqueTexture; ///< True if the atached frame buffer texture should be crated as GL_RGB, False will create the texture as GL_RGBA.
523
524 static bool _unsupportedLogged; ///< True if a warning has been logged to users that the mimic group feature is not supported. This keeps us from spamming the user about not being supported.
525};
526
527} // namespace disti
528
529#endif
disti::Culler
Definition: cull.h:50
disti::DisplayEvent
Definition: events.h:113
disti::DisplayObject
Definition: display.h:96
disti::DynamicArray
Definition: dynamic_array.h:79
disti::GlsColor
Definition: gls_color.h:54
disti::GlsGloFileAttribute
Definition: gls_glo_file.h:1243
disti::GlsMimicGroup
Definition: gls_mimic_group.h:122
disti::GlsMimicGroup::_frameBuffersEnabledAndAttached
bool _frameBuffersEnabledAndAttached
True when frame buffer support is detected and frame buffers were attached successfully.
Definition: gls_mimic_group.h:521
disti::GlsMimicGroup::TextureHeight
virtual void TextureHeight(unsigned int textureHeight)
disti::GlsMimicGroup::SetAvailableAttributes
virtual void SetAvailableAttributes(unsigned int value) DISTI_METHOD_OVERRIDE
disti::GlsMimicGroup::_textureHeight
unsigned int _textureHeight
Height of the mimic texture in pixels.
Definition: gls_mimic_group.h:516
disti::GlsMimicGroup::RequiredGlFeaturesSupported
bool RequiredGlFeaturesSupported()
disti::GlsMimicGroup::Draw
virtual void Draw() DISTI_METHOD_OVERRIDE
disti::GlsMimicGroup::UseOpaqueTexture
void UseOpaqueTexture(bool opaque)
disti::GlsMimicGroup::ApplyMimicGroupTextureSettings
void ApplyMimicGroupTextureSettings()
disti::GlsMimicGroup::ShowOutline
bool ShowOutline() const
Definition: gls_mimic_group.h:341
disti::GlsMimicGroup::_depthBufferHandle
unsigned int _depthBufferHandle
Handle for depth buffer object.
Definition: gls_mimic_group.h:518
disti::GlsMimicGroup::_showOutline
bool _showOutline
Outline is only visible in editor.
Definition: gls_mimic_group.h:507
disti::GlsMimicGroup::_hasDepthBuffer
bool _hasDepthBuffer
Whether or not the mimic will render a depth buffer.
Definition: gls_mimic_group.h:505
disti::GlsMimicGroup::GenerateMipMaps
virtual void GenerateMipMaps(bool generate)
disti::GlsMimicGroup::ShowOutline
void ShowOutline(bool showOutline)
disti::GlsMimicGroup::MimicGroupDepthTest
virtual unsigned char MimicGroupDepthTest() const
Definition: gls_mimic_group.h:241
disti::GlsMimicGroup::AttachedTextureIndex
virtual void AttachedTextureIndex(int textureIndex)
disti::GlsMimicGroup::CloneObject
virtual DisplayObject * CloneObject(bool generateNames=false) DISTI_METHOD_OVERRIDE
disti::GlsMimicGroup::ClearColor
virtual void ClearColor(const GlsColor &color)
disti::GlsMimicGroup::DrawMimicGroupPolygon
virtual void DrawMimicGroupPolygon(bool draw)
disti::GlsMimicGroup::DrawPolygon
void DrawPolygon()
disti::GlsMimicGroup::AutoRedraw
virtual void AutoRedraw(bool autoRedrawSetting)
disti::GlsMimicGroup::ClearColor
virtual GlsColor ClearColor() const
Definition: gls_mimic_group.h:269
disti::GlsMimicGroup::SetFromGloData
virtual void SetFromGloData(GlsGloFileAttribute &data) DISTI_METHOD_OVERRIDE
disti::GlsMimicGroup::_redraw
bool _redraw
Whether or not the mimic scene needs to redraw.
Definition: gls_mimic_group.h:504
disti::GlsMimicGroup::TextureWidth
virtual void TextureWidth(unsigned int textureWidth)
disti::GlsMimicGroup::handle
DisplayObject * handle(DisplayEvent *displayEvent) DISTI_METHOD_OVERRIDE
disti::GlsMimicGroup::_generateMipMaps
bool _generateMipMaps
Whether or not the mimic will generate mip maps.
Definition: gls_mimic_group.h:506
disti::GlsMimicGroup::Redraw
void Redraw(bool redraw)
disti::GlsMimicGroup::_frameBufferHandle
unsigned int _frameBufferHandle
Handle for frame buffer object.
Definition: gls_mimic_group.h:517
disti::GlsMimicGroup::_topRightCorner
Vector _topRightCorner
Top Right Corner of the mimic scene region.
Definition: gls_mimic_group.h:513
disti::GlsMimicGroup::_mimicGroupActive
bool _mimicGroupActive
Whether or not the mimic is active. If not active, mimic group behaves as a normal group.
Definition: gls_mimic_group.h:502
disti::GlsMimicGroup::GetRegionCorners
void GetRegionCorners(Vector &topLeftCorner, Vector &topRightCorner, Vector &bottomRightCorner, Vector &bottomLeftCorner)
disti::GlsMimicGroup::TextureWidth
virtual unsigned int TextureWidth() const
Definition: gls_mimic_group.h:171
disti::GlsMimicGroup::TopRightCorner
Vector TopRightCorner() const
Definition: gls_mimic_group.h:334
disti::GlsMimicGroup::SetValue
virtual void SetValue(int spec, va_list &args) DISTI_METHOD_OVERRIDE
disti::GlsMimicGroup::_textureIndexChanged
bool _textureIndexChanged
Unused, kept for backward compatibility.
Definition: gls_mimic_group.h:510
disti::GlsMimicGroup::PreDrawMimicGroupChildren
virtual void PreDrawMimicGroupChildren(const OpenGLMatrices &parentMatrices, Culler &culler)
disti::GlsMimicGroup::DeleteMimicGroupQuad
void DeleteMimicGroupQuad()
Delete the mimic quad (if it has been allocated).
disti::GlsMimicGroup::SetMatrices
virtual void SetMatrices()
disti::GlsMimicGroup::_attachedTextureIndex
int _attachedTextureIndex
GL Studio texture index to generate mimic into. If -1, then mimic will generate its own texture.
Definition: gls_mimic_group.h:514
disti::GlsMimicGroup::RedrawScene
void RedrawScene()
disti::GlsMimicGroup::CreateDiffuseTexture
void CreateDiffuseTexture()
disti::GlsMimicGroup::HasDepthBuffer
virtual void HasDepthBuffer(bool hasDepthBuffer)
disti::GlsMimicGroup::Redraw
bool Redraw() const
Definition: gls_mimic_group.h:355
disti::GlsMimicGroup::LogUnsupportedFeatures
void LogUnsupportedFeatures()
disti::GlsMimicGroup::UseOpaqueTexture
bool UseOpaqueTexture() const
Definition: gls_mimic_group.h:369
disti::GlsMimicGroup::AttachedTextureIndex
virtual int AttachedTextureIndex() const
Definition: gls_mimic_group.h:283
disti::GlsMimicGroup::_clearColor
GlsColor _clearColor
RGBA color to clear mimic scene background with.
Definition: gls_mimic_group.h:511
disti::GlsMimicGroup::UpdateMimicGroupQuad
void UpdateMimicGroupQuad()
Update the vertices of the mimic quad.
disti::GlsMimicGroup::_mimicGroupDepthTest
unsigned char _mimicGroupDepthTest
Mimic depth test settings (affects whether or not the mimic polygon is depth tested).
Definition: gls_mimic_group.h:509
disti::GlsMimicGroup::MimicGroupActive
void MimicGroupActive(bool activate)
disti::GlsMimicGroup::CreateDepthTexture
void CreateDepthTexture()
disti::GlsMimicGroup::InsertObject
virtual void InsertObject(DisplayObject *obj, bool reparent=true, bool recalculateBoundingbox=true, int loc=-1) DISTI_METHOD_OVERRIDE
disti::GlsMimicGroup::SetupMimicGroupDepthTest
void SetupMimicGroupDepthTest()
disti::GlsMimicGroup::CreateInstance
static DisplayObject * CreateInstance()
disti::GlsMimicGroup::Invalidate
void Invalidate() DISTI_METHOD_OVERRIDE
Notify the painter that the scene needs to be redrawn.
disti::GlsMimicGroup::GenerateMipMaps
virtual bool GenerateMipMaps() const
Definition: gls_mimic_group.h:213
disti::GlsMimicGroup::IsInvalidated
bool IsInvalidated() const DISTI_METHOD_OVERRIDE
disti::GlsMimicGroup::DrawMimicGroup
void DrawMimicGroup()
disti::GlsMimicGroup::_bottomLeftCorner
Vector _bottomLeftCorner
Bottom Left Corner of the mimic scene region.
Definition: gls_mimic_group.h:512
disti::GlsMimicGroup::CreateFrameBuffer
void CreateFrameBuffer()
disti::GlsMimicGroup::MimicGroupActive
bool MimicGroupActive()
Definition: gls_mimic_group.h:298
disti::GlsMimicGroup::SetPainter
void SetPainter(GlsPainter *painter) DISTI_METHOD_OVERRIDE
disti::GlsMimicGroup::DeleteFrameBuffer
void DeleteFrameBuffer()
disti::GlsMimicGroup::_drawMimicGroupPolygon
bool _drawMimicGroupPolygon
Whether or not a mimic polygon will be drawn.
Definition: gls_mimic_group.h:508
disti::GlsMimicGroup::HasDepthBuffer
virtual bool HasDepthBuffer() const
Definition: gls_mimic_group.h:199
disti::GlsMimicGroup::CopyProperties
virtual void CopyProperties(DisplayObject *src) DISTI_METHOD_OVERRIDE
disti::GlsMimicGroup::BottomLeftCorner
void BottomLeftCorner(const Vector &bottomLeftCorner)
disti::GlsMimicGroup::PushObject
virtual void PushObject(DisplayObject *obj) DISTI_METHOD_OVERRIDE
disti::GlsMimicGroup::_autoRedraw
bool _autoRedraw
Whether or not the mimic group should automatically update via conditional rendering.
Definition: gls_mimic_group.h:503
disti::GlsMimicGroup::_mimicGroupTexture
Image * _mimicGroupTexture
Image object for texture.
Definition: gls_mimic_group.h:519
disti::GlsMimicGroup::TextureHeight
virtual unsigned int TextureHeight() const
Definition: gls_mimic_group.h:185
disti::GlsMimicGroup::_useOpaqueTexture
bool _useOpaqueTexture
True if the atached frame buffer texture should be crated as GL_RGB, False will create the texture as...
Definition: gls_mimic_group.h:522
disti::GlsMimicGroup::DrawMimicGroupPolygon
virtual bool DrawMimicGroupPolygon() const
Definition: gls_mimic_group.h:227
disti::GlsMimicGroup::CreateMimicGroupQuad
void CreateMimicGroupQuad()
Allocate and create the mimic quad.
disti::GlsMimicGroup::MimicGroupDepthTest
virtual void MimicGroupDepthTest(unsigned char depthSettings)
disti::GlsMimicGroup::_vertexBufferHandle
unsigned int _vertexBufferHandle
Vertex buffer handle for mimic quad.
Definition: gls_mimic_group.h:520
disti::GlsMimicGroup::_unsupportedLogged
static bool _unsupportedLogged
True if a warning has been logged to users that the mimic group feature is not supported....
Definition: gls_mimic_group.h:524
disti::GlsMimicGroup::TopRightCorner
void TopRightCorner(const Vector &topRightCorner)
disti::GlsMimicGroup::VertexBuffersAreSupported
bool VertexBuffersAreSupported()
disti::GlsMimicGroup::RegenerateMipMaps
void RegenerateMipMaps()
disti::GlsMimicGroup::AutoRedraw
virtual bool AutoRedraw() const
Definition: gls_mimic_group.h:255
disti::GlsMimicGroup::_textureWidth
unsigned int _textureWidth
Width of the mimic texture in pixels.
Definition: gls_mimic_group.h:515
disti::GlsMimicGroup::BottomLeftCorner
Vector BottomLeftCorner()
Definition: gls_mimic_group.h:320
disti::GlsPainter
Definition: gls_painter.h:51
disti::Group
Definition: group.h:53
disti::Image
Definition: image.h:178
disti::OpenGLMatrices
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:544
disti::VertexNoColor
Definition: vertex.h:85
frame_buffer_utility.h
Utility for common frame buffer support.
gls_auto_lib.h
The gls_auto_lib.
gls_cpp_lang_support.h
Macros and helper code to determine what subset of C++11/14/17 is available.
DISTI_SPECIAL_MEM_FUN_DELETE
#define DISTI_SPECIAL_MEM_FUN_DELETE
Macro to wrap function deletion, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:246
DISTI_DEPRECATED
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:488
DISTI_METHOD_OVERRIDE
#define DISTI_METHOD_OVERRIDE
Macro to wrap the override keyword, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:222
GLSGEN_GLSMIMICGROUP_EXPORT
#define GLSGEN_GLSMIMICGROUP_EXPORT
Provides support for creating DLLs.
Definition: gls_mimic_group.h:59
group.h
The disti::Group class. Implements groups of objects.
image.h
The Image class. All textures are converted internally into Images.
disti
Definition: bmpimage.h:47