GL Studio C++ Runtime API
glsDisplayFrame Class Reference

#include <gls_display_frame.h>

Inheritance diagram for glsDisplayFrame:
RuntimeDisplayFrame DisplayFrame GlsPainter AttributeChangedNotifier WeakReferenceableMixin WeakReferenceable

Public Member Functions

 glsDisplayFrame (const char *name, int width, int height)
 
virtual void RemoveSplash ()
 
virtual void CreateSplash ()
 
virtual void Create ()
 
virtual void SetProjection ()
 
bool FrameAnimate () override
 
void Paint () override
 
virtual void Redraw ()
 
void SetRedraw () override
 
virtual void SetWindowDimensions (int X, int Y, int W, int H)
 
virtual void GetWindowDimensions (int &X, int &Y, int &W, int &H)
 
virtual void PostDrawCallback (GlsDrawCallback cb)
 
virtual void PreDrawCallback (GlsDrawCallback cb)
 
virtual void WindowFlags (unsigned long flags)
 
virtual bool PostHandle (bool handled, DisplayEvent *ev)
 
virtual void CenterOnLogical (float lx, float ly)
 
virtual bool SKeyTogglesStatistics ()
 
virtual void SKeyTogglesStatistics (bool flag)
 
virtual bool EscKeyExits ()
 
virtual void EscKeyExits (bool flag)
 
- Public Member Functions inherited from RuntimeDisplayFrame
 RuntimeDisplayFrame (const char *name, int width, int height)
 
virtual ~RuntimeDisplayFrame ()
 
virtual void Clear ()
 
virtual GlsEyePointCurrentEyePoint ()
 
virtual void CurrentEyePoint (GlsEyePoint *eye)
 
virtual void Scale (float scale)
 
virtual float Scale () override
 
virtual DisplayObjecthandle (DisplayEvent *ev)
 
virtual void BackgroundColor (unsigned char r, unsigned char g, unsigned char b, unsigned char a)
 
virtual void GetBackgroundColor (unsigned char &r, unsigned char &g, unsigned char &b, unsigned char &a)
 
virtual void BackgroundColor (const GlsColor &color)
 
const char * Name ()
 
void Name (char *name)
 
virtual GlsColor BackgroundColor ()
 
virtual int FrameInterval ()
 
virtual void FrameInterval (int interval)
 
virtual StatisticsStats ()
 
virtual void RecordCalculateStart ()
 
virtual void RecordCalculateEnd ()
 
virtual void ClearDragAndFocus () override
 
virtual bool UpdateAnimate ()
 
virtual bool FrameAnimate ()
 
virtual void WaitForNextFrame ()
 
virtual void Paint ()
 
virtual void WidthOffset (float offset)
 
virtual float WidthOffset ()
 
virtual void HeightOffset (float offset)
 
virtual float HeightOffset ()
 
virtual void DepthFactor (float factor)
 
virtual float DepthFactor ()
 
virtual void FOV (double fov)
 
virtual double FOV ()
 
virtual void CurrentView (const int view)
 
virtual int CurrentView () const
 
void Invalidate () override
 Notify the painter that the scene needs to be redrawn. More...
 
bool IsInvalidated () const override
 
- Public Member Functions inherited from DisplayFrame
 DisplayFrame (int width, int height, bool allocateObjects=true)
 
void ClearBitfield (GLbitfield bitField)
 
GLbitfield ClearBitfield ()
 
virtual void DragObject (DisplayObject *obj)
 
virtual DisplayObjectDragObject ()
 
virtual void ClearDrag ()
 
virtual void FocusObject (DisplayObject *obj)
 
virtual DisplayObjectFocusObject ()
 
virtual void ClearFocus ()
 
virtual void MultitouchEnabled (bool enabled)
 
virtual bool MultitouchEnabled ()
 
virtual InputHandlerGetInputHandler ()
 
virtual DisplayObjectHandleDisplayEvent (DisplayEvent *ev)
 
virtual void WriteResources (const char *filename, GlsResourceFilter *filter=NULL)
 
virtual void ReadResources (const char *filename)
 
virtual DistiAttributeBaseResource (const char *name)
 
virtual void GetResources (std::ostream &outstr, GlsResourceFilter *filter=NULL)
 
virtual void SetResources (std::istream &instr)
 
void SetResource (const std::string &resourceName, const std::string &resourceVal)
 
void SetResource (const char *resourceName, const char *resourceVal)
 
std::string GetResource (const std::string &resourceName)
 
std::string GetResource (const char *resourceName)
 
virtual char * GetResource_CRTClean (const char *name)
 
virtual void GetResourceFree_CRTClean (char *memoryToFree)
 
virtual char * GetResources_CRTClean (GlsResourceFilter *filter)
 
virtual void GetResourcesFree_CRTClean (char *memoryToFree)
 
virtual void SetResource_CRTClean (const char *name, const char *value)
 
virtual void SetResources_CRTClean (const char *buf)
 
virtual void NotifyAttributeChanged (const AttributeName &name) override
 
virtual InterfaceListTypeGetCppInterfaceDescription (InterfaceListType *addToThisList=NULL)
 
virtual void GetCppInterfaceDescriptionFree (InterfaceListType *array)
 
void SetTexturePaletteSize (int cnt)
 
void Draw ()
 
void InsertObject (DisplayObject *obj, bool reparent=true, bool recalculateBoundingbox=true, int loc=-1)
 
void InsertObject (DisplayObject *obj, int loc)
 
void PushObject (DisplayObject *obj)
 
int Width ()
 
int Height ()
 
void SetWidth (int w)
 
void SetHeight (int h)
 
virtual void SetRedraw ()
 
bool CullingEnabled ()
 
void CullingEnabled (const bool enabled)
 
DistiAttribDictFrameAttribDict ()
 
const DistiAttribDictFrameAttribDict () const
 
DynamicMaterialArrayMaterialPalette ()
 
ComponentLightMgrLightMgr ()
 
void LightMgr (ComponentLightMgr *val)
 
virtual void ClearDragAndFocus ()
 
- Public Member Functions inherited from AttributeChangedNotifier
virtual void NotifyAttributeChanged (const AttributeName &name)=0
 
virtual ~AttributeChangedNotifier ()
 
- Public Member Functions inherited from WeakReferenceableMixin
void AddWeakReference (WeakReference *weakRef) override
 
void NotifyWeakReferenceDestroyed (WeakReference *ref) override
 
virtual void AddWeakReference (WeakReference *weakRef)=0
 
virtual void NotifyWeakReferenceDestroyed (WeakReference *weakReference)=0
 
virtual void Invalidate ()=0
 Notify the painter that the scene needs to be redrawn. More...
 
virtual bool IsInvalidated () const =0
 

Public Attributes

OpenGLWindowtheWindow
 
EventCompressor< DisplayFrameeventCompressor
 
- Public Attributes inherited from RuntimeDisplayFrame
GlsColor _backgroundColor
 
- Public Attributes inherited from DisplayFrame
TexturePalettetexturePalette
 
SoundSystem_sound_player
 
Groupobjects
 

Protected Member Functions

virtual EventCompressor< DisplayFrame > * GetEventCompressor () override
 
- Protected Member Functions inherited from DisplayFrame
virtual void CurrentCursor (unsigned int cursor_id)
 
void CleanupDragMap ()
 
DisplayObjectGetDragObjectForCursor (unsigned int cursorID)
 
DisplayObjectFindDragObject ()
 
virtual EventCompressor< DisplayFrame > * GetEventCompressor ()
 
virtual float Scale ()
 
- Protected Member Functions inherited from WeakReferenceableMixin
 WeakReferenceableMixin ()
 
virtual ~WeakReferenceableMixin ()
 

Protected Attributes

GlsDrawCallback _preDrawCallback
 
GlsDrawCallback _postDrawCallback
 
SplashDisplaysplashDisplay
 
bool _sKeyTogglesStatistics
 
bool _escKeyExits
 
- Protected Attributes inherited from RuntimeDisplayFrame
Timer _frameTimer
 Timer used for scheduling.
 
TimerframeTimer
 For backwards compatibility.
 
float _smoothedFrameDelay
 Frame interval, smoothed based on actual draw performance.
 
float _width_offset
 For better control over clipping and field of view, use a GlsEyePoint, but some limited functionality is available here. More...
 
float _height_offset
 Current "height" offset of window. Used for panning of display vertically in ortho mode.
 
Vector _viewOffset
 Additional offset to apply to the modelview matrix.
 
float _depthFactor
 Used for auto calculations.
 
double _fov
 Field Of View. If 0.0 (the default), fov will be auto calculated.
 
double _nearZ
 Near clipping plane. Only meaningful if _autoCalcNearZ is false.
 
bool _autoCalcNearZ
 When true a _nearZ is automatically calculated.
 
double _farZ
 Far clipping plane. Only meaningfull if _autoCalcVarZ is false.
 
bool _autoCalcFarZ
 When true a _farZ is automatically calculated.
 
int _current_view
 Current view of the canvas (e.g., ortho, perspective, eyepoint).
 
std::string _name
 The title of this display frame's window, if applicable.
 
float _scale
 Scale of the window.
 
unsigned int frameInterval
 The frame interval in microSeconds (inverse of frame rate).
 
GlsEyePoint_currentEyePoint
 The current eyepoint for viewing the scene.
 
bool _redraw
 Flag indicating if the window should be redrawn.
 
- Protected Attributes inherited from DisplayFrame
bool _cullingEnabled
 
int _width
 
int _height
 
float _lastPickedDepth
 
DynamicMaterialArray _materialPalette
 
ComponentLightMgr_lightMgr
 
GLbitfield _clearBitfield
 
std::string _componentHeaderFileName
 
DragObjectMap * _dragObjectMap
 Holds a focus object for each cursor.
 
unsigned int _currentCursor
 
bool _multitouchEnabled
 
unsigned int _cursorsDown
 
- Protected Attributes inherited from WeakReferenceableMixin
DynamicArray< WeakReference * > * _weakRefs
 

Additional Inherited Members

- Static Public Member Functions inherited from DisplayFrame
static void SetOpenGLDefaultState (bool saveVal)
 
static void RestoreOpenGLState ()
 

Detailed Description

GL Studio standalone application class. Creates one window and draws all contents in it.

Constructor & Destructor Documentation

◆ glsDisplayFrame()

glsDisplayFrame ( const char *  name,
int  width,
int  height 
)

Creates this glsDisplayFrame

Parameters
nameWindow Title
widthWidth of Dsplay Frame in pixels
heightWidth of Dsplay Frame in pixels

Member Function Documentation

◆ CenterOnLogical()

virtual void CenterOnLogical ( float  lx,
float  ly 
)
virtual

Causes the window to center the view on the specified logical coordinate.
It takes into account the possible rotation of the top group.

Parameters
lxLogical X Coordinate
lyLogical Y Coordinate

◆ Create()

virtual void Create ( )
virtual

Creates this display frame. Called after the constructor so that things that need to access the OpenGL context can safely do so

◆ CreateSplash()

virtual void CreateSplash ( )
virtual

Creates the spash screen

◆ EscKeyExits() [1/2]

virtual bool EscKeyExits ( )
virtual
Returns
Whether or not the ESC key exits application

◆ EscKeyExits() [2/2]

virtual void EscKeyExits ( bool  flag)
virtual

Enable/disable ESC key for exiting application

Parameters
flagWhether or not ESC key exits application

◆ FrameAnimate()

bool FrameAnimate ( )
overridevirtual
See also
RuntimeDisplayFrame
Note
Overridden to return true if any window is open.
Returns
True if any window is open.

Reimplemented from RuntimeDisplayFrame.

◆ GetEventCompressor()

virtual EventCompressor< DisplayFrame > * GetEventCompressor ( )
inlineoverrideprotectedvirtual

Get the event compressor for this display frame, if it exists

Returns
The event compressor.

Reimplemented from DisplayFrame.

◆ GetWindowDimensions()

virtual void GetWindowDimensions ( int &  X,
int &  Y,
int &  W,
int &  H 
)
virtual

Get the dimensions for the display frame window

Parameters
XGets X coordinate of window
YGets Y coordinate of window
WGets width of window
HGets height of window

◆ Paint()

void Paint ( )
overridevirtual
See also
RuntimeDisplayFrame

Reimplemented from RuntimeDisplayFrame.

◆ PostDrawCallback()

virtual void PostDrawCallback ( GlsDrawCallback  cb)
virtual

Sets the post draw callback to the function pointer passed in.

Parameters
cbThe new callback to use.

◆ PostHandle()

virtual bool PostHandle ( bool  handled,
DisplayEvent ev 
)
virtual

Called after calling handle.

Parameters
handledTrue when the event has already been handled
evthe pointer to the the event
Returns
True If PostHandle has handled the event. Checks for statistics toggle [s] key, and [ESC] key press. The user can override this to turn off these behaviors.

◆ PreDrawCallback()

virtual void PreDrawCallback ( GlsDrawCallback  cb)
virtual

Sets the pre draw callback to the function pointer passed in.

Parameters
cbThe new callback to use.

◆ Redraw()

virtual void Redraw ( )
virtual

Redraw the window now.
This actually calls the OpenGL Drawing routines.

◆ RemoveSplash()

virtual void RemoveSplash ( )
virtual

Removes (hides) the spash screen

◆ SetProjection()

virtual void SetProjection ( )
virtual

Sets up the default Orthographic projection (which supports things like pan and zoom)

◆ SetRedraw()

void SetRedraw ( )
overridevirtual
See also
DisplayFrame. On Desktop, this also triggers the frame to redraw. This function is deprecated and should not be called by user code. Call Invalidate() from the GlsPainterInterface to signal that the frame needs to be redrawn (if using conditional animation), and call Paint() to trigger the displayframe to redraw.
Deprecated:

Reimplemented from DisplayFrame.

◆ SetWindowDimensions()

virtual void SetWindowDimensions ( int  X,
int  Y,
int  W,
int  H 
)
virtual

Set the dimensions for the display frame window

Parameters
XNew X coordinate of window
YNew Y coordinate of window
WNew width of window
HNew height of window

◆ SKeyTogglesStatistics() [1/2]

virtual bool SKeyTogglesStatistics ( )
virtual
Returns
Whether or not the 'S' key is enabled for controlling statistics

◆ SKeyTogglesStatistics() [2/2]

virtual void SKeyTogglesStatistics ( bool  flag)
virtual

Enable/disable s key for toggling statistics

Parameters
flagWhether or not S key will toggle statistics

◆ WindowFlags()

virtual void WindowFlags ( unsigned long  flags)
virtual

Sets the mode flags for the window

Parameters
flagsThe mode flags

Member Data Documentation

◆ _escKeyExits

bool _escKeyExits
protected

When true, the [Esc] key exits the application

◆ _postDrawCallback

GlsDrawCallback _postDrawCallback
protected

A function pointer that will be called after the Draw method is called

◆ _preDrawCallback

GlsDrawCallback _preDrawCallback
protected

A function pointer that will be called prior to the Draw method being called

◆ _sKeyTogglesStatistics

bool _sKeyTogglesStatistics
protected

When true, the [s] key toggles statistics

◆ eventCompressor

EventCompressor<DisplayFrame> eventCompressor

Used for event compression. Not for general use by users.

◆ splashDisplay

SplashDisplay* splashDisplay
protected

The Spash screen image

◆ theWindow

OpenGLWindow* theWindow

The window associated with this DisplayFrame


The documentation for this class was generated from the following file: