GlsRSOLoader API
1.5.0
|
#include <gls_rso_loader.h>
Public Member Functions | |
RSOReference (disti::RSOInterface1 *, LiveComponentLibRef *, unsigned int) | |
~RSOReference () | |
disti::RSOInterface1 * | GetRSOInterface1 () |
unsigned int | GetRSOVersion () |
void | SetResource (const char *resourceName, const char *resourceVal) |
void | SetResources (const char *buf) |
const char * | GetResource (const char *resourceName) |
void | Calculate (double time) |
void | PreDraw (const disti::RSOInterface1::OpenGLMatrices ¤t, disti::RSOInterface1::Culler &culler) |
void | Draw () |
bool | HandleInput (disti::RSOInterface1::Event *ev) |
bool | SetEmittedEventHandler (disti::RSOInterface1::EmittedEventHandler *handler) |
void | AbsolutePlacement (bool value) |
void | GetBackgroundColor (unsigned char &r, unsigned char &g, unsigned char &b, unsigned char &a) |
bool | GetBoundingBox (disti::RSOInterface1::Vector *min, disti::RSOInterface1::Vector *max, disti::RSOInterface1::MatrixD *transform=0) |
void | SetProjection (int controlWidth, int controlHeight, float depthFactor=4.0f, float fov=90.0f, bool perspective=false) |
bool | HandleMouseDown (int x, int y, int button) |
bool | HandleMouseUp (int x, int y, int button) |
bool | HandleMouseWheelPlus (int x, int y, int buttonMask) |
bool | HandleMouseWheelMinus (int x, int y, int buttonMask) |
bool | HandleMouseMove (int x, int y, int buttonMask) |
bool | HandleKeyDown (int key, int x, int y) |
bool | HandleKeyUp (int key, int x, int y) |
bool | CreateResourceHandle (const char *resourceName, disti::RSOInterface2::ResourceHandle &resourceHandle) |
bool | ReleaseResourceHandle (disti::RSOInterface2::ResourceHandle resourceHandle) |
bool | IsResourceHandleValid (disti::RSOInterface2::ResourceHandle resourceHandle) |
bool | SetResource (disti::RSOInterface2::ResourceHandle resourceHandle, const char *resourceVal) |
bool | GetResource (disti::RSOInterface2::ResourceHandle resourceHandle, const char *&resourceValue) |
bool | SetIntResource (const char *resourceName, long resourceVal) |
bool | SetIntResource (disti::RSOInterface2::ResourceHandle resourceHandle, long resourceVal) |
bool | GetIntResource (const char *resourceName, long &resourceVal) |
bool | GetIntResource (disti::RSOInterface2::ResourceHandle resourceHandle, long &resourceVal) |
bool | SetFloatResource (const char *resourceName, double resourceVal) |
bool | SetFloatResource (disti::RSOInterface2::ResourceHandle resourceHandle, double resourceVal) |
bool | GetFloatResource (const char *resourceName, double &resourceVal) |
bool | GetFloatResource (disti::RSOInterface2::ResourceHandle resourceHandle, double &resourceVal) |
bool | RegisterResourceObserver (disti::RSOInterface2::ResourceHandle resourceHandle, disti::RSOInterface4::ResourceObserver *obs, disti::RSOInterface4::CallbackID &id) |
bool | UnregisterResourceObserver (disti::RSOInterface2::ResourceHandle resourceHandle, disti::RSOInterface4::CallbackID id) |
void | Invalidate () |
void | SetRedraw (bool redraw) |
bool | GetRedraw () |
RSOReference class. Main interface for GlsRSOLoader
RSOReference | ( | disti::RSOInterface1 * | , |
LiveComponentLibRef * | , | ||
unsigned | int | ||
) |
Constructor
~RSOReference | ( | ) |
Destructor
void AbsolutePlacement | ( | bool | value | ) |
Sets the "AbsolutePlacement" property on the RSO
value | true to enable AbsolutePlacement property, false to disable it |
void Calculate | ( | double | time | ) |
Calculate method. Should be called every frame for normal operation.
time | Elapsed time, in seconds |
bool CreateResourceHandle | ( | const char * | resourceName, |
disti::RSOInterface2::ResourceHandle & | resourceHandle | ||
) |
Constructs a resource handle for rapid access to the named resource (RSO v2)
resourceName | resource name | |
[out] | resourceHandle | reference to resource handle output location |
|
inline |
Draw the object via OpenGL. Call this after PreDraw()
void GetBackgroundColor | ( | unsigned char & | r, |
unsigned char & | g, | ||
unsigned char & | b, | ||
unsigned char & | a | ||
) |
Gets the background color of the RSO's display frame
r | Red color component (0-255) |
g | Green color component (0-255) |
b | Blue color component (0-255) |
a | Alpha color component (0-255) |
bool GetBoundingBox | ( | disti::RSOInterface1::Vector * | min, |
disti::RSOInterface1::Vector * | max, | ||
disti::RSOInterface1::MatrixD * | transform = 0 |
||
) |
Get the extents of the RSO when drawn with the given transformation matrix, as a coordinate system-aligned box
min | If the method returns true, contains the point corresponding with the 1st corner of the box. If the method returns false, value is undefined. |
max | If the method returns true, contains the point corresponding with the 2nd corner of the box. If the method returns false, value is undefined. |
transform | Transformation matrix from A to B where A is the component�s coordinate system and B is the coordinate system to compute the bounding box in. (If NULL then identity matrix is assumed) |
bool GetFloatResource | ( | const char * | resourceName, |
double & | resourceVal | ||
) |
Gets a float resource by name (RSO v2)
resourceName | resource name | |
[out] | resourceVal | reference to resource value output location |
bool GetFloatResource | ( | disti::RSOInterface2::ResourceHandle | resourceHandle, |
double & | resourceVal | ||
) |
Gets a float resource by handle (RSO v2)
resourceHandle | resource name | |
[out] | resourceVal | reference to resource value output location |
bool GetIntResource | ( | const char * | resourceName, |
long & | resourceVal | ||
) |
Gets an integer resource by name (RSO v2)
resourceName | resource name | |
[out] | resourceVal | reference to resource value output location |
bool GetIntResource | ( | disti::RSOInterface2::ResourceHandle | resourceHandle, |
long & | resourceVal | ||
) |
Gets an integer resource by handle (RSO v2)
resourceHandle | resource handle | |
[out] | resourceVal | reference to resource value output location |
|
inline |
Get the redraw flag, whether or not this RSO should be redrawn
|
inline |
Gets a resource value by name
resourceName | Resource name |
bool GetResource | ( | disti::RSOInterface2::ResourceHandle | resourceHandle, |
const char *& | resourceValue | ||
) |
Gets a string resource by handle (RSO v2)
resourceHandle | resource handle | |
[out] | resourceValue | reference to resource value output location |
|
inline |
Accessor for RSOInterface contained within this RSO Reference
|
inline |
Gets the version number for the RSO
|
inline |
Allow the object to handle an event.
ev | Event to be handled by the RSO |
bool HandleKeyDown | ( | int | key, |
int | x, | ||
int | y | ||
) |
Keyboard key down event handler
key | Key code pressed. Either ascii value or RSOInterface1::KeyboardEvent::KeySymCodeEnum (for any non-ascii key). |
x | X screen coordinate of mouse cursor's current location |
y | Y screen coordinate of mouse cursor's current location |
bool HandleKeyUp | ( | int | key, |
int | x, | ||
int | y | ||
) |
Keyboard key up event handler
key | Key code released. Either ascii value or RSOInterface1::KeyboardEvent::KeySymCodeEnum (for any non-ascii key). |
x | X screen coordinate of mouse cursor's current location |
y | Y screen coordinate of mouse cursor's current location |
bool HandleMouseDown | ( | int | x, |
int | y, | ||
int | button | ||
) |
Mouse button down event handler
x | X screen coordinate of mouse cursor's current location |
y | Y screen coordinate of mouse cursor's current location |
button | Mouse button pressed (see RSOInterface1::MouseEvent::MouseButtonType) |
bool HandleMouseMove | ( | int | x, |
int | y, | ||
int | buttonMask | ||
) |
Mouse button up event handler
x | X screen coordinate of mouse cursor's current location |
y | Y screen coordinate of mouse cursor's current location |
buttonMask | bitfield of which mouse buttons are currently held down (see RSOInterface1::MouseEvent::MouseButtonType) |
bool HandleMouseUp | ( | int | x, |
int | y, | ||
int | button | ||
) |
Mouse button up event handler
x | X screen coordinate of mouse cursor's current location |
y | Y screen coordinate of mouse cursor's current location |
button | Mouse button released (see RSOInterface1::MouseEvent::MouseButtonType) |
bool HandleMouseWheelMinus | ( | int | x, |
int | y, | ||
int | buttonMask | ||
) |
Mouse wheel minus event handler
x | X screen coordinate of mouse cursor's current location |
y | Y screen coordinate of mouse cursor's current location |
buttonMask | bitfield of which mouse buttons are currently held down (see RSOInterface1::MouseEvent::MouseButtonType) |
bool HandleMouseWheelPlus | ( | int | x, |
int | y, | ||
int | buttonMask | ||
) |
Mouse wheel plus event handler
x | X screen coordinate of mouse cursor's current location |
y | Y screen coordinate of mouse cursor's current location |
buttonMask | bitfield of which mouse buttons are currently held down (see RSOInterface1::MouseEvent::MouseButtonType) |
|
inlinevirtual |
Notify the painter that the scene needs to be redrawn
Implements RSOInterface5::RSOPainter.
bool IsResourceHandleValid | ( | disti::RSOInterface2::ResourceHandle | resourceHandle | ) |
Checks the given resource handle for validity (RSO v2)
resourceHandle | resource handle |
|
inline |
bool RegisterResourceObserver | ( | disti::RSOInterface2::ResourceHandle | resourceHandle, |
disti::RSOInterface4::ResourceObserver * | obs, | ||
disti::RSOInterface4::CallbackID & | id | ||
) |
Register a resource observer to be notified when a resource changes *
resourceHandle | the resource handle | |
obs | the observer to be notified | |
[out] | id | the id used to unregister the observer |
bool ReleaseResourceHandle | ( | disti::RSOInterface2::ResourceHandle | resourceHandle | ) |
Frees the given resource handle (RSO v2)
resourceHandle | resource handle |
|
inline |
Allow for handling events from inside the object. The emitted event handler will be passed events that are from inside the component
handler | pointer to the EmittedEventHandler object to use or NULL to remove the current event handler. |
bool SetFloatResource | ( | const char * | resourceName, |
double | resourceVal | ||
) |
Sets a float resource by name (RSO v2)
resourceName | resource name |
resourceVal | resource value |
bool SetFloatResource | ( | disti::RSOInterface2::ResourceHandle | resourceHandle, |
double | resourceVal | ||
) |
Sets a float resource by handle (RSO v2)
resourceHandle | resource handle |
resourceVal | resource value |
bool SetIntResource | ( | const char * | resourceName, |
long | resourceVal | ||
) |
Sets an integer resource by name (RSO v2)
resourceName | resource name |
resourceVal | resource value |
bool SetIntResource | ( | disti::RSOInterface2::ResourceHandle | resourceHandle, |
long | resourceVal | ||
) |
Sets an integer resource by handle (RSO v2)
resourceHandle | resource handle |
resourceVal | resource value |
void SetProjection | ( | int | controlWidth, |
int | controlHeight, | ||
float | depthFactor = 4.0f , |
||
float | fov = 90.0f , |
||
bool | perspective = false |
||
) |
Sets the projection of the RSO using glOrtho or gluSetPerspective. Sets the application's projection globally.
controlWidth | Width of the RSO (in pixels) |
controlHeight | Height of the RSO (in pixels) |
depthFactor | Used for autocalculating clipping planes. |
fov | field of view (in degrees) |
perspective | Whether the projection is perspective or orthographic |
|
inline |
Set the redraw flag, notifying the application that this RSO should be redrawn
redraw | the new value of the redraw flag |
|
inline |
Sets a resource contained within the RSO
resourceName | Resource name |
resourceVal | Resource value |
bool SetResource | ( | disti::RSOInterface2::ResourceHandle | resourceHandle, |
const char * | resourceVal | ||
) |
Sets a string resource by handle (RSO v2)
resourceHandle | resource handle |
resourceVal | resource value |
void SetResources | ( | const char * | buf | ) |
CRT Insensitive version of SetResources() Parse a buffer of resource value pairs.
buf | String containing resource data |
bool UnregisterResourceObserver | ( | disti::RSOInterface2::ResourceHandle | resourceHandle, |
disti::RSOInterface4::CallbackID | id | ||
) |
Unregister a resource observer
resourceHandle | the resource handle |
id | the id used to register the resource observer |