Jopnal Engine  alpha 0.4
Simple Component Based 2D/3D Game Engine
Public Types | Static Public Member Functions | List of all members
jop::GlState Class Reference

#include <GlState.hpp>

Public Types

enum  DepthFunc {
  DepthFunc::Never, DepthFunc::Less, DepthFunc::Equal, DepthFunc::LessEqual,
  DepthFunc::Greater, DepthFunc::NotEqual, DepthFunc::GreaterEqual, DepthFunc::Always
}
 
enum  FaceCull { FaceCull::Front, FaceCull::Back, FaceCull::Both }
 
enum  BlendFunc {
  BlendFunc::Zero, BlendFunc::One, BlendFunc::SrcColor, BlendFunc::OneMinusSrcColor,
  BlendFunc::DstColor, BlendFunc::OneMinusDstColor, BlendFunc::SrcAlpha, BlendFunc::OneMinusSrcAlpha,
  BlendFunc::DstAlpha, BlendFunc::OneMinusDstAlpha, BlendFunc::ConstantColor, BlendFunc::OneMinusConstantColor,
  BlendFunc::ConstantAlpha, BlendFunc::OneMinusConstantAlpha
}
 
enum  PolygonMode { PolygonMode::Fill, PolygonMode::Line, PolygonMode::Point }
 

Static Public Member Functions

static void setDepthTest (const bool enable, const DepthFunc func=DepthFunc::Less)
 Set the depth test. More...
 
static void setFaceCull (const bool enable, const FaceCull cull=FaceCull::Back)
 Set the face culling mode. More...
 
static void setBlendFunc (const bool enable, const BlendFunc srcFactor=BlendFunc::SrcAlpha, const BlendFunc dstFactor=BlendFunc::OneMinusSrcAlpha)
 Set the blend function. More...
 
static void setStencilTest (const bool enable, const DepthFunc func=DepthFunc::Always, const unsigned int mask=0xFFFFFFFF)
 Set the stencil test. More...
 
static void setSeamlessCubemap (const bool enable)
 Enable/disable seamless cube mapping. More...
 
static void setPolygonSmooth (const bool enable)
 Enable/disable polygon smoothing. More...
 
static void setLineSmooth (const bool enable)
 Enable/disable line smoothing. More...
 
static void setLineWidth (const float width)
 Set the line width. More...
 
static void setPolygonMode (const PolygonMode mode)
 Set the polygon rasterization mode. More...
 
static void setVertexAttribute (const bool enable, const unsigned int index)
 Enable/disable vertex attribute. More...
 
static void setDepthWrite (const bool enable)
 Enable/disable depth buffer writing. More...
 
static void flush ()
 Call glFlush. More...
 

Detailed Description

Definition at line 38 of file GlState.hpp.

Member Enumeration Documentation

Blend functions

Enumerator
Zero 
One 
SrcColor 
OneMinusSrcColor 
DstColor 
OneMinusDstColor 
SrcAlpha 
OneMinusSrcAlpha 
DstAlpha 
OneMinusDstAlpha 
ConstantColor 
OneMinusConstantColor 
ConstantAlpha 
OneMinusConstantAlpha 

Definition at line 75 of file GlState.hpp.

Depth functions

Enumerator
Never 
Less 
Equal 
LessEqual 
Greater 
NotEqual 
GreaterEqual 
Always 

Definition at line 52 of file GlState.hpp.

Face culling modes

Enumerator
Front 
Back 
Both 

Definition at line 66 of file GlState.hpp.

Polygon mode

Enumerator
Fill 
Line 
Point 

Definition at line 95 of file GlState.hpp.

Member Function Documentation

static void jop::GlState::flush ( )
static

Call glFlush.

static void jop::GlState::setBlendFunc ( const bool  enable,
const BlendFunc  srcFactor = BlendFunc::SrcAlpha,
const BlendFunc  dstFactor = BlendFunc::OneMinusSrcAlpha 
)
static

Set the blend function.

Parameters
enableEnable blending
srcFactorThe source factor
dstFactorThe destination factor
static void jop::GlState::setDepthTest ( const bool  enable,
const DepthFunc  func = DepthFunc::Less 
)
static

Set the depth test.

Parameters
enableEnable depth test
funcThe depth function
static void jop::GlState::setDepthWrite ( const bool  enable)
static

Enable/disable depth buffer writing.

Parameters
enableEnable depth writes?
static void jop::GlState::setFaceCull ( const bool  enable,
const FaceCull  cull = FaceCull::Back 
)
static

Set the face culling mode.

Parameters
enableEnable face culling
cullThe face culling mode
static void jop::GlState::setLineSmooth ( const bool  enable)
static

Enable/disable line smoothing.

Parameters
enableEnable?
static void jop::GlState::setLineWidth ( const float  width)
static

Set the line width.

Parameters
widthThe new width
static void jop::GlState::setPolygonMode ( const PolygonMode  mode)
static

Set the polygon rasterization mode.

Parameters
modeThe mode
static void jop::GlState::setPolygonSmooth ( const bool  enable)
static

Enable/disable polygon smoothing.

Parameters
enableEnable?
static void jop::GlState::setSeamlessCubemap ( const bool  enable)
static

Enable/disable seamless cube mapping.

Parameters
enableEnable?
static void jop::GlState::setStencilTest ( const bool  enable,
const DepthFunc  func = DepthFunc::Always,
const unsigned int  mask = 0xFFFFFFFF 
)
static

Set the stencil test.

Parameters
enableEnable stencil test
funcThe stencil function
maskThe mask
static void jop::GlState::setVertexAttribute ( const bool  enable,
const unsigned int  index 
)
static

Enable/disable vertex attribute.

Parameters
enableEnable the attribute?
indexThe attribute index

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