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 (void)
 
virtual void SetProjection (void)
 
bool FrameAnimate () override
 
void Paint (void) override
 
virtual void Redraw (void)
 
void SetRedraw (void) 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 (void)
 
virtual GlsEyePointCurrentEyePoint ()
 
virtual void CurrentEyePoint (GlsEyePoint *eye)
 
virtual void Scale (float scale)
 
virtual float Scale (void) 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)
 
void Name (char *name)
 
virtual GlsColor BackgroundColor (void)
 
virtual int FrameInterval (void)
 
virtual void FrameInterval (int interval)
 
virtual StatisticsStats ()
 
virtual void RecordCalculateStart (void)
 
virtual void RecordCalculateEnd (void)
 
virtual void ClearDragAndFocus () override
 
virtual bool UpdateAnimate ()
 
virtual void WaitForNextFrame ()
 
virtual void WidthOffset (float offset)
 
virtual float WidthOffset (void)
 
virtual void HeightOffset (float offset)
 
virtual float HeightOffset (void)
 
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 (void) const
 
void Invalidate () override
 
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 (void)
 
virtual void ClearDrag ()
 
virtual void FocusObject (DisplayObject *obj)
 
virtual DisplayObjectFocusObject (void)
 
virtual void ClearFocus ()
 
virtual void MultitouchEnabled (bool enabled)
 
virtual bool MultitouchEnabled (void)
 
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)
 
std::string GetResource (const std::string &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)
 
void InsertObject (DisplayObject *obj, int loc)
 
void PushObject (DisplayObject *obj)
 
int Width (void)
 
int Height (void)
 
void SetWidth (int w)
 
void SetHeight (int h)
 
bool CullingEnabled (void)
 
void CullingEnabled (const bool enabled)
 
DistiAttribDictFrameAttribDict (void)
 
const DistiAttribDictFrameAttribDict (void) const
 
DynamicMaterialArrayMaterialPalette (void)
 
ComponentLightMgrLightMgr (void)
 
void LightMgr (ComponentLightMgr *val)
 
- Public Member Functions inherited from AttributeChangedNotifier
virtual ~AttributeChangedNotifier ()
 
- Public Member Functions inherited from WeakReferenceableMixin
void AddWeakReference (WeakReference *weakRef) override
 
void NotifyWeakReferenceDestroyed (WeakReference *ref) override
 

Public Attributes

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

Protected Attributes

GlsDrawCallback _preDrawCallback
 
GlsDrawCallback _postDrawCallback
 
SplashDisplaysplashDisplay
 
bool _sKeyTogglesStatistics
 
bool _escKeyExits
 
- Protected Attributes inherited from RuntimeDisplayFrame
Timer _frameTimer
 
float _smoothedFrameDelay
 
float _width_offset
 
float _height_offset
 
float _depthFactor
 
double _fov
 
double _nearZ
 
bool _autoCalcNearZ
 
double _farZ
 
bool _autoCalcFarZ
 
int _current_view
 
std::string _name
 
float _scale
 
unsigned int frameInterval
 
GlsEyePoint_currentEyePoint
 
bool _redraw
 
- Protected Attributes inherited from DisplayFrame
bool _cullingEnabled
 
int _width
 
int _height
 
float _lastPickedDepth
 
DynamicMaterialArray _materialPalette
 
ComponentLightMgr_lightMgr
 
GLbitfield _clearBitfield
 
std::string _componentHeaderFileName
 
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 (void)
 
- Protected Member Functions inherited from DisplayFrame
virtual void CurrentCursor (unsigned int cursor_id)
 
void CleanupDragMap ()
 
DisplayObjectGetDragObjectForCursor (unsigned int cursorID)
 
DisplayObjectFindDragObject ()
 
- Protected Member Functions inherited from WeakReferenceableMixin
 WeakReferenceableMixin (void)
 
virtual ~WeakReferenceableMixin ()
 

Detailed Description

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

Constructor & Destructor Documentation

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

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
virtual void Create ( void  )
virtual

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

virtual void CreateSplash ( )
virtual

Creates the spash screen

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

Enable/disable ESC key for exiting application

Parameters
flagWhether or not ESC key exits application
bool FrameAnimate ( )
overridevirtual
See also
RuntimeDisplayFrame Overridden to return true if any window is open.

Reimplemented from RuntimeDisplayFrame.

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
void Paint ( void  )
overridevirtual
See also
RuntimeDisplayFrame

Reimplemented from RuntimeDisplayFrame.

virtual void PostDrawCallback ( GlsDrawCallback  cb)
virtual

Sets the post draw callback to the function pointer passed in

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.
virtual void PreDrawCallback ( GlsDrawCallback  cb)
virtual

Sets the pre draw callback to the function pointer passed in

virtual void Redraw ( void  )
virtual

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

virtual void RemoveSplash ( )
virtual

Removes (hides) the spash screen

virtual void SetProjection ( void  )
virtual

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

void SetRedraw ( void  )
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.

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
virtual bool SKeyTogglesStatistics ( )
virtual
Returns
Whether or not the 'S' key is enabled for controlling statistics
virtual void SKeyTogglesStatistics ( bool  flag)
virtual

Enable/disable s key for toggling statistics

Parameters
flagWhether or not S key will toggle statistics
virtual void WindowFlags ( unsigned long  flags)
virtual

Sets the mode flags for the window

Parameters
flagsThe mode flags

Member Data Documentation

bool _escKeyExits
protected

When true, the [Esc] key exits the application

GlsDrawCallback _postDrawCallback
protected

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

GlsDrawCallback _preDrawCallback
protected

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

bool _sKeyTogglesStatistics
protected

When true, the [s] key toggles statistics

EventCompressor<DisplayFrame> eventCompressor

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

SplashDisplay* splashDisplay
protected

The Spash screen image

OpenGLWindow* theWindow

The window associated with this DisplayFrame


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