GL Studio C++ Runtime API
|
#include <display_frame.h>
Public Member Functions | |
DisplayFrame (int width, int height, bool allocateObjects=true) | |
void | ClearBitfield (GLbitfield bitField) |
GLbitfield | ClearBitfield () |
virtual void | DragObject (DisplayObject *obj) |
virtual DisplayObject * | DragObject (void) |
virtual void | ClearDrag () |
virtual void | FocusObject (DisplayObject *obj) |
virtual DisplayObject * | FocusObject (void) |
virtual void | ClearFocus () |
virtual void | MultitouchEnabled (bool enabled) |
virtual bool | MultitouchEnabled (void) |
virtual InputHandler * | GetInputHandler () |
virtual DisplayObject * | HandleDisplayEvent (DisplayEvent *ev) |
virtual void | WriteResources (const char *filename, GlsResourceFilter *filter=NULL) |
virtual void | ReadResources (const char *filename) |
virtual DistiAttributeBase & | Resource (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) |
virtual InterfaceListType * | GetCppInterfaceDescription (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) |
virtual void | SetRedraw (void) |
bool | CullingEnabled (void) |
void | CullingEnabled (const bool enabled) |
DistiAttribDict & | FrameAttribDict (void) |
const DistiAttribDict & | FrameAttribDict (void) const |
DynamicMaterialArray & | MaterialPalette (void) |
ComponentLightMgr * | LightMgr (void) |
void | LightMgr (ComponentLightMgr *val) |
virtual void | ClearDragAndFocus () |
Public Member Functions inherited from AttributeChangedNotifier | |
virtual | ~AttributeChangedNotifier () |
Static Public Member Functions | |
static void | SetOpenGLDefaultState (bool saveVal) |
static void | RestoreOpenGLState (void) |
Public Attributes | |
TexturePalette * | texturePalette |
SoundSystem * | _sound_player |
Group * | objects |
Protected Member Functions | |
virtual void | CurrentCursor (unsigned int cursor_id) |
void | CleanupDragMap () |
DisplayObject * | GetDragObjectForCursor (unsigned int cursorID) |
DisplayObject * | FindDragObject () |
virtual float | Scale (void) |
Protected Attributes | |
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 |
The base class for associating a display device with an object list.
DisplayFrame contains all of the display objects, texture, and fonts for an application.
DisplayFrame | ( | int | width, |
int | height, | ||
bool | allocateObjects = true |
||
) |
Creates a new display frame
width | The width of this display frame in pixels |
height | The height of this display frame in pixels |
allocateObjects |
|
protected |
Cleanup unused entries from the drag map
|
inline |
Sets the OpenGL clear bitmask that will be used when the window is cleared
bitField | The OpenGL bitfield to use when clearing. /see glClear |
|
inline |
Gets the OpenGL clear bitmask that will be used when the window is cleared
|
virtual |
Clears the drag objects for all cursors.
|
virtual |
Call this before deleting objects which may be being kept by the drag or focus objects. If an object is to be deleted. The user must ensure that it is not being used as the drag or focus object. If it is, a leave event may be sent to it after it has been deleted, causing a crash. To avoid this the user can either ensure that the object never handles mouse events, or call ClearDragAndFocus() imediatly before deleting them
Reimplemented in RuntimeDisplayFrame, and ComponentBase.
|
virtual |
Clears the focus objects for all cursors.
bool CullingEnabled | ( | void | ) |
Gets the whether or not culling is enabled for this display frame
void CullingEnabled | ( | const bool | enabled | ) |
Sets the whether or not culling is enabled for this display frame
enabled | whether or not culling is enabled for this display frame |
|
protectedvirtual |
Changes the current cursor to the specified cursor id. Needed by multitouch, so that DragObject and FocusObject will return the correct objects for the current cursor.
cursor_id | the cursor id |
|
virtual |
Sets the current "Drag" object for the current cursor
obj | The new DragObject |
|
virtual |
Gets the current "Drag" object for the current cursor
void Draw | ( | void | ) |
Draw the objects contained in this display frame
|
protected |
Find a non-null drag object from the _dragObjectMap if on exists
|
virtual |
Sets the current focus object for the current cursor.
|
virtual |
Gets the current "Focus" object for the current cursor
|
inline |
|
inline |
|
virtual |
Get the details of the Cpp Interface The actual interface is exposed in compiled code.
addToThisList | A list to add to and then return. Creates a new one if NULL. |
Reimplemented in GlsRSOWrapper, ComponentBase, and SplashDisplay.
|
virtual |
Frees the memory allocated by a previous GetCppInterfaceDescription call
array | Pointer to memory allocated by GetCppInterfaceDescription |
Reimplemented in GlsRSOWrapper, ComponentBase, and SplashDisplay.
|
protected |
Get the drag object that corresponds to the curosr
cursorID | the cursor |
|
virtual |
Get the input handler
Reimplemented in ComponentBase.
|
inline |
Gets a DisplayFrame resource value.
resourceName | Name of the resource to set |
|
virtual |
CRT Insensitive version of GetResource() Version with streams can not be called from differently compiled code.
name | name of resource |
|
virtual |
Frees the memory allocated by a previous GetResource_CRTClean call
memoryToFree | Pointer to memory allocated by GetResource_CRTClean |
|
virtual |
Get the resources for this display frame and all it's children acording to the filter
outstr | The stream to write to |
filter | The filter to control what gets written. |
Reimplemented in ComponentBase, and GlsRSOWrapper.
|
virtual |
CRT Insensitive version of GetResources()
filter | The filter to control what gets written |
|
virtual |
Frees the memory allocated by a previous GetResources_CRTClean call
memoryToFree | Pointer to memory allocated by GetResource_CRTClean |
|
virtual |
Handles a display event. Picks an object and also tracks focus.
int Height | ( | void | ) |
Gets the height in pixels of this display frame
void InsertObject | ( | DisplayObject * | obj, |
int | loc | ||
) |
Inserts a display object into this display frame at the specified index in the object list.
obj | The object to insert |
loc | Where to insert the object |
|
inline |
|
inline |
Sets the light manager for this display frame. This is used only for very special cases. The current LightMgr is NOT deleted when the new one is set. If this is used, it is recommended to restore the value to the original value.
val | The pointer to the new light manger. |
|
inline |
|
virtual |
Enables/Disables multitouch on the display frame. Multitouch is enabled by default. This function has no effect on platforms that do not support multitouch
|
virtual |
Gets whether or not multitouch is enabled on the display frame.
|
virtual |
Implements AttributeChangedNotifier::NotifyAttributeChanged. Notify the class that the attribute has changed. Observers of the attribute will have their callbacks called
name | the name of the attribute |
Implements AttributeChangedNotifier.
Reimplemented in ComponentBase.
void PushObject | ( | DisplayObject * | obj | ) |
Inserts a display object into this display frame at the end of the object list.
obj | The object to insert |
|
virtual |
Read the resources (attributes) of the objects in this display frame from the specified file
filename | Name of the file to read from |
|
virtual |
Gets a reference to the specified attribute for reading and writing. This reference can be streamed into and out of variables. This can access different levels of objects. For example: The DisplayFrame: Resource("ComponentHeaderFile") >> someStdString; An object in the DisplayFrame: Resource("SomeObject.Visible") << someBool; An object in a Component in this DisplayFrame: Resource("SomeComponentObject.SomeObject.Visible") >> someBool;
Reimplemented in ComponentBase, and GlsRSOWrapper.
|
static |
Call this after calling SetOpenGLDefaultState with saveVal == true. DO NOT call this after calling SetOpenGLDefaultState with saveVal == false because this will pop the attribute stack.
|
inlineprotectedvirtual |
Reimplemented in RuntimeDisplayFrame.
void SetHeight | ( | int | h | ) |
Sets the height in pixels of this display frame
h | The new height in pixels of this display frame |
|
static |
Sets up the OpenGL Pipeline to the state expected by GL Studio drawing. resetTemplate is used to not reset certain catagories. For example, it may be desirable for a GL Studio object to receive lighting from it's VegaPrime scene.
saveVal | Whether or not to save values. If true, this will call glPushClientAttrib(GL_CLIENT_ALL_ATTRIB_BITS) and glPushAttrib(GL_ALL_ATTRIB_BITS). You should call RestoreOpenGLState() after drawing to pop the attributes. |
|
virtual |
Does nothing here in the base class. Allows other display frames to add functionality
Reimplemented in ComponentBase, glsDisplayFrame, and EmbeddedDisplayFrame.
|
inline |
Sets a DisplayFrame resource value.
resourceName | Name of the resource to set. |
resourceVal | Value of the resource to set |
|
virtual |
CRT Insensitive version of SetResource() Version with streams can not be called from differently compiled code.
name | name of resource |
value | new value for resource |
|
virtual |
Parse a stream of resource value pairs.
instr | Stream containing the resource data |
|
virtual |
CRT Insensitive version of SetResources() Parse a buffer of resource value pairs.
buf | String containing resource data |
void SetTexturePaletteSize | ( | int | cnt | ) |
Sets the texture palette size for this display frame
cnt | The number of entries to have in the display frame |
void SetWidth | ( | int | w | ) |
Sets the width in pixels of this display frame
w | The new width in pixels of this display frame |
int Width | ( | void | ) |
Gets the width in pixels of this display frame
|
virtual |
Write the resources (attributes) of the objects in this display frame to the specified file
filename | Name of the file to write to |
filter | A filter to specify which attributes to write |
|
protected |
The OpenGL bitfield to use when clearing. /see glClear
|
protected |
backing store for META_COMPONENT_HEADER_FILE_NAME attribute
|
protected |
True if culling is enabled for this DisplayFrame
|
protected |
the current cursor being processed
|
protected |
The number of cursors (touches) that are currently down
|
protected |
The height of the window for this display frame
|
protected |
Keeps previous picks depth for use when no pick is performed (dragging)
|
protected |
The _lightMgr is used to setup lighting for the DisplayFrame
|
protected |
A Dynamic array for keeping the materials for this frame
|
protected |
whether or not multitouch is enabled
SoundSystem* _sound_player |
Sound file player for this DisplayFrame
|
protected |
The width of the window for this display frame
Group* objects |
The object hierarchy for this display frame
TexturePalette* texturePalette |
An array of textures allocated for display on objects