GlsRSOLoader API 1.6.2
gls_rso_loader.h
Go to the documentation of this file.
1/*! \file gls_rso_loader.h
2\brief The main class for loading an RSO.
3
4\par Copyright Information
5
6 Copyright (c) 2013 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
13This Software contains proprietary trade secrets of DiSTI and may not be
14reproduced, in whole or part, in any form, or by any means of electronic,
15mechanical, or otherwise, without the written permission of DiSTI. Said
16permission may be derived through the purchase of applicable DiSTI product
17licenses which detail the distribution rights of this content and any
18Derivative Works based on this or other copyrighted DiSTI Software.
19
20NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
21AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
22PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
23AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
24IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
25PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
26
27LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
28IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
29INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
30DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
31INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
32INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
33OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
34EXCEED FIVE DOLLARS (US$5.00).
35
36The aforementioned terms and restrictions are governed by the laws of the
37State of Florida and the United States of America.
38*/
39
40#ifndef GLS_RSO_LOADER_H_INCLUDED
41#define GLS_RSO_LOADER_H_INCLUDED
42
43#include "rso_interface_5.h"
44
45#include <string>
46#include <vector>
47
48/** \brief Namespace for loading RSOs. */
49namespace GlsRSOLoader
50{
51class LiveComponentLibRef;
52
53/** RSOReference class. Main interface for GlsRSOLoader */
55{
57 unsigned int _rsoVersion;
58 LiveComponentLibRef* _liveComponentLibRef;
59 bool _redraw;
60
61 RSOReference( const RSOReference& );
62 RSOReference& operator=( const RSOReference& );
63
64public:
65 /** Constructor */
66 RSOReference( disti::RSOInterface1*, LiveComponentLibRef*, unsigned int );
67
68 /** Destructor */
70
71 /** Accessor for RSOInterface contained within this RSO Reference
72 * \return Pointer to RSOInterface instance
73 */
74 inline disti::RSOInterface1* GetRSOInterface1() { return _rso; }
75
76 /** Gets the version number for the RSO
77 * \return The RSO version number
78 */
79 inline unsigned int GetRSOVersion() { return _rsoVersion; }
80
81 /** Sets a resource contained within the RSO
82 * \param resourceName Resource name
83 * \param resourceVal Resource value
84 */
85 inline void SetResource( const char* resourceName, const char* resourceVal ) { _rso->SetResource( resourceName, resourceVal ); }
86
87 /** CRT Insensitive version of SetResources()
88 * Parse a buffer of resource value pairs.
89 * \param buf String containing resource data
90 */
91 void SetResources( const char* buf );
92
93 /** Gets a resource value by name
94 * \param resourceName Resource name
95 * \return Value of given resource
96 */
97 inline const char* GetResource( const char* resourceName ) { return _rso->GetResource( resourceName ); }
98
99 /** Calculate method. Should be called every frame for normal operation.
100 * \param time Elapsed time, in seconds
101 */
102 void Calculate( double time );
103
104 /** Calculate transformations and perform culling. Call this before Draw()
105 * \param current Transformation matrices (Projection and Modelview) to apply
106 * \param culler Culler operation to apply on this RSO
107 */
108 inline void PreDraw( const disti::RSOInterface1::OpenGLMatrices& current, disti::RSOInterface1::Culler& culler ) { _rso->PreDraw( current, culler ); }
109
110 /** Draw the object via OpenGL. Call this after PreDraw() */
111 inline void Draw() { _rso->Draw(); }
112
113 /** Allow the object to handle an event.
114 * \param ev Event to be handled by the RSO
115 * \return true if the event was handled by the RSO
116 */
117 inline bool HandleInput( disti::RSOInterface1::Event* ev ) { return _rso->HandleInput( ev ); }
118
119 /** Allow for handling events from inside the object.
120 * The emitted event handler will be passed events that are from inside the component
121 * \param handler pointer to the EmittedEventHandler object to use or NULL to remove the current event handler.
122 * \return true if this component may emit events, false if this component will never emit events.
123 */
125
126 /** Sets the "AbsolutePlacement" property on the RSO
127 * \param value true to enable AbsolutePlacement property, false to disable it
128 */
129 void AbsolutePlacement( bool value );
130
131 /** Gets the background color of the RSO's display frame
132 * \param r Red color component (0-255)
133 * \param g Green color component (0-255)
134 * \param b Blue color component (0-255)
135 * \param a Alpha color component (0-255)
136 */
137 void GetBackgroundColor( unsigned char& r, unsigned char& g, unsigned char& b, unsigned char& a );
138
139 /** Get the extents of the RSO when drawn with the given transformation matrix, as a coordinate system-aligned box
140 * \param 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.
141 * \param 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.
142 * \param 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)
143 * \return true if the extents were calculated, false if the extents could not be calculated.
144 */
146
147 /** Sets the projection of the RSO using glOrtho or gluSetPerspective. Sets the application's projection globally.
148 * \param controlWidth Width of the RSO (in pixels)
149 * \param controlHeight Height of the RSO (in pixels)
150 * \param depthFactor Used for autocalculating clipping planes.
151 * \param fov field of view (in degrees)
152 * \param perspective Whether the projection is perspective or orthographic
153 */
154 void SetProjection( int controlWidth, int controlHeight, float depthFactor = 4.0f, float fov = 90.0f, bool perspective = false );
155
156 /** Mouse button down event handler
157 * \param x X screen coordinate of mouse cursor's current location
158 * \param y Y screen coordinate of mouse cursor's current location
159 * \param button Mouse button pressed (see RSOInterface1::MouseEvent::MouseButtonType)
160 * \return true if event handled successfully, false otherwise
161 */
162 bool HandleMouseDown( int x, int y, int button );
163
164 /** Mouse button up event handler
165 * \param x X screen coordinate of mouse cursor's current location
166 * \param y Y screen coordinate of mouse cursor's current location
167 * \param button Mouse button released (see RSOInterface1::MouseEvent::MouseButtonType)
168 */
169 bool HandleMouseUp( int x, int y, int button );
170
171 /** Mouse wheel plus event handler
172 * \param x X screen coordinate of mouse cursor's current location
173 * \param y Y screen coordinate of mouse cursor's current location
174 * \param buttonMask bitfield of which mouse buttons are currently held down (see RSOInterface1::MouseEvent::MouseButtonType)
175 * \return true if event handled successfully, false otherwise
176 */
177 bool HandleMouseWheelPlus( int x, int y, int buttonMask );
178
179 /** Mouse wheel minus event handler
180 * \param x X screen coordinate of mouse cursor's current location
181 * \param y Y screen coordinate of mouse cursor's current location
182 * \param buttonMask bitfield of which mouse buttons are currently held down (see RSOInterface1::MouseEvent::MouseButtonType)
183 * \return true if event handled successfully, false otherwise
184 */
185 bool HandleMouseWheelMinus( int x, int y, int buttonMask );
186
187 /** Mouse button up event handler
188 * \param x X screen coordinate of mouse cursor's current location
189 * \param y Y screen coordinate of mouse cursor's current location
190 * \param buttonMask bitfield of which mouse buttons are currently held down (see RSOInterface1::MouseEvent::MouseButtonType)
191 * \return true if event handled successfully, false otherwise
192 */
193 bool HandleMouseMove( int x, int y, int buttonMask );
194
195 /** Keyboard key down event handler
196 * \param key Key code pressed. Either ascii value or RSOInterface1::KeyboardEvent::KeySymCodeEnum (for any non-ascii key).
197 * \param x X screen coordinate of mouse cursor's current location
198 * \param y Y screen coordinate of mouse cursor's current location
199 * \return true if event handled successfully, false otherwise
200 */
201 bool HandleKeyDown( int key, int x, int y );
202
203 /** Keyboard key up event handler
204 * \param key Key code released. Either ascii value or RSOInterface1::KeyboardEvent::KeySymCodeEnum (for any non-ascii key).
205 * \param x X screen coordinate of mouse cursor's current location
206 * \param y Y screen coordinate of mouse cursor's current location
207 * \return true if event handled successfully, false otherwise
208 */
209 bool HandleKeyUp( int key, int x, int y );
210
211 // Additions for RSO version 2
212
213 /** Constructs a resource handle for rapid access to the named resource (RSO v2)
214 * \param resourceName resource name
215 * \param[out] resourceHandle reference to resource handle output location
216 * \return true if successful
217 */
218 bool CreateResourceHandle( const char* resourceName, disti::RSOInterface2::ResourceHandle& resourceHandle );
219
220 /** Frees the given resource handle (RSO v2)
221 * \param resourceHandle resource handle
222 * \return true if successful
223 */
225
226 /** Checks the given resource handle for validity (RSO v2)
227 * \param resourceHandle resource handle
228 * \return true if the given resource handle is connected to a valid resource
229 */
231
232 /** Sets a string resource by handle (RSO v2)
233 * \param resourceHandle resource handle
234 * \param resourceVal resource value
235 * \return true if successful
236 */
237 bool SetResource( disti::RSOInterface2::ResourceHandle resourceHandle, const char* resourceVal );
238
239 /** Gets a string resource by handle (RSO v2)
240 * \param resourceHandle resource handle
241 * \param[out] resourceValue reference to resource value output location
242 * \return true if successful
243 */
244 bool GetResource( disti::RSOInterface2::ResourceHandle resourceHandle, const char*& resourceValue );
245
246 /** Sets an integer resource by name (RSO v2)
247 * \param resourceName resource name
248 * \param resourceVal resource value
249 * \return true if successful
250 */
251 bool SetIntResource( const char* resourceName, long resourceVal );
252 /** Sets an integer resource by handle (RSO v2)
253 * \param resourceHandle resource handle
254 * \param resourceVal resource value
255 * \return true if successful
256 */
257 bool SetIntResource( disti::RSOInterface2::ResourceHandle resourceHandle, long resourceVal );
258
259 /** Gets an integer resource by name (RSO v2)
260 * \param resourceName resource name
261 * \param[out] resourceVal reference to resource value output location
262 * \return true if successful
263 */
264 bool GetIntResource( const char* resourceName, long& resourceVal );
265 /** Gets an integer resource by handle (RSO v2)
266 * \param resourceHandle resource handle
267 * \param[out] resourceVal reference to resource value output location
268 * \return true if successful
269 */
270 bool GetIntResource( disti::RSOInterface2::ResourceHandle resourceHandle, long& resourceVal );
271
272 /** Sets a float resource by name (RSO v2)
273 * \param resourceName resource name
274 * \param resourceVal resource value
275 * \return true if successful
276 */
277 bool SetFloatResource( const char* resourceName, double resourceVal );
278 /** Sets a float resource by handle (RSO v2)
279 * \param resourceHandle resource handle
280 * \param resourceVal resource value
281 * \return true if successful
282 */
283 bool SetFloatResource( disti::RSOInterface2::ResourceHandle resourceHandle, double resourceVal );
284
285 /** Gets a float resource by name (RSO v2)
286 * \param resourceName resource name
287 * \param[out] resourceVal reference to resource value output location
288 * \return true if successful
289 */
290 bool GetFloatResource( const char* resourceName, double& resourceVal );
291 /** Gets a float resource by handle (RSO v2)
292 * \param resourceHandle resource name
293 * \param[out] resourceVal reference to resource value output location
294 * \return true if successful
295 */
296 bool GetFloatResource( disti::RSOInterface2::ResourceHandle resourceHandle, double& resourceVal );
297
298 /** Register a resource observer to be notified when a resource changes *
299 * \param resourceHandle the resource handle
300 * \param obs the observer to be notified
301 * \param[out] id the id used to unregister the observer
302 * \return true if successful
303 */
305
306 /** Unregister a resource observer
307 * \param resourceHandle the resource handle
308 * \param id the id used to register the resource observer
309 * \return true if successful
310 */
312
313 /** Notify the painter that the scene needs to be redrawn */
314 void Invalidate() { SetRedraw( true ); }
315
316 /** Set the redraw flag, notifying the application that this RSO should be redrawn
317 * \param redraw the new value of the redraw flag
318 */
319 void SetRedraw( bool redraw ) { _redraw = redraw; }
320
321 /** Get the redraw flag, whether or not this RSO should be redrawn
322 * \return the current value of the redraw flag
323 */
324 bool GetRedraw() { return _redraw; }
325};
326
327/** Create RSO static
328 * This will load the specified DLL and try to create the specified class.
329 * It will return the RSO1Reference* on success, and NULL on failure.
330 * \param fileName The name of the DLL
331 * \param className The class name to create. If NULL, the default class will be created.
332 * \param absolutePlacement Initial value of AbsolutePlacement
333 * \return NULL on failure.*/
334RSOReference* LoadRSO( const char* fileName, const char* className = 0, bool absolutePlacement = true );
335
336/** Delete an RSO reference */
338
339/** Sets up the OpenGL Pipeline to the state expected by RSO drawing.
340 * \param pushState Whether or not to save values. If true, this will call
341 * glPushClientAttrib(GL_CLIENT_ALL_ATTRIB_BITS) and glPushAttrib(GL_ALL_ATTRIB_BITS). You should call
342 * RestoreOpenGLState() after drawing to pop the attributes.
343 */
344void SetOpenGLDefaultState( bool pushState );
345
346/** Call this after calling SetOpenGLDefaultState with saveVal == true.
347 * DO NOT call this after calling SetOpenGLDefaultState with saveVal == false
348 * because this will pop the attribute stack.
349 */
351
352/** OpenGLMatrices is used to pass the current OpenGL matrices to PreDraw */
354{
355protected:
356 bool _needsDelete; ///< Whether the matrix data is owned by this object and must be freed.
357
358public:
359 /** Constructor */
361 /** Destructor */
363
364 /** Retrieves the current OpenGL Matrices from the
365 * OpenGL Subsystem */
367};
368
369/** Defines culling parameters (ie- clipping planes for frustum culling) for PreDraw */
371{
372public:
373 /** Culler constructor
374 * \param enabled Whether or not to actually do the culling test
375 */
376 Culler( bool enabled = true );
377
378 /** Reads the current OpenGL projection matrices and determines the six frustum planes.
379 * \param currentMatrices Transformation matrices to apply to culling planes
380 */
382};
383
384/** Used for specifiying a filter for accessing resources
385 */
387{
388public:
389 int _levelsUp; ///< See LevelsUp().
390 int _groupLevelsDown; ///< See GroupLevelsDown().
391 std::vector<std::string> _excludeList; ///< Resource names that will not pass the filter.
392 std::vector<std::string> _includeList; ///< Resource names that will pass the filter.
393 bool _namesOnly; ///< See NamesOnly().
394
395public:
397 /// Copy constructor
399
400 virtual ~GlsResourceFilter();
401
402 /** How many levels of qualification above the starting point to show in the attribute names.
403 * This is based on the component heirarchy, not the draw hierarchy.
404 * For example if you call Altimeter->GetResources() with:
405 * LevelsUp = 0, expect:
406 * Altitude: 1000
407 * LevelsUp = 1, expect:
408 * Altimeter.Altitude:
409 * LevelsUp = 2, expect:
410 * Cockpit.Altimeter.Altitude:
411 * -1 means full qualification.
412 */
413 inline int LevelsUp() const { return _levelsUp; }
414 /// \param value How many levels of qualification above the starting point to show in the attribute names.
415 inline void LevelsUp( int value ) { _levelsUp = value; }
416
417 /** How many levels of children to show.
418 * This is different from LevelsUp because this is based on the draw
419 * heirarchy (Groups rather than components).
420 * For example with:
421 * GroupLevelsDown = 0, only the specified object's resources will be shown.
422 * GroupLevelsDown = 1, only the immeadiate children of the object's resources will be shown.
423 * GroupLevelsDown = -1, means all children will be shown.
424 * Note that the name stays fully qualified for the children. For example:
425 * if GroupLevelsDown == 1 the results would include:
426 * Altimeter.Visible: 1
427 * Altimeter.Group1.Visible: 1
428 * but NOT:
429 * Altimeter.Group1.Poly.Visible: 1
430 */
431 inline int GroupLevelsDown() const { return _groupLevelsDown; }
432 /// \param value How many levels of children to show.
433 inline void GroupLevelsDown( int value ) { _groupLevelsDown = value; }
434
435 /** If true, only a list of names will be returned.
436 * Values will not be returned.
437 * The format changes to not include the ":".
438 */
439 inline bool NamesOnly() const { return _namesOnly; }
440 /// \param value True to return only a list of names.
441 inline void NamesOnly( bool value ) { _namesOnly = value; }
442
443 /** Add a resource name to the exclude filter
444 * Resources on the exclude list will not pass the filter.
445 * Excludes take precedence over includes
446 */
447 void AddExclude( const char* name );
448
449 /// Returns the number of exclude entries in the filter
450 int ExcludeCount() const;
451
452 /** Returns the resource name for the given exclude list entry
453 * \pre index < ExcludeCount()
454 */
455 const char* GetExclude( int index ) const;
456
457 /** Removes a entry from the exclude list
458 * This will reduce the ExcludeCount()
459 * \pre index < ExcludeCount()
460 */
461 void RemoveExclude( unsigned int index );
462
463 /// Removes all entries from the exclude list
465
466 /** Add a resource name to the include filter
467 * If there are no includes specified, all resources
468 * will pass the filter by default.
469 * If IncludeCount() > 0, then only resources that
470 * are included will pass the filter.
471 */
472 void AddInclude( const char* name );
473
474 /// Returns the number of includes in the filter
475 int IncludeCount() const;
476
477 /** Returns the resource name for the given include list entry
478 * \pre index < IncludeCount()
479 */
480 const char* GetInclude( int index ) const;
481
482 /** Removes a entry from the include list
483 * This will reduce the IncludeCount()
484 * \pre index < IncludeCount()
485 */
486 void RemoveInclude( unsigned int index );
487
488 /// Removes all entries from the include list
490
491 /// Test a resource name against the filter
492 virtual bool PassFilter( const char* name ) const;
493
494 /// assignment operator
496};
497
498/** Template for a ResourceObserver that will call a class method whenever the attribute changes.
499 * Don't use this directly, use GlsRSOLoader::CreateResourceMethodCallback instead.
500 */
501template<class T>
503{
504public:
505 typedef void ( T::*Callback )( disti::RSOInterface2::ResourceHandle ); ///< The class method pointer type that is called.
506
507 /// \param object The object to call the method on.
508 /// \param method The class method to call.
509 ResourceMethodCallback( T* object, Callback method )
510 : _method( method )
511 , _object( object )
512 {
513 }
514
515 /// Calls the method on the object.
516 /// \param handle The resource that changed.
518 {
519 ( _object->*( _method ) )( handle );
520 }
521
522 /// Frees this observer.
523 virtual void Destroy()
524 {
525 delete this;
526 }
527
528protected:
529 Callback _method; ///< The class method to call.
530 T* _object; ///< The object to call the method on.
531};
532
533/** Create an ResourceObserver that will call a class method whenever the attribute changes.
534 * \param obj the object to call the method on
535 * \param method a class method pointer
536 */
537template<class Class>
539 Class* const obj,
540 const typename ResourceMethodCallback<Class>::Callback method )
541{
542 return new ResourceMethodCallback<Class>( obj, method );
543}
544
545} // namespace GlsRSOLoader
546
547#endif
Definition: gls_rso_loader.h:371
void ExtractFrustum(disti::RSOInterface1::OpenGLMatrices &currentMatrices)
Culler(bool enabled=true)
Definition: gls_rso_loader.h:387
void LevelsUp(int value)
Definition: gls_rso_loader.h:415
int LevelsUp() const
Definition: gls_rso_loader.h:413
int _groupLevelsDown
See GroupLevelsDown().
Definition: gls_rso_loader.h:390
const char * GetExclude(int index) const
GlsResourceFilter & operator=(const GlsResourceFilter &rhs)
assignment operator
const char * GetInclude(int index) const
void ClearExcludes()
Removes all entries from the exclude list.
void RemoveExclude(unsigned int index)
GlsResourceFilter(GlsResourceFilter &source)
Copy constructor.
void ClearIncludes()
Removes all entries from the include list.
bool NamesOnly() const
Definition: gls_rso_loader.h:439
int IncludeCount() const
Returns the number of includes in the filter.
void NamesOnly(bool value)
Definition: gls_rso_loader.h:441
int _levelsUp
See LevelsUp().
Definition: gls_rso_loader.h:389
virtual bool PassFilter(const char *name) const
Test a resource name against the filter.
bool _namesOnly
See NamesOnly().
Definition: gls_rso_loader.h:393
int GroupLevelsDown() const
Definition: gls_rso_loader.h:431
void AddInclude(const char *name)
void AddExclude(const char *name)
std::vector< std::string > _excludeList
Resource names that will not pass the filter.
Definition: gls_rso_loader.h:391
void RemoveInclude(unsigned int index)
void GroupLevelsDown(int value)
Definition: gls_rso_loader.h:433
int ExcludeCount() const
Returns the number of exclude entries in the filter.
std::vector< std::string > _includeList
Resource names that will pass the filter.
Definition: gls_rso_loader.h:392
Definition: gls_rso_loader.h:354
bool _needsDelete
Whether the matrix data is owned by this object and must be freed.
Definition: gls_rso_loader.h:356
Definition: gls_rso_loader.h:55
RSOReference(disti::RSOInterface1 *, LiveComponentLibRef *, unsigned int)
bool HandleMouseWheelPlus(int x, int y, int buttonMask)
bool GetFloatResource(disti::RSOInterface2::ResourceHandle resourceHandle, double &resourceVal)
disti::RSOInterface1 * GetRSOInterface1()
Definition: gls_rso_loader.h:74
bool SetIntResource(disti::RSOInterface2::ResourceHandle resourceHandle, long resourceVal)
bool HandleKeyUp(int key, int x, int y)
bool HandleMouseUp(int x, int y, int button)
void SetResources(const char *buf)
bool CreateResourceHandle(const char *resourceName, disti::RSOInterface2::ResourceHandle &resourceHandle)
bool GetBoundingBox(disti::RSOInterface1::Vector *min, disti::RSOInterface1::Vector *max, disti::RSOInterface1::MatrixD *transform=0)
bool SetFloatResource(disti::RSOInterface2::ResourceHandle resourceHandle, double resourceVal)
void Draw()
Definition: gls_rso_loader.h:111
bool IsResourceHandleValid(disti::RSOInterface2::ResourceHandle resourceHandle)
const char * GetResource(const char *resourceName)
Definition: gls_rso_loader.h:97
bool SetResource(disti::RSOInterface2::ResourceHandle resourceHandle, const char *resourceVal)
bool ReleaseResourceHandle(disti::RSOInterface2::ResourceHandle resourceHandle)
void SetRedraw(bool redraw)
Definition: gls_rso_loader.h:319
bool GetRedraw()
Definition: gls_rso_loader.h:324
bool HandleKeyDown(int key, int x, int y)
bool UnregisterResourceObserver(disti::RSOInterface2::ResourceHandle resourceHandle, disti::RSOInterface4::CallbackID id)
bool SetFloatResource(const char *resourceName, double resourceVal)
bool HandleMouseDown(int x, int y, int button)
void AbsolutePlacement(bool value)
bool HandleInput(disti::RSOInterface1::Event *ev)
Definition: gls_rso_loader.h:117
void PreDraw(const disti::RSOInterface1::OpenGLMatrices &current, disti::RSOInterface1::Culler &culler)
Definition: gls_rso_loader.h:108
void SetProjection(int controlWidth, int controlHeight, float depthFactor=4.0f, float fov=90.0f, bool perspective=false)
unsigned int GetRSOVersion()
Definition: gls_rso_loader.h:79
bool SetEmittedEventHandler(disti::RSOInterface1::EmittedEventHandler *handler)
Definition: gls_rso_loader.h:124
bool RegisterResourceObserver(disti::RSOInterface2::ResourceHandle resourceHandle, disti::RSOInterface4::ResourceObserver *obs, disti::RSOInterface4::CallbackID &id)
bool GetIntResource(disti::RSOInterface2::ResourceHandle resourceHandle, long &resourceVal)
void Invalidate()
Definition: gls_rso_loader.h:314
bool GetIntResource(const char *resourceName, long &resourceVal)
bool GetResource(disti::RSOInterface2::ResourceHandle resourceHandle, const char *&resourceValue)
bool GetFloatResource(const char *resourceName, double &resourceVal)
void GetBackgroundColor(unsigned char &r, unsigned char &g, unsigned char &b, unsigned char &a)
bool SetIntResource(const char *resourceName, long resourceVal)
bool HandleMouseMove(int x, int y, int buttonMask)
bool HandleMouseWheelMinus(int x, int y, int buttonMask)
void SetResource(const char *resourceName, const char *resourceVal)
Definition: gls_rso_loader.h:85
void Calculate(double time)
Definition: gls_rso_loader.h:503
ResourceMethodCallback(T *object, Callback method)
Definition: gls_rso_loader.h:509
virtual void Call(disti::RSOInterface2::ResourceHandle handle)
Definition: gls_rso_loader.h:517
Callback _method
The class method to call.
Definition: gls_rso_loader.h:529
virtual void Destroy()
Frees this observer.
Definition: gls_rso_loader.h:523
void(T::* Callback)(disti::RSOInterface2::ResourceHandle)
The class method pointer type that is called.
Definition: gls_rso_loader.h:505
T * _object
The object to call the method on.
Definition: gls_rso_loader.h:530
Definition: rso_interface_1.h:315
Definition: rso_interface_1.h:619
Definition: rso_interface_1.h:327
Definition: rso_interface_1.h:219
Definition: rso_interface_1.h:252
Definition: rso_interface_1.h:633
Definition: rso_interface_1.h:186
Definition: rso_interface_1.h:61
virtual bool SetEmittedEventHandler(EmittedEventHandler *handler)=0
virtual void SetResource(const char *resourceName, const char *resourceVal)=0
Set the string value for a given named resource.
virtual void Draw()=0
virtual bool HandleInput(Event *ev)=0
virtual const char * GetResource(const char *resourceName)=0
Get the string value for the given resource.
virtual void PreDraw(const OpenGLMatrices &current, Culler &culler)=0
unsigned int ResourceHandle
Identifies a resource of an RSO instance.
Definition: rso_interface_2.h:65
Definition: rso_interface_4.h:64
unsigned int CallbackID
Type for unique identifiers.
Definition: rso_interface_4.h:79
Definition: rso_interface_5.h:66
Namespace for loading RSOs.
Definition: gls_rso_loader.h:50
RSOReference * LoadRSO(const char *fileName, const char *className=0, bool absolutePlacement=true)
void DestroyRSO(RSOReference *)
void SetOpenGLDefaultState(bool pushState)
disti::RSOInterface4::ResourceObserver * CreateResourceMethodCallback(Class *const obj, const typename ResourceMethodCallback< Class >::Callback method)
Definition: gls_rso_loader.h:538
void RestoreOpenGLState()
Defines the RSO interface v5, which extends v4 to add conditional rendering support.