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

# XFcGLResourceSurface Class Reference

Graphics surface class which stores surface as a resource. More...

Inheritance diagram for XFcGLResourceSurface:

[legend]
Collaboration diagram for XFcGLResourceSurface:

[legend]
List of all members.

## Public Member Functions
virtual XFCIMPORT | ~XFcGLResourceSurface ()
| Destructor.
virtual XFCIMPORT INT32 | lock (void **aBuffer, INT32 aMode=XFCGF_DEFAULT, INT32 aFlags=XFCGFX_DISCARDCONTENTS)
| Locks the surface with specific mode.
virtual XFCIMPORT void | unlock ()
| Unlocks the framebuffer.
## Static Public Member Functions
XFCIMPORT XFcGLResourceSurface * | create (const CHAR *aPictureFilename, INT32 aFormat=XFCGF_DEFAULT, INT32 aFlags=XFCRESOURCE_DEFAULT)
| Creates a surface with dimensions and format.
## Protected Member Functions
| XFcGLResourceSurface ()
| Protected constructor.
## Protected Attributes
XFcGLSingleSurfaceResource * | mResource
| Surface resource.
## Friends
class | XFcGLCoreSurface

## Detailed Description

Graphics surface class which stores surface as a resource.

Extends XFcGLSurface so that the surface data itself is a resource, and may be deallocated by the resource manager whenever free memory is required. The surface data is re-created from file when needed. Please note that whatever changes done to the surface may be lost when the resource is removed from memory.

## Constructor & Destructor Documentation

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

| Destructor.

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

| Protected constructor.

## Member Function Documentation

XFCIMPORT XFcGLResourceSurface* XFcGLResourceSurface::create | ( | const CHAR * | aPictureFilename,
|  | INT32 | aFormat = XFCGF_DEFAULT,
|  | INT32 | aFlags = XFCRESOURCE_DEFAULT
| ) | `[static]`

  | Creates a surface with dimensions and format. Parameters:
  aPictureFilename | filename of the picture file.
  aFormat | enumerated surface format.
  See also: XFCGFXFORMAT Parameters:
  aFlags | resource type flags.
See also: XFCRESOURCEFLAGS

virtual XFCIMPORT INT32 XFcGLResourceSurface::lock | ( | void ** | aBuffer,
|  | INT32 | aMode = XFCGF_DEFAULT,
|  | INT32 | aFlags = XFCGFX_DISCARDCONTENTS
| ) | `[virtual]`

  | Locks the surface with specific mode. Non-preferred modes will be converted on the fly, which is slow. If you wish to fill the whole surface you may get some speed gains by using the XFCGFX_DISCARDCONTENTS flag. Not using this flag may cause the system to convert between graphics formats on lock and unlock. If you only wish to read from the surface, use the XFCGFX_DISCARDCHANGES flag. Not doing so may cause loss of data (if locked format has less data than the native format). Note: While the framebuffer is locked, you should not call any graphics library functions. Parameters:
  aBuffer | returned pointer to the surface.
  aFlags | surface lock flags, see XFCGFXFLAGS.
  aMode | graphics format, see XFCGFXFORMAT. Use XFCGF_DEFAULT to lock surface in its own native format.
Returns: Surface pitch in bytes. See also: XFCGFXFORMAT XFCGFXFLAGS Reimplemented from XFcGLSurface.

virtual XFCIMPORT void XFcGLResourceSurface::unlock | ( |  | ) | `[virtual]`

| Unlocks the framebuffer. If the surface was locked in a non-native format and the locking did not specify the GFX_DISCARDCHANGES flag, the unlock will convert the temporary buffer into the surface's native format. See also: lock Reimplemented from XFcGLSurface.

## Friends And Related Function Documentation

friend class XFcGLCoreSurface`[friend]`

| Reimplemented from XFcGLSurface.

## Member Data Documentation

XFcGLSingleSurfaceResource* XFcGLResourceSurface::mResource`[protected]`

| Surface resource.

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