Derm.Render.RenderSurface Class Reference

Render surface interface. More...

Inheritance diagram for Derm.Render.RenderSurface:
Derm.Render.RenderFramebuffer Derm.Render.RenderWindow

List of all members.

Public Types

enum  BufferPolicy {
  DontCare,
  Required,
  RequiredAndDegradable
}
 

Buffer definition policy.

More...
enum  BufferType {
  Color = 0x0001,
  Depth = 0x0002,
  Stencil = 0x0004,
  Multisample = 0x0008,
  Double = 0x0010,
  Stereo = 0x0020
}
 

Buffer definitions.

More...

Public Member Functions

void Clear (RenderContext ctx)
 Clear all Surface buffers.
void DefineColorBuffer (int bits, BufferPolicy policy)
 Define RenderSurface color buffer.
void DefineDepthBuffer (int bits, BufferPolicy policy)
 Define RenderSurface depth buffer.
void DefineDoubleBuffers (bool flag, BufferPolicy policy)
 Define double buffered RenderSurface.
void DefineMultisampleBuffer (int bits, BufferPolicy policy)
 Define RenderSurface multisample buffer.
void DefineStencilBuffer (int bits, BufferPolicy policy)
 Define RenderSurface depth buffer.
void DefineStereoBuffers (bool flag, BufferPolicy policy)
 Define double buffered RenderSurface.
BufferType GetClearBuffers ()
abstract IntPtr GetDeviceContext ()
 Obtain device context associated with this RenderSurface.
bool HasBuffer (BufferType sBuffer)
 Determine whether this RenderSurface has allocated a certain buffer.
abstract void SwapSurface ()
 Swap render surface.

Static Public Member Functions

static void Clear (RenderContext ctx, BufferType bTypes)
 Clear specified Surface buffers.

Protected Member Functions

 RenderSurface (int w, int h)
 RenderSurface constructor.
RenderContext.PixelFormat ChoosePixelFormat (IntPtr rDevice)
 Obtain best macthing surface configuration supported by actual implementation.
bool IsDegradableBuffer (BufferType sBuffer)
 Determine whether a RenderSurface buffer is degradable.
bool IsIgnoredBuffer (BufferType sBuffer)
 Determine whether a buffer was requested.
bool IsRequiredBuffer (BufferType sBuffer)
 Determine whether a RenderSurface buffer is required.
void SetBufferConfiguration (RenderContext.PixelFormat pFormat)
 Confirm pixel format assigned to this surface.
abstract bool ValidPixelFormat (RenderContext.PixelFormat pFormat)
 Derived implementation status for passing surface pixel format.

Protected Attributes

bool mSizeChanged = true
 Flag indicating whether surface extents are changed.

Properties

float AspectRatio [get]
 RenderSurface aspect ratio property.
int ColorBits [get]
 Obtain RenderSurface color buffer format.
int DepthBits [get]
bool DoubleBuffers [get]
bool ExtentsChanged [get, set]
 Property for checking extents changes.
int Height [get, set]
 RenderSurface height property.
int MultisampleBits [get]
int StencilBits [get]
bool StereoBuffers [get]
abstract bool Swappable [get]
 Determine whether this surface has to be swapped.
int Width [get, set]
 RenderSurface width property.

Detailed Description

Render surface interface.

A RenderSurface is able to store the result of a rendering operation. This class represents the final component of a RenderPipeline, but it could be used as data source for another RenderPipeline.

A RenderSurface is defined by a set of buffers; each buffer is defined by a type, which specify the how use the buffer contents. Each buffer type defines the available formats for data storage.


Member Enumeration Documentation

Buffer definition policy.

Enumerator:
DontCare 

The buffer definition is completely optional. Other parameters will be preponderant in the buffer configuratuion matching.

Required 

The buffer definition is required to match. Allowed buffers configuration that don't satify buffer definition are not considered.

RequiredAndDegradable 

The buffer definition is required, but a minor definition is allowed to consider buffer configuration.

Buffer definitions.

This enumeration specify surface buffers available of each RenderSurface, or duplication of defined buffers for double buffering or stereoscopic buffers.

Enumerator:
Color 

Surface has color buffer.

Depth 

Surface has depth buffer.

Stencil 

Surface has stencil buffer.

Multisample 

Multisample buffer.

Double 

Double buffers (front and back).

Stereo 

Stereo buffers (left and right buffers).


Constructor & Destructor Documentation

Derm.Render.RenderSurface.RenderSurface ( int  w,
int  h 
) [protected]

RenderSurface constructor.

Parameters:
w A System.Int32
h A System.Int32

Member Function Documentation

RenderContext.PixelFormat Derm.Render.RenderSurface.ChoosePixelFormat ( IntPtr  rDevice  )  [protected]

Obtain best macthing surface configuration supported by actual implementation.

Parameters:
rDevice Surface device context.
Returns:
It returns the closest macthing pixel format to this Surface configuration.
Exceptions:
System.Exception This exception is thrown when no pixel format was found for matching surface buffer configuration using the specified buffer policy.

Each system offer a limited number of possible configuration, which has to be choosen to allocated correctly a system Surface. These pixel formats are fetched during the static constructor of RenderContext, and this routine selects one of the available pixel format.

static void Derm.Render.RenderSurface.Clear ( RenderContext  ctx,
BufferType  bTypes 
) [static]

Clear specified Surface buffers.

Parameters:
ctx A RenderContext
bTypes A System.Int32
void Derm.Render.RenderSurface.Clear ( RenderContext  ctx  ) 

Clear all Surface buffers.

Parameters:
ctx A RenderContext
void Derm.Render.RenderSurface.DefineColorBuffer ( int  bits,
BufferPolicy  policy 
)

Define RenderSurface color buffer.

Parameters:
bits A System.Int32
policy A BufferPolicy
void Derm.Render.RenderSurface.DefineDepthBuffer ( int  bits,
BufferPolicy  policy 
)

Define RenderSurface depth buffer.

Parameters:
bits A System.Int32
policy A BufferPolicy
void Derm.Render.RenderSurface.DefineDoubleBuffers ( bool  flag,
BufferPolicy  policy 
)

Define double buffered RenderSurface.

Parameters:
flag A System.Boolean
policy A BufferPolicy
void Derm.Render.RenderSurface.DefineMultisampleBuffer ( int  bits,
BufferPolicy  policy 
)

Define RenderSurface multisample buffer.

Parameters:
bits A System.Int32
policy A BufferPolicy
void Derm.Render.RenderSurface.DefineStencilBuffer ( int  bits,
BufferPolicy  policy 
)

Define RenderSurface depth buffer.

Parameters:
bits A System.Int32
policy A BufferPolicy
void Derm.Render.RenderSurface.DefineStereoBuffers ( bool  flag,
BufferPolicy  policy 
)

Define double buffered RenderSurface.

Parameters:
flag A System.Boolean
policy A BufferPolicy
BufferType Derm.Render.RenderSurface.GetClearBuffers (  ) 
abstract IntPtr Derm.Render.RenderSurface.GetDeviceContext (  )  [pure virtual]

Obtain device context associated with this RenderSurface.

Returns:
A IntPtr

Implemented in Derm.Render.RenderFramebuffer, and Derm.Render.RenderWindow.

bool Derm.Render.RenderSurface.HasBuffer ( BufferType  sBuffer  ) 

Determine whether this RenderSurface has allocated a certain buffer.

Parameters:
sBuffer A System.Int32 which could be one of the following values:

  • BufferType.Color
  • BufferType.Depth
  • BufferType.Stencil
  • BufferType.Multisample
  • BufferType.Double
  • BufferType.Stereo
Returns:
A System.Boolean indicating whether the buffer specified in sBuffer it was allocated when the routine Allocate was called.
bool Derm.Render.RenderSurface.IsDegradableBuffer ( BufferType  sBuffer  )  [protected]

Determine whether a RenderSurface buffer is degradable.

Parameters:
sBuffer A System.Int32 which could be one of the following values:

  • BufferType.Color
  • BufferType.Depth
  • BufferType.Stencil
  • BufferType.Multisample
  • BufferType.Double
  • BufferType.Stereo
Returns:
A System.Boolean indicating whether the buffer specified in sBuffer it was requested with Surface interface using BufferPolicy.RequiredAndDegradable.
bool Derm.Render.RenderSurface.IsIgnoredBuffer ( BufferType  sBuffer  )  [protected]

Determine whether a buffer was requested.

Parameters:
sBuffer A System.Int32 which could be one of the following values:

  • BufferType.Color
  • BufferType.Depth
  • BufferType.Stencil
  • BufferType.Multisample
  • BufferType.Double
  • BufferType.Stereo
Returns:
A System.Boolean indicating whether the buffer specified in sBuffer it was not requested with Surface interface.
bool Derm.Render.RenderSurface.IsRequiredBuffer ( BufferType  sBuffer  )  [protected]

Determine whether a RenderSurface buffer is required.

Parameters:
sBuffer A System.Int32 which could be one of the following values:

  • BufferType.Color
  • BufferType.Depth
  • BufferType.Stencil
  • BufferType.Multisample
  • BufferType.Double
  • BufferType.Stereo
Returns:
A System.Boolean indicating whether the buffer specified in sBuffer it was requested with Surface interface using BufferPolicy.Required or BufferPolicy.RequiredAndDegradable.
void Derm.Render.RenderSurface.SetBufferConfiguration ( RenderContext.PixelFormat  pFormat  )  [protected]

Confirm pixel format assigned to this surface.

Parameters:
pFormat A RenderContext.PixelFormat defining the available surface buffers and their definitions.

This routine shall be called after a successfull call to SetPixelFormat.

abstract void Derm.Render.RenderSurface.SwapSurface (  )  [pure virtual]

Swap render surface.

Implemented in Derm.Render.RenderFramebuffer, and Derm.Render.RenderWindow.

abstract bool Derm.Render.RenderSurface.ValidPixelFormat ( RenderContext.PixelFormat  pFormat  )  [protected, pure virtual]

Derived implementation status for passing surface pixel format.

Parameters:
pFormat A RenderContext.PixelFormat to be validated by derived implementation.
Returns:
It returns true in the case the pixel format is valid for usage in the derived implementation, otherwise it returns false.

Implemented in Derm.Render.RenderFramebuffer, and Derm.Render.RenderWindow.


Member Data Documentation

bool Derm.Render.RenderSurface.mSizeChanged = true [protected]

Flag indicating whether surface extents are changed.


Property Documentation

float Derm.Render.RenderSurface.AspectRatio [get]

RenderSurface aspect ratio property.

int Derm.Render.RenderSurface.ColorBits [get]

Obtain RenderSurface color buffer format.

Returns:
A PixelType
int Derm.Render.RenderSurface.DepthBits [get]
Returns:
bool Derm.Render.RenderSurface.DoubleBuffers [get]
bool Derm.Render.RenderSurface.ExtentsChanged [get, set]

Property for checking extents changes.

int Derm.Render.RenderSurface.Height [get, set]

RenderSurface height property.

int Derm.Render.RenderSurface.MultisampleBits [get]
Returns:
int Derm.Render.RenderSurface.StencilBits [get]
Returns:
bool Derm.Render.RenderSurface.StereoBuffers [get]
abstract bool Derm.Render.RenderSurface.Swappable [get]

Determine whether this surface has to be swapped.

Reimplemented in Derm.Render.RenderFramebuffer, and Derm.Render.RenderWindow.

int Derm.Render.RenderSurface.Width [get, set]

RenderSurface width property.



Services powered by Get Deus Ex Render Machina at SourceForge.net. Fast, secure and Free Open Source software downloads