Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# XFcResource Class Reference

Resource base class. More...

Inheritance diagram for XFcResource:

[legend]
List of all members.

## Public Member Functions
virtual XFCIMPORT INT | callback (void *aBuffer)
| Called whenever the resource needs to be generated.
virtual XFCIMPORT | ~XFcResource ()
| Virtual destructor.
## Protected Member Functions
| XFcResource ()
| Protected constructor.
void | createResource (const UINT32 aSize, const UINT32 aFlags)
| Creates a resource, size in bytes, with user given flags.
void | createResource (const UINT32 aSize)
| Creates a resource, size in bytes, with default flags.
INT | removeResource ()
| Removes a resource.
void * | lockResource ()
| Locks resource.
INT | unlockResource ()
| Unlocks resource.
## Private Attributes
INT32 | mId
| Unique id.

## Detailed Description

Resource base class.

Defines the resource interface. Resources can be managed by the resource manager in a way so that if the memory manager runs out of memory, the resource manager can destroy resources as it sees fit, and will re-create the resources when they are needed next. Textures, for example, are resources.

See also:
  XFcResourceManager

  XFcGLTexture

## Constructor & Destructor Documentation

virtual XFCIMPORT XFcResource::~XFcResource | ( |  | ) | `[virtual]`

| Virtual destructor.

XFcResource::XFcResource | ( |  | ) | `[protected]`

| Protected constructor. Makes XFcResource an abstract class as there is no public static constructor.

## Member Function Documentation

virtual XFCIMPORT INT XFcResource::callback | ( | void * | aBuffer | ) | `[virtual]`

| Called whenever the resource needs to be generated. aBuffer points to a buffer which is as large as the resource requires (as defined in the createResource() call). The resource manager expects the callback to fill the buffer with the resource data. Returns: 1 if success, 0 if failure. Reimplemented in XFcGLComplexSurfaceResource, and XFcGLSingleSurfaceResource.

void XFcResource::createResource | ( | const UINT32 | aSize | ) | `[protected]`

| Creates a resource, size in bytes, with default flags.

void XFcResource::createResource | ( | const UINT32 | aSize,
|  | const UINT32 | aFlags
| ) | `[protected]`

| Creates a resource, size in bytes, with user given flags.

void* XFcResource::lockResource | ( |  | ) | `[protected]`

| Locks resource.

INT XFcResource::removeResource | ( |  | ) | `[protected]`

| Removes a resource.

INT XFcResource::unlockResource | ( |  | ) | `[protected]`

| Unlocks resource.

## Member Data Documentation

INT32 XFcResource::mId`[private]`

| Unique id.

|  | X-Forge Documentation Confidential Copyright © 2002-2003 Fathammer |  | Documentation generated with doxygen by Dimitri van Heesch