| GL Studio C++ Runtime API

Public Types | Public Member Functions | Protected Member Functions | List of all members
RSOInterface2 Class Referenceabstract

`#include <rso_interface_2.h>`

Inheritance diagram for RSOInterface2:

## Public Types
typedef unsigned int | ResourceHandle
| Typedef for a unique resource identifier.

## Public Member Functions
virtual ResourceHandle | CreateResourceHandle (const char *resourceName)=0
virtual void | ReleaseResourceHandle (ResourceHandle resourceHandle)=0
virtual bool | IsResourceHandleValid (ResourceHandle resourceHandle)=0
virtual void | SetResource (ResourceHandle resourceHandle, const char *resourceVal)=0
virtual const char * | GetResource (ResourceHandle resourceHandle)=0
virtual void | SetIntResource (const char *resourceName, long resourceVal)=0
virtual long | GetIntResource (const char *resourceName)=0
virtual void | SetIntResource (ResourceHandle handle, long resourceVal)=0
virtual long | GetIntResource (ResourceHandle resourceHandle)=0
virtual void | SetFloatResource (const char *resourceName, double resourceVal)=0
virtual double | GetFloatResource (const char *resourceName)=0
virtual void | SetFloatResource (ResourceHandle handle, double resourceVal)=0
virtual double | GetFloatResource (ResourceHandle resourceHandle)=0
virtual const char * | GetResource (const char *resourceName)=0
virtual void | SetResource (const char *resourceName, const char *resourceVal)=0
Public Member Functions inherited from RSOInterface1
virtual void | Calculate (double time)=0
| The RSO Interface methods. More...
virtual void | PreDraw (const OpenGLMatrices &current, Culler &culler)=0
virtual void | Draw ()=0
virtual void | SetResource (const char *resourceName, const char *resourceVal)=0
virtual const char * | GetResource (const char *resourceName)=0
virtual const char * | GetResources (ResourceFilter *filter=0)=0
virtual bool | HandleInput (Event *ev)=0
virtual bool | SetEmittedEventHandler (EmittedEventHandler *handler)=0
virtual bool | Pick3D (const Vector &winLoc, const Vector &logicalCoords, float scale, const Vector &directionVector, Vector &collisionWinLoc, const OpenGLMatrices &drawnMatrices)=0
virtual bool | GetBoundingSphere (Vector *center, float *radius)=0
virtual bool | GetBoundingBox (Vector *min, Vector *max, const MatrixD *transform=0)=0
virtual RSOInterface1 * | CloneObject ()=0
virtual void | DeleteInstance ()=0
| Safely delete the object.

## Protected Member Functions
virtual | ~RSOInterface2 ()
| Protected destructor so it can't be deleted directly.
Protected Member Functions inherited from RSOInterface1
virtual | ~RSOInterface1 ()
| Protected destructor so it can't be deleted directly.

## Additional Inherited Members
Static Public Member Functions inherited from RSOInterface1
static unsigned int | strlen (const char *str)
static char * | strcpy (char *dest, const char *src)

## Detailed Description

The RSOInterface2 class defines an abstract interface to an RSO instance.

## Member Function Documentation

## ◆ CreateResourceHandle()

virtual ResourceHandle CreateResourceHandle | ( | const char * | resourceName | ) |
| pure virtual

Obtains a resource handle to a given named resource This handle must be disposed of with the ReleaseResourceHandle method once it is no longer needed. If this method fails, the return value will not be a valid handle; this can be determined by calling IsResourceHandleValid.

Parameters

  resourceName | The resource name to create a handle for.

Returns
  A handle to the desired resource.

## ◆ GetFloatResource() [1/2]

virtual double GetFloatResource | ( | const char * | resourceName | ) |
| pure virtual

Returns
  The value as a float for a given named resource.

Parameters

  resourceName | The name to return the float value for.

## ◆ GetFloatResource() [2/2]

virtual double GetFloatResource | ( | ResourceHandle | resourceHandle | ) |
| pure virtual

Returns
  The value as a float for a resource specified by handle.

Parameters

  resourceHandle | The handle to return the integer value for.

## ◆ GetIntResource() [1/2]

virtual long GetIntResource | ( | const char * | resourceName | ) |
| pure virtual

Returns
  The value as an integer for a given named resource.

Parameters

  resourceName | The name to return the integer value for.

## ◆ GetIntResource() [2/2]

virtual long GetIntResource | ( | ResourceHandle | resourceHandle | ) |
| pure virtual

Returns
  The value as an integer for a resource specified by handle.

Parameters

  resourceHandle | The handle to return the integer value for.

## ◆ GetResource() [1/2]

virtual const char * GetResource | ( | const char * | resourceName | ) |
| virtual

Get the string value for the given resource

Parameters

  resourceName | The name of the resource whose value is to be returned.

Returns
  The string value for the given resource, or empty string if not found.

Implements RSOInterface1.

## ◆ GetResource() [2/2]

virtual const char * GetResource | ( | ResourceHandle | resourceHandle | ) |
| pure virtual

Returns
  The string value for a resource specified by handle.

Parameters

  resourceHandle | The handle to return the string value for.

## ◆ IsResourceHandleValid()

virtual bool IsResourceHandleValid | ( | ResourceHandle | resourceHandle | ) |
| pure virtual

Checks if a given resource handle is valid.

Parameters

  resourceHandle | The resource handle to check.

Returns
  Whether or not the handle is valid.

## ◆ ReleaseResourceHandle()

virtual void ReleaseResourceHandle | ( | ResourceHandle | resourceHandle | ) |
| pure virtual

Disposes of a resource handle.

Parameters

  resourceHandle | The resource handle to release.

## ◆ SetFloatResource() [1/2]

virtual void SetFloatResource | ( | const char * | resourceName,
|  | double | resourceVal
| ) |  |
| pure virtual

Set the value as a float for a given named resource.

Parameters

  resourceName | The name of the resource to set.
  resourceVal | The new float value to set.

## ◆ SetFloatResource() [2/2]

virtual void SetFloatResource | ( | ResourceHandle | handle,
|  | double | resourceVal
| ) |  |
| pure virtual

Set the value as a float for a resource specified by handle.

Parameters

  handle | The handle of the resource to set.
  resourceVal | The new float value to set.

## ◆ SetIntResource() [1/2]

virtual void SetIntResource | ( | const char * | resourceName,
|  | long | resourceVal
| ) |  |
| pure virtual

Set the value as an integer for a given named resource.

Parameters

  resourceName | The name of the resource to set.
  resourceVal | The new integer value to set.

## ◆ SetIntResource() [2/2]

virtual void SetIntResource | ( | ResourceHandle | handle,
|  | long | resourceVal
| ) |  |
| pure virtual

Set the value as an integer for a resource specified by handle.

Parameters

  handle | The handle of the resource to set.
  resourceVal | The new integer value to set.

## ◆ SetResource() [1/2]

virtual void SetResource | ( | const char * | resourceName,
|  | const char * | resourceVal
| ) |  |
| virtual

Set the string value for a given named resource.

Parameters

  resourceName | The name of the resource to set.
  resourceVal | The new string value to set for the resource.

Implements RSOInterface1.

## ◆ SetResource() [2/2]

virtual void SetResource | ( | ResourceHandle | resourceHandle,
|  | const char * | resourceVal
| ) |  |
| pure virtual

Set the string value for a resource specified by handle

Parameters

  resourceHandle | The handle of the resource to set.
  resourceVal | The new string value to set.

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

- rso_interface_2.h