Om  1.0.0
A universal framework for multimedia simulation
Public Types | Public Member Functions | Static Public Member Functions | List of all members
om::graphics::base::RenderFlags Class Reference

A class that encapsulates different boolean parameters for a rendering operation. More...

#include <omGraphicsRenderFlags.h>

Public Types

enum  Flag {
  UNDEFINED = 0, RED_WRITE = 1 << 0, GREEN_WRITE = 1 << 1, BLUE_WRITE = 1 << 2,
  ALPHA_WRITE = 1 << 3, COLOR_WRITE = RED_WRITE | GREEN_WRITE | BLUE_WRITE | ALPHA_WRITE, DEPTH_WRITE = 1 << 4, DEPTH_TEST = 1 << 5,
  STENCIL_TEST = 1 << 6, BLENDING = 1 << 8, TRANSPARENCY_DEPTH_SORT = 1 << 9, BACK_FACE_CULLING = 1 << 10,
  FRONT_FACE_CULLING = 1 << 11, SLOPE_SCALED_DEPTH_BIAS = 1 << 12, GAMMA_CORRECTION = 1 << 13
}
 An enum that specifies the different render flags. More...
 

Public Member Functions

 RenderFlags ()
 Create a new render flags object with no flags set. More...
 
 RenderFlags (Flag flag)
 Create a new render flags object with the specified flag value initially set. More...
 
 RenderFlags (UInt32 newFlags)
 Create a new render flags object with the specified initial combined flags value. More...
 
 operator UInt32 () const
 Convert this render flags object to an integer value. More...
 
Bool isSet (Flag flag) const
 Return whether or not the specified flag value is set for this flags object. More...
 
void set (Flag flag, Bool newIsSet=true)
 Set whether or not the specified flag value is set for this flags object. More...
 

Static Public Member Functions

static String toString (Flag flag)
 Convert the specified flag to human-readable string representation. More...
 

Detailed Description

A class that encapsulates different boolean parameters for a rendering operation.

These flags provide boolean information about a rendering state. Flags are indicated by setting a single bit of a 32-bit unsigned integer to 1.

Enum values for the different flags are defined as members of the class. Typically, the user would bitwise-OR the flag enum values together to produce a final set of set flags.

Member Enumeration Documentation

An enum that specifies the different render flags.

Enumerator
UNDEFINED 

The flag value when all flags are not set.

RED_WRITE 

A flag indicating that color writing to red channel is enabled.

GREEN_WRITE 

A flag indicating that color writing to green channel is enabled.

BLUE_WRITE 

A flag indicating that color writing to blue channel is enabled.

ALPHA_WRITE 

A flag indicating that color writing to alpha channel is enabled.

COLOR_WRITE 

A flag indicating that color writing to all channels is enabled.

DEPTH_WRITE 

A flag indicating that depth buffer writing is enabled.

DEPTH_TEST 

A flag indicating that the depth test should be performed and depth buffer updated.

STENCIL_TEST 

A flag indicating that the stencil test should be performed and stencil buffer updated.

BLENDING 

A flag indicating that blending should be performed.

TRANSPARENCY_DEPTH_SORT 

A flag indicating that the shader needs to be drawn in back-to-front order.

BACK_FACE_CULLING 

A flag indicating that back-face culling should be performed.

If a face's normal points away from the camera, it is not drawn if this flag is set.

FRONT_FACE_CULLING 

A flag indicating that front-face culling should be performed.

If a face's normal points toward the camera, it is not drawn if this flag is set.

SLOPE_SCALED_DEPTH_BIAS 

A flag that indicates that slope-scaled depth biasing should be applied.

GAMMA_CORRECTION 

A flag that indicates that the color values written to the framebuffer are in linear space and should have gamma applied.

This means that color values are raised to the power of (1/2.2) in order to convert them from a linear to sRGB color space for correct monitor output. In order for this rendering to look correct, textures must be supplied in the correct color space for the shader (usually linear).

Constructor & Destructor Documentation

om::graphics::base::RenderFlags::RenderFlags ( )
inline

Create a new render flags object with no flags set.

om::graphics::base::RenderFlags::RenderFlags ( Flag  flag)
inline

Create a new render flags object with the specified flag value initially set.

om::graphics::base::RenderFlags::RenderFlags ( UInt32  newFlags)
inline

Create a new render flags object with the specified initial combined flags value.

Member Function Documentation

om::graphics::base::RenderFlags::operator UInt32 ( ) const
inline

Convert this render flags object to an integer value.

This operator is provided so that the RenderFlags object can be used as an integer value for bitwise logical operations.

Bool om::graphics::base::RenderFlags::isSet ( Flag  flag) const
inline

Return whether or not the specified flag value is set for this flags object.

void om::graphics::base::RenderFlags::set ( Flag  flag,
Bool  newIsSet = true 
)
inline

Set whether or not the specified flag value is set for this flags object.

static String om::graphics::base::RenderFlags::toString ( Flag  flag)
static

Convert the specified flag to human-readable string representation.


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