Back to index

nux  3.0.0
Public Member Functions | Private Member Functions | Private Attributes
nux::GpuRenderStates Class Reference

#include <GLRenderStates.h>

Collaboration diagram for nux::GpuRenderStates:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 GpuRenderStates (GpuBrand board, GpuInfo *info)
 ~GpuRenderStates ()
void ResetDefault ()
void ResetStateChangeToDefault ()
void CommitStateChangeToDefault ()
void CheckStateChange ()
void SubmitChangeStates ()
void CheckRenderStatesConformity ()
 Check that all render states ar conform to the default.
void SetAlphaTest (bool EnableAlphaTest_, unsigned int AlphaTestFunc_=GL_ALWAYS, BYTE AlphaTestRef_=0)
void SetBlend (bool AlphaBlendEnable_)
void SetBlend (bool AlphaBlendEnable_, unsigned int SrcBlendFactor_, unsigned int DestBlendFactor_)
void GetBlend (unsigned int &AlphaBlendEnable_, unsigned int &SrcBlendFactor_, unsigned int &DestBlendFactor_)
void SetSeparateBlend (bool _bEnable, unsigned int SrcBlendFactor_, unsigned int DestBlendFactor_, unsigned int SrcFactorAlpha_, unsigned int DestFactorAlpha_)
void SetPremultipliedBlend (PorterDuffOperator op)
void SetBlendOp (unsigned int BlendOp=GL_FUNC_ADD)
void SetSeparateBlendOp (unsigned int BlendOpRGB_=GL_FUNC_ADD, unsigned int BlendOpAlpha_=GL_FUNC_ADD)
void SetCullMode (bool EnableCullFace, unsigned int FrontFace_=GL_CCW, unsigned int Cullface_=GL_BACK)
void SetDepthTest (bool EnableDepthTest, unsigned int WriteEnable_=GL_TRUE, unsigned int DepthFunc_=GL_LEQUAL)
void SetDepthRange (float zNear=0.0f, float zFar=1.0f)
void SetStencil (bool enable_stencil)
void SetStencilFunc (unsigned int func, int ref, unsigned int mask)
void SetStencilOp (unsigned int stencil_fail, unsigned int stencil_pass_depth_fail, unsigned int stencil_pass_depth_pass)
void EnableLineSmooth (bool EnableLineSmooth=TRUE, unsigned int LineWidth=1, unsigned int HINT=GL_FASTEST)
void EnablePointSmooth (bool EnablePointSmooth=TRUE, unsigned int PointSize=1, unsigned int HINT=GL_FASTEST)
void SetColorMask (unsigned int bRed=TRUE, unsigned int bGreen=TRUE, unsigned int bBlue=TRUE, unsigned int bAlpha=TRUE)
void GetColorMask (unsigned int &bRed, unsigned int &bGreen, unsigned int &bBlue, unsigned int &bAlpha)
void SetDepthMask (unsigned int bDepth=TRUE)
void EnableScissor (unsigned int bScissor=FALSE)
void EnableFog (unsigned int bFog=FALSE)
void SetPolygonMode (unsigned int FrontMode=GL_FILL, unsigned int BackMode=GL_FILL)
void SetPolygonOffset (unsigned int bEnable, float Factor=0.0f, float Units=0.0f)

Private Member Functions

void HW__EnableAlphaTest (unsigned int b)
void HW__SetAlphaTestFunc (unsigned int AlphaTestFunc_, BYTE AlphaTestRef_)
void HW__EnableAlphaBlend (unsigned int b)
void HW__SetSeparateAlphaBlend_Enable (unsigned int b)
void HW__SetSeparateAlphaBlendFactors (unsigned int SrcBlendFactor_, unsigned int DestBlendFactor_, unsigned int SrcFactorAlpha_, unsigned int DestFactorAlpha_)
void HW__SetAlphaBlendOp (unsigned int BlendOpRGB_, unsigned int BlendOpAlpha_)
void HW__EnableCulling (unsigned int b)
void HW__SetFrontFace (unsigned int FrontFace_)
void HW__SetCullFace (unsigned int CullFace_)
void HW__SetEnableDepthTest (unsigned int b)
void HW__SetDepthFunc (unsigned int Func)
void HW__SetDepthRange (float zNear, float zFar)
void HW__EnableStencil (unsigned int b)
void HW__SetStencilOp (unsigned int FailOp_, unsigned int ZFailOp_, unsigned int ZPassOp_)
void HW__SetStencilFunc (unsigned int func, int ref, unsigned int mask)
void HW__EnableLineSmooth (unsigned int EnableLineSmooth)
void HW__SetLineWidth (unsigned int width, unsigned int HINT)
void HW__EnablePointSmooth (unsigned int EnablePointSmooth)
void HW__SetPointSize (unsigned int size, unsigned int HINT)
void HW__SetColorMask (unsigned int bRed, unsigned int bGreen, unsigned int bBlue, unsigned int bAlpha)
void HW__SetDepthMask (unsigned int bDepth)
void HW__EnableScissor (unsigned int bScissor)
void HW__EnableFog (unsigned int bFog)
void HW__SetPolygonMode (unsigned int FrontMode, unsigned int BackMode)
void HW__EnablePolygonOffset (unsigned int EnablePolygonOffset)
void HW__SetPolygonOffset (float Factor, float Units)

Private Attributes

GpuBrand _gpu_brand
GpuInfo_gpu_info
RenderStateMap render_state_changes_ [GFXRS_MAX_RENDERSTATES]
RenderStateMap sampler_state_changes_ [4][GFXSS_MAX_SAMPLERSTATES]

Detailed Description

Definition at line 140 of file GLRenderStates.h.


Constructor & Destructor Documentation

Definition at line 114 of file GLRenderStates.cpp.

Here is the call graph for this function:

Definition at line 121 of file GLRenderStates.cpp.

  {

  }

Member Function Documentation

Check that all render states ar conform to the default.

Definition at line 272 of file GLRenderStates.cpp.

  {
    for (unsigned int i = 0; i < GFXRS_MAX_RENDERSTATES; i++)
    {
      if (render_state_changes_[i].Checked &&
          ((render_state_changes_[i].iValue != s_StateLUT.default_render_state[i].iValue) ||
            (render_state_changes_[i].fValue != s_StateLUT.default_render_state[i].fValue)))
      {
        render_state_changes_[i].iValue = s_StateLUT.default_render_state[i].iValue;
        render_state_changes_[i].fValue = s_StateLUT.default_render_state[i].fValue;
        nuxError("[GpuRenderStates::Check] Render state doesn't have default value");
      }
    }
  }

Here is the caller graph for this function:

void nux::GpuRenderStates::EnableFog ( unsigned int  bFog = FALSE) [inline]

Definition at line 813 of file GLRenderStates.h.

Here is the call graph for this function:

void nux::GpuRenderStates::EnableLineSmooth ( bool  EnableLineSmooth = TRUE,
unsigned int  LineWidth = 1,
unsigned int  HINT = GL_FASTEST 
) [inline]

Definition at line 719 of file GLRenderStates.h.

Here is the call graph for this function:

void nux::GpuRenderStates::EnablePointSmooth ( bool  EnablePointSmooth = TRUE,
unsigned int  PointSize = 1,
unsigned int  HINT = GL_FASTEST 
) [inline]

Definition at line 744 of file GLRenderStates.h.

Here is the call graph for this function:

void nux::GpuRenderStates::EnableScissor ( unsigned int  bScissor = FALSE) [inline]

Definition at line 805 of file GLRenderStates.h.

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::GpuRenderStates::GetBlend ( unsigned int &  AlphaBlendEnable_,
unsigned int &  SrcBlendFactor_,
unsigned int &  DestBlendFactor_ 
) [inline]

Definition at line 419 of file GLRenderStates.h.

Here is the caller graph for this function:

void nux::GpuRenderStates::GetColorMask ( unsigned int &  bRed,
unsigned int &  bGreen,
unsigned int &  bBlue,
unsigned int &  bAlpha 
) [inline]
void nux::GpuRenderStates::HW__EnableAlphaBlend ( unsigned int  b) [inline, private]

Definition at line 891 of file GLRenderStates.h.

  {
    if (b)
    {
      CHECKGL(glEnable(GL_BLEND));
    }
    else
    {
      CHECKGL(glDisable(GL_BLEND));
    }

    SET_RS_VALUE(render_state_changes_[GFXRS_ALPHABLENDENABLE], b ? GL_TRUE : GL_FALSE);
  }

Here is the caller graph for this function:

void nux::GpuRenderStates::HW__EnableAlphaTest ( unsigned int  b) [inline, private]

Definition at line 854 of file GLRenderStates.h.

  {
#ifndef NUX_OPENGLES_20
    if (b)
    {
      CHECKGL(glEnable(GL_ALPHA_TEST));
    }
    else
    {
      CHECKGL(glDisable(GL_ALPHA_TEST));
    }

    SET_RS_VALUE(render_state_changes_[GFXRS_ALPHATESTENABLE], b ? GL_TRUE : GL_FALSE);
#endif
  }

Here is the caller graph for this function:

void nux::GpuRenderStates::HW__EnableCulling ( unsigned int  b) [inline, private]

Definition at line 984 of file GLRenderStates.h.

  {
    if (b)
    {
      CHECKGL(glEnable(GL_CULL_FACE));
    }
    else
    {
      CHECKGL(glDisable(GL_CULL_FACE));
    }

    SET_RS_VALUE(render_state_changes_[GFXRS_CULLFACEENABLE], b ? GL_TRUE : GL_FALSE);
  }

Here is the caller graph for this function:

void nux::GpuRenderStates::HW__EnableFog ( unsigned int  bFog) [inline, private]

Definition at line 1438 of file GLRenderStates.h.

  {
#ifndef NUX_OPENGLES_20
    if (bFog)
    {
      CHECKGL(glEnable(GL_FOG));
    }
    else
    {
      CHECKGL(glDisable(GL_FOG));
    }

    SET_RS_VALUE(render_state_changes_[GFXRS_FOGENABLE], bFog ? GL_TRUE : GL_FALSE);
#endif
  }

Here is the caller graph for this function:

void nux::GpuRenderStates::HW__EnableLineSmooth ( unsigned int  EnableLineSmooth) [inline, private]

Definition at line 1340 of file GLRenderStates.h.

  {
#ifndef NUX_OPENGLES_20
    if (EnableLineSmooth)
    {
      CHECKGL(glEnable(GL_LINE_SMOOTH));
    }
    else
    {
      CHECKGL(glDisable(GL_LINE_SMOOTH));
    }

    SET_RS_VALUE(render_state_changes_[GFXRS_LINESMOOTHENABLE], EnableLineSmooth ? GL_TRUE : GL_FALSE);
#endif
  }

Here is the caller graph for this function:

void nux::GpuRenderStates::HW__EnablePointSmooth ( unsigned int  EnablePointSmooth) [inline, private]

Definition at line 1373 of file GLRenderStates.h.

  {
#ifndef NUX_OPENGLES_20
    if (EnablePointSmooth)
    {
      CHECKGL(glEnable(GL_POINT_SMOOTH));
    }
    else
    {
      CHECKGL(glDisable(GL_POINT_SMOOTH));
    }

    SET_RS_VALUE(render_state_changes_[GFXRS_POINTSMOOTHENABLE], EnablePointSmooth ? GL_TRUE : GL_FALSE);
#endif
  }

Here is the caller graph for this function:

void nux::GpuRenderStates::HW__EnablePolygonOffset ( unsigned int  EnablePolygonOffset) [inline, private]

Definition at line 1477 of file GLRenderStates.h.

  {
    if (EnablePolygonOffset)
    {
      CHECKGL(glEnable(GL_POLYGON_OFFSET_FILL));
    }
    else
    {
      CHECKGL(glDisable(GL_POLYGON_OFFSET_FILL));
    }

    SET_RS_VALUE(render_state_changes_[GL_POLYGON_OFFSET_FILL], EnablePolygonOffset ? GL_TRUE : GL_FALSE);
  }

Here is the caller graph for this function:

void nux::GpuRenderStates::HW__EnableScissor ( unsigned int  bScissor) [inline, private]

Definition at line 1424 of file GLRenderStates.h.

  {
    if (bScissor)
    {
      CHECKGL(glEnable(GL_SCISSOR_TEST));
    }
    else
    {
      CHECKGL(glDisable(GL_SCISSOR_TEST));
    }

    SET_RS_VALUE(render_state_changes_[GFXRS_SCISSORTESTENABLE], bScissor ? GL_TRUE : GL_FALSE);
  }

Here is the caller graph for this function:

void nux::GpuRenderStates::HW__EnableStencil ( unsigned int  b) [inline, private]

Definition at line 1060 of file GLRenderStates.h.

  {
    if (b)
    {
      CHECKGL(glEnable(GL_STENCIL_TEST));
    }
    else
    {
      CHECKGL(glDisable(GL_STENCIL_TEST));
    }

    SET_RS_VALUE(render_state_changes_[GFXRS_STENCILENABLE], b ? GL_TRUE : GL_FALSE);
  }

Here is the caller graph for this function:

void nux::GpuRenderStates::HW__SetAlphaBlendOp ( unsigned int  BlendOpRGB_,
unsigned int  BlendOpAlpha_ 
) [inline, private]

Definition at line 932 of file GLRenderStates.h.

  {
#ifdef NUX_OPENGLES_20
    nuxAssertMsg(
      (BlendOpRGB_ == GL_FUNC_ADD) ||
      (BlendOpRGB_ == GL_FUNC_SUBTRACT) ||
      (BlendOpRGB_ == GL_FUNC_REVERSE_SUBTRACT),
      "Error(HW__SetAlphaBlendOp): Invalid Blend Equation RenderState");
    nuxAssertMsg(
      (BlendOpAlpha_ == GL_FUNC_ADD) ||
      (BlendOpAlpha_ == GL_FUNC_SUBTRACT) ||
      (BlendOpAlpha_ == GL_FUNC_REVERSE_SUBTRACT),
      "Error(HW__SetAlphaBlendOp): Invalid Blend Equation RenderState");

    CHECKGL(glBlendEquationSeparate(BlendOpRGB_, BlendOpAlpha_));

#else
    nuxAssertMsg(
      (BlendOpRGB_ == GL_FUNC_ADD) ||
      (BlendOpRGB_ == GL_FUNC_SUBTRACT) ||
      (BlendOpRGB_ == GL_FUNC_REVERSE_SUBTRACT) ||
      (BlendOpRGB_ == GL_MIN) ||
      (BlendOpRGB_ == GL_MAX),
      "Error(HW__SetAlphaBlendOp): Invalid Blend Equation RenderState");
    nuxAssertMsg(
      (BlendOpAlpha_ == GL_FUNC_ADD) ||
      (BlendOpAlpha_ == GL_FUNC_SUBTRACT) ||
      (BlendOpAlpha_ == GL_FUNC_REVERSE_SUBTRACT) ||
      (BlendOpAlpha_ == GL_MIN) ||
      (BlendOpAlpha_ == GL_MAX),
      "Error(HW__SetAlphaBlendOp): Invalid Blend Equation RenderState");

    if (_gpu_info->SupportOpenGL20())
    {
      CHECKGL(glBlendEquationSeparate(BlendOpRGB_, BlendOpAlpha_));
    }
    else if (_gpu_info->Support_EXT_Blend_Equation_Separate())
    {
      CHECKGL(glBlendEquationSeparateEXT(BlendOpRGB_, BlendOpAlpha_));
    }
    else
    {
      CHECKGL(glBlendEquation(BlendOpRGB_));
    }
#endif

    SET_RS_VALUE(render_state_changes_[GFXRS_BLENDOP], BlendOpRGB_);
    SET_RS_VALUE(render_state_changes_[GFXRS_BLENDOPALPHA], BlendOpAlpha_);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::GpuRenderStates::HW__SetAlphaTestFunc ( unsigned int  AlphaTestFunc_,
BYTE  AlphaTestRef_ 
) [inline, private]

Definition at line 870 of file GLRenderStates.h.

  {
#ifndef NUX_OPENGLES_20
    nuxAssertMsg(
      (AlphaTestFunc_ == GL_NEVER) ||
      (AlphaTestFunc_ == GL_LESS) ||
      (AlphaTestFunc_ == GL_EQUAL) ||
      (AlphaTestFunc_ == GL_LEQUAL) ||
      (AlphaTestFunc_ == GL_GREATER) ||
      (AlphaTestFunc_ == GL_NOTEQUAL) ||
      (AlphaTestFunc_ == GL_GEQUAL) ||
      (AlphaTestFunc_ == GL_ALWAYS),
      "Error(HW__SetAlphaTestFunc): Invalid Alpha Test Function RenderState");

    CHECKGL(glAlphaFunc(AlphaTestFunc_, (float) AlphaTestRef_ * (1.0f / 255.0f)));
    SET_RS_VALUE(render_state_changes_[GFXRS_ALPHATESTFUNC], AlphaTestFunc_);
    SET_RS_VALUE(render_state_changes_[GFXRS_ALPHATESTREF], AlphaTestRef_);
#endif
  }

Here is the caller graph for this function:

void nux::GpuRenderStates::HW__SetColorMask ( unsigned int  bRed,
unsigned int  bGreen,
unsigned int  bBlue,
unsigned int  bAlpha 
) [inline, private]

Definition at line 1405 of file GLRenderStates.h.

Here is the caller graph for this function:

void nux::GpuRenderStates::HW__SetCullFace ( unsigned int  CullFace_) [inline, private]

Definition at line 1010 of file GLRenderStates.h.

  {
    nuxAssertMsg(
      (CullFace_ == GL_FRONT) ||
      (CullFace_ == GL_BACK) ||
      (CullFace_ == GL_FRONT_AND_BACK),
      "Error(HW__SetCullFace): Invalid Cull Face RenderState");

    CHECKGL(glCullFace(CullFace_));
    SET_RS_VALUE(render_state_changes_[GFXRS_CULLFACE], CullFace_);
  }

Here is the caller graph for this function:

void nux::GpuRenderStates::HW__SetDepthFunc ( unsigned int  Func) [inline, private]

Definition at line 1043 of file GLRenderStates.h.

  {
    nuxAssertMsg(
      (Func == GL_NEVER) ||
      (Func == GL_LESS) ||
      (Func == GL_EQUAL) ||
      (Func == GL_LEQUAL) ||
      (Func == GL_GREATER) ||
      (Func == GL_NOTEQUAL) ||
      (Func == GL_GEQUAL) ||
      (Func == GL_ALWAYS),
      "Error(HW__SetDepthFunc): Invalid Depth Func RenderState");

    CHECKGL(glDepthFunc(Func));
    SET_RS_VALUE(render_state_changes_[GFXRS_ZFUNC], Func);
  }

Here is the caller graph for this function:

void nux::GpuRenderStates::HW__SetDepthMask ( unsigned int  bDepth) [inline, private]

Definition at line 1418 of file GLRenderStates.h.

  {
    CHECKGL(glDepthMask(bDepth));
    SET_RS_VALUE(render_state_changes_[GFXRS_ZWRITEENABLE], bDepth);
  }

Here is the caller graph for this function:

void nux::GpuRenderStates::HW__SetDepthRange ( float  zNear,
float  zFar 
) [inline, private]

Definition at line 1036 of file GLRenderStates.h.

  {
    CHECKGL(glDepthRange(zNear, zFar));
    SET_RS_VALUE(render_state_changes_[GFXRS_ZNEAR], static_cast<unsigned int> (Clamp(zNear, 0.0f, 1.0f)));
    SET_RS_VALUE(render_state_changes_[GFXRS_ZFAR], static_cast<unsigned int> (Clamp(zFar, 0.0f, 1.0f)));
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::GpuRenderStates::HW__SetEnableDepthTest ( unsigned int  b) [inline, private]

Definition at line 1022 of file GLRenderStates.h.

  {
    if (b)
    {
      CHECKGL(glEnable(GL_DEPTH_TEST));
    }
    else
    {
      CHECKGL(glDisable(GL_DEPTH_TEST));
    }

    SET_RS_VALUE(render_state_changes_[GFXRS_ZTESTENABLE], b ? GL_TRUE : GL_FALSE);
  }

Here is the caller graph for this function:

void nux::GpuRenderStates::HW__SetFrontFace ( unsigned int  FrontFace_) [inline, private]

Definition at line 999 of file GLRenderStates.h.

  {
    nuxAssertMsg(
      (FrontFace_ == GL_CW) ||
      (FrontFace_ == GL_CCW),
      "Error(HW__SetFrontFace): Invalid Front Face RenderState");

    CHECKGL(glFrontFace(FrontFace_));
    SET_RS_VALUE(render_state_changes_[GFXRS_FRONTFACE], FrontFace_);
  }

Here is the caller graph for this function:

void nux::GpuRenderStates::HW__SetLineWidth ( unsigned int  width,
unsigned int  HINT 
) [inline, private]

Definition at line 1356 of file GLRenderStates.h.

  {
    nuxAssertMsg(
      (Hint == GL_NICEST) ||
      (Hint == GL_FASTEST) ||
      (Hint == GL_DONT_CARE),
      "Error(HW__SetLineWidth): Invalid Line Hint RenderState");

    CHECKGL(glLineWidth(width));
    SET_RS_VALUE(render_state_changes_[GFXRS_LINEWIDTH], width);

#ifndef NUX_OPENGLES_20
    CHECKGL(glHint(GL_LINE_SMOOTH_HINT, Hint));
    SET_RS_VALUE(render_state_changes_[GFXRS_LINEHINT], Hint);
#endif
  }

Here is the caller graph for this function:

void nux::GpuRenderStates::HW__SetPointSize ( unsigned int  size,
unsigned int  HINT 
) [inline, private]

Definition at line 1389 of file GLRenderStates.h.

  {
#ifndef NUX_OPENGLES_20
    nuxAssertMsg(
      (Hint == GL_NICEST) ||
      (Hint == GL_FASTEST) ||
      (Hint == GL_DONT_CARE),
      "Error(HW__SetPointSize): Invalid Point Hint RenderState");

    CHECKGL(glPointSize(size));
    CHECKGL(glHint(GL_POINT_SMOOTH_HINT, Hint);)
    SET_RS_VALUE(render_state_changes_[GFXRS_POINTSIZE], size);
    SET_RS_VALUE(render_state_changes_[GFXRS_POINTHINT], Hint);
#endif
  }

Here is the caller graph for this function:

void nux::GpuRenderStates::HW__SetPolygonMode ( unsigned int  FrontMode,
unsigned int  BackMode 
) [inline, private]

Definition at line 1454 of file GLRenderStates.h.

  {
#ifndef NUX_OPENGLES_20
    nuxAssertMsg(
      (FrontMode == GL_FILL) ||
      (FrontMode == GL_LINE) ||
      (FrontMode == GL_POINT),
      "Error(HW__SetPolygonMode): Invalid Point Hint RenderState");

    nuxAssertMsg(
      (BackMode == GL_FILL) ||
      (BackMode == GL_LINE) ||
      (BackMode == GL_POINT),
      "Error(HW__SetPolygonMode): Invalid Point Hint RenderState");

    CHECKGL(glPolygonMode(GL_FRONT, FrontMode));
    CHECKGL(glPolygonMode(GL_BACK, BackMode));

    SET_RS_VALUE(render_state_changes_[GFXRS_FRONT_POLYGONMODE], FrontMode);
    SET_RS_VALUE(render_state_changes_[GFXRS_BACK_POLYGONMODE], BackMode);
#endif
  }

Here is the caller graph for this function:

void nux::GpuRenderStates::HW__SetPolygonOffset ( float  Factor,
float  Units 
) [inline, private]

Definition at line 1491 of file GLRenderStates.h.

  {
    CHECKGL(glPolygonOffset(Factor, Units));

    SET_RS_VALUE(render_state_changes_[GFXRS_POLYGONOFFSETFACTOR], static_cast<unsigned int> (Factor));
    SET_RS_VALUE(render_state_changes_[GFXRS_POLYGONOFFSETUNITS], static_cast<unsigned int> (Units));
  }

Here is the caller graph for this function:

void nux::GpuRenderStates::HW__SetSeparateAlphaBlend_Enable ( unsigned int  b) [inline, private]
void nux::GpuRenderStates::HW__SetSeparateAlphaBlendFactors ( unsigned int  SrcBlendFactor_,
unsigned int  DestBlendFactor_,
unsigned int  SrcFactorAlpha_,
unsigned int  DestFactorAlpha_ 
) [inline, private]

Definition at line 905 of file GLRenderStates.h.

  {
    nuxAssertMsg((SrcBlendFactor_ == GL_ZERO) || (SrcBlendFactor_ == GL_ONE) || (SrcBlendFactor_ == GL_SRC_COLOR) || (SrcBlendFactor_ == GL_ONE_MINUS_SRC_COLOR) || (SrcBlendFactor_ == GL_DST_COLOR) || (SrcBlendFactor_ == GL_ONE_MINUS_DST_COLOR) || (SrcBlendFactor_ == GL_SRC_ALPHA) || (SrcBlendFactor_ == GL_ONE_MINUS_SRC_ALPHA) || (SrcBlendFactor_ == GL_DST_ALPHA) || (SrcBlendFactor_ == GL_ONE_MINUS_DST_ALPHA) || (SrcBlendFactor_ == GL_CONSTANT_COLOR) || (SrcBlendFactor_ == GL_ONE_MINUS_CONSTANT_COLOR) || (SrcBlendFactor_ == GL_CONSTANT_ALPHA) || (SrcBlendFactor_ == GL_ONE_MINUS_CONSTANT_ALPHA) || (SrcBlendFactor_ == GL_SRC_ALPHA_SATURATE),
                   "Error(HW__SetSeparateAlphaBlendFactors): Invalid Blend RenderState");
    nuxAssertMsg((DestBlendFactor_ == GL_ZERO) || (DestBlendFactor_ == GL_ONE) || (DestBlendFactor_ == GL_SRC_COLOR) || (DestBlendFactor_ == GL_ONE_MINUS_SRC_COLOR) || (DestBlendFactor_ == GL_DST_COLOR) || (DestBlendFactor_ == GL_ONE_MINUS_DST_COLOR) || (DestBlendFactor_ == GL_SRC_ALPHA) || (DestBlendFactor_ == GL_ONE_MINUS_SRC_ALPHA) || (DestBlendFactor_ == GL_DST_ALPHA) || (DestBlendFactor_ == GL_ONE_MINUS_DST_ALPHA) || (DestBlendFactor_ == GL_CONSTANT_COLOR) || (DestBlendFactor_ == GL_ONE_MINUS_CONSTANT_COLOR) || (DestBlendFactor_ == GL_CONSTANT_ALPHA) || (DestBlendFactor_ == GL_ONE_MINUS_CONSTANT_ALPHA),
                   "Error(HW__SetSeparateAlphaBlendFactors): Invalid Blend RenderState");
    nuxAssertMsg((SrcFactorAlpha_ == GL_ZERO) || (SrcFactorAlpha_ == GL_ONE) || (SrcFactorAlpha_ == GL_SRC_COLOR) || (SrcFactorAlpha_ == GL_ONE_MINUS_SRC_COLOR) || (SrcFactorAlpha_ == GL_DST_COLOR) || (SrcFactorAlpha_ == GL_ONE_MINUS_DST_COLOR) || (SrcFactorAlpha_ == GL_SRC_ALPHA) || (SrcFactorAlpha_ == GL_ONE_MINUS_SRC_ALPHA) || (SrcFactorAlpha_ == GL_DST_ALPHA) || (SrcFactorAlpha_ == GL_ONE_MINUS_DST_ALPHA) || (SrcFactorAlpha_ == GL_CONSTANT_COLOR) || (SrcFactorAlpha_ == GL_ONE_MINUS_CONSTANT_COLOR) || (SrcFactorAlpha_ == GL_CONSTANT_ALPHA) || (SrcFactorAlpha_ == GL_ONE_MINUS_CONSTANT_ALPHA) || (SrcFactorAlpha_ == GL_SRC_ALPHA_SATURATE),
                   "Error(HW__SetSeparateAlphaBlendFactors): Invalid Blend RenderState");
    nuxAssertMsg((DestFactorAlpha_ == GL_ZERO) || (DestFactorAlpha_ == GL_ONE) || (DestFactorAlpha_ == GL_SRC_COLOR) || (DestFactorAlpha_ == GL_ONE_MINUS_SRC_COLOR) || (DestFactorAlpha_ == GL_DST_COLOR) || (DestFactorAlpha_ == GL_ONE_MINUS_DST_COLOR) || (DestFactorAlpha_ == GL_SRC_ALPHA) || (DestFactorAlpha_ == GL_ONE_MINUS_SRC_ALPHA) || (DestFactorAlpha_ == GL_DST_ALPHA) || (DestFactorAlpha_ == GL_ONE_MINUS_DST_ALPHA) || (DestFactorAlpha_ == GL_CONSTANT_COLOR) || (DestFactorAlpha_ == GL_ONE_MINUS_CONSTANT_COLOR) || (DestFactorAlpha_ == GL_CONSTANT_ALPHA) || (DestFactorAlpha_ == GL_ONE_MINUS_CONSTANT_ALPHA),
                   "Error(HW__SetSeparateAlphaBlendFactors): Invalid Blend RenderState");

    CHECKGL(glBlendFuncSeparate(
               SrcBlendFactor_,
               DestBlendFactor_,
               SrcFactorAlpha_,
               DestFactorAlpha_));

    SET_RS_VALUE(render_state_changes_[GFXRS_SRCBLEND], SrcBlendFactor_);
    SET_RS_VALUE(render_state_changes_[GFXRS_DESTBLEND], DestBlendFactor_);
    SET_RS_VALUE(render_state_changes_[GFXRS_SRCBLENDALPHA], SrcFactorAlpha_);
    SET_RS_VALUE(render_state_changes_[GFXRS_DESTBLENDALPHA], DestFactorAlpha_);
  }

Here is the caller graph for this function:

void nux::GpuRenderStates::HW__SetStencilFunc ( unsigned int  func,
int  ref,
unsigned int  mask 
) [inline, private]

Definition at line 1074 of file GLRenderStates.h.

  {
    nuxAssertMsg(
      (func == GL_NEVER) ||
      (func == GL_LESS) ||
      (func == GL_EQUAL) ||
      (func == GL_LEQUAL) ||
      (func == GL_GREATER) ||
      (func == GL_NOTEQUAL) ||
      (func == GL_GEQUAL) ||
      (func == GL_ALWAYS),
      "Error(HW__SetFrontFaceStencilFunc): Invalid Stencil Function RenderState");

    CHECKGL(glStencilFunc(func, ref, mask));

    SET_RS_VALUE(render_state_changes_[GFXRS_FRONT_STENCILFUNC], func);
    SET_RS_VALUE(render_state_changes_[GFXRS_FRONT_STENCILREF], ref);
    SET_RS_VALUE(render_state_changes_[GFXRS_FRONT_STENCILMASK], mask);
  }

Here is the caller graph for this function:

void nux::GpuRenderStates::HW__SetStencilOp ( unsigned int  FailOp_,
unsigned int  ZFailOp_,
unsigned int  ZPassOp_ 
) [inline, private]

Definition at line 1094 of file GLRenderStates.h.

  {
    nuxAssertMsg(
      (stencil_fail == GL_KEEP) ||
      (stencil_fail == GL_ZERO) ||
      (stencil_fail == GL_REPLACE) ||
      (stencil_fail == GL_INCR) ||
      (stencil_fail == GL_INCR_WRAP) ||
      (stencil_fail == GL_DECR) ||
      (stencil_fail == GL_DECR_WRAP) ||
      (stencil_fail == GL_INVERT),
      "Error(HW__SetFrontFaceStencilOp): Invalid FailOp RenderState");

    nuxAssertMsg(
      (stencil_pass_depth_fail == GL_KEEP) ||
      (stencil_pass_depth_fail == GL_ZERO) ||
      (stencil_pass_depth_fail == GL_REPLACE) ||
      (stencil_pass_depth_fail == GL_INCR) ||
      (stencil_pass_depth_fail == GL_INCR_WRAP) ||
      (stencil_pass_depth_fail == GL_DECR) ||
      (stencil_pass_depth_fail == GL_DECR_WRAP) ||
      (stencil_pass_depth_fail == GL_INVERT),
      "Error(HW__SetFrontFaceStencilOp): Invalid ZFailOp RenderState");

    nuxAssertMsg(
      (stencil_pass_depth_pass == GL_KEEP) ||
      (stencil_pass_depth_pass == GL_ZERO) ||
      (stencil_pass_depth_pass == GL_REPLACE) ||
      (stencil_pass_depth_pass == GL_INCR) ||
      (stencil_pass_depth_pass == GL_INCR_WRAP) ||
      (stencil_pass_depth_pass == GL_DECR) ||
      (stencil_pass_depth_pass == GL_DECR_WRAP) ||
      (stencil_pass_depth_pass == GL_INVERT),
      "Error(HW__SetFrontFaceStencilOp): Invalid ZPassOp RenderState");

    CHECKGL(glStencilOp(stencil_fail, stencil_pass_depth_fail, stencil_pass_depth_pass));

    SET_RS_VALUE(render_state_changes_[GFXRS_FRONT_STENCILFAIL], stencil_fail);
    SET_RS_VALUE(render_state_changes_[GFXRS_FRONT_STENCILZFAIL], stencil_pass_depth_fail);
    SET_RS_VALUE(render_state_changes_[GFXRS_FRONT_STENCILZPASS], stencil_pass_depth_pass);
  }

Here is the caller graph for this function:

Definition at line 126 of file GLRenderStates.cpp.

  {
    HW__EnableCulling( s_StateLUT.default_render_state[GFXRS_CULLFACEENABLE].iValue );
    HW__SetFrontFace( s_StateLUT.default_render_state[GFXRS_FRONTFACE].iValue );
    HW__SetCullFace( s_StateLUT.default_render_state[GFXRS_CULLFACE].iValue );

    HW__SetDepthMask( s_StateLUT.default_render_state[GFXRS_ZWRITEENABLE].iValue );
    HW__SetDepthFunc( s_StateLUT.default_render_state[GFXRS_ZFUNC].iValue );
    HW__SetEnableDepthTest( s_StateLUT.default_render_state[GFXRS_ZTESTENABLE].iValue );
    HW__SetDepthRange( s_StateLUT.default_render_state[GFXRS_ZNEAR].fValue, s_StateLUT.default_render_state[GFXRS_ZFAR].fValue );

    HW__EnableAlphaBlend( s_StateLUT.default_render_state[GFXRS_ALPHABLENDENABLE].iValue );
    HW__SetAlphaBlendOp( s_StateLUT.default_render_state[GFXRS_BLENDOP].iValue, s_StateLUT.default_render_state[GFXRS_BLENDOPALPHA].iValue );
    HW__SetSeparateAlphaBlendFactors(
      s_StateLUT.default_render_state[GFXRS_SRCBLEND].iValue, s_StateLUT.default_render_state[GFXRS_DESTBLEND].iValue,
      s_StateLUT.default_render_state[GFXRS_SRCBLENDALPHA].iValue, s_StateLUT.default_render_state[GFXRS_DESTBLENDALPHA ].iValue );


    HW__EnableAlphaTest( s_StateLUT.default_render_state[GFXRS_ALPHATESTENABLE].iValue );
    HW__SetAlphaTestFunc( s_StateLUT.default_render_state[GFXRS_ALPHATESTFUNC].iValue, s_StateLUT.default_render_state[GFXRS_ALPHATESTREF].iValue );


    HW__EnableStencil( s_StateLUT.default_render_state[GFXRS_STENCILENABLE].iValue );
    HW__SetStencilFunc(
      s_StateLUT.default_render_state[GFXRS_FRONT_STENCILFUNC].iValue,
      s_StateLUT.default_render_state[GFXRS_FRONT_STENCILREF].iValue,
      s_StateLUT.default_render_state[GFXRS_FRONT_STENCILMASK].iValue);
    HW__SetStencilOp(
      s_StateLUT.default_render_state[GFXRS_FRONT_STENCILFAIL].iValue,
      s_StateLUT.default_render_state[GFXRS_FRONT_STENCILZFAIL].iValue,
      s_StateLUT.default_render_state[GFXRS_FRONT_STENCILZPASS].iValue);

    HW__EnableLineSmooth(s_StateLUT.default_render_state[GFXRS_LINESMOOTHENABLE].iValue);
    HW__SetLineWidth(s_StateLUT.default_render_state[GFXRS_LINEWIDTH].iValue, s_StateLUT.default_render_state[GFXRS_LINEHINT].iValue);

    HW__EnablePointSmooth(s_StateLUT.default_render_state[GFXRS_POINTSMOOTHENABLE].iValue);
    HW__SetPointSize(s_StateLUT.default_render_state[GFXRS_POINTSIZE].iValue, s_StateLUT.default_render_state[GFXRS_POINTHINT].iValue);

#if 0
    HW__EnableTwoSidedStencil( s_StateLUT.default_render_state[GFXRS_TWOSIDEDSTENCILENABLE].iValue );

    HW__SetFrontFaceStencilFunc(
      s_StateLUT.default_render_state[GFXRS_FRONT_STENCILFUNC].iValue,
      s_StateLUT.default_render_state[GFXRS_FRONT_STENCILREF].iValue,
      s_StateLUT.default_render_state[GFXRS_FRONT_STENCILMASK].iValue );
    HW__SetFrontFaceStencilOp(
      s_StateLUT.default_render_state[GFXRS_FRONT_STENCILFAIL].iValue,
      s_StateLUT.default_render_state[GFXRS_FRONT_STENCILZFAIL].iValue,
      s_StateLUT.default_render_state[GFXRS_FRONT_STENCILZPASS].iValue );

    HW__SetBackFaceStencilFunc(
      s_StateLUT.default_render_state[GFXRS_BACK_STENCILFUNC].iValue,
      s_StateLUT.default_render_state[GFXRS_BACK_STENCILREF].iValue,
      s_StateLUT.default_render_state[GFXRS_BACK_STENCILMASK].iValue );
    HW__SetBackFaceStencilOp(
      s_StateLUT.default_render_state[GFXRS_BACK_STENCILFAIL].iValue,
      s_StateLUT.default_render_state[GFXRS_BACK_STENCILZFAIL].iValue,
      s_StateLUT.default_render_state[GFXRS_BACK_STENCILZPASS].iValue );
#endif

    HW__EnableScissor( s_StateLUT.default_render_state[GFXRS_SCISSORTESTENABLE].iValue );

    HW__EnableFog( s_StateLUT.default_render_state[GFXRS_FOGENABLE].iValue );
  }

Here is the call graph for this function:

Definition at line 258 of file GLRenderStates.cpp.

Here is the caller graph for this function:

void nux::GpuRenderStates::SetAlphaTest ( bool  EnableAlphaTest_,
unsigned int  AlphaTestFunc_ = GL_ALWAYS,
BYTE  AlphaTestRef_ = 0 
) [inline]

Definition at line 359 of file GLRenderStates.h.

  {
    if (EnableAlphaTest_)
    {
      if (!RS_VALUE(render_state_changes_[GFXRS_ALPHATESTENABLE]))
      {
        HW__EnableAlphaTest(TRUE);
      }

      if ((RS_VALUE(render_state_changes_[GFXRS_ALPHATESTFUNC]) != AlphaTestFunc_) ||
           (RS_VALUE(render_state_changes_[GFXRS_ALPHATESTREF]) != AlphaTestRef_))
      {
        HW__SetAlphaTestFunc(AlphaTestFunc_, AlphaTestRef_);
      }
    }
    else
    {
      HW__EnableAlphaTest(GL_FALSE);
      HW__SetAlphaTestFunc(AlphaTestFunc_, AlphaTestRef_);
    }
  }

Here is the call graph for this function:

void nux::GpuRenderStates::SetBlend ( bool  AlphaBlendEnable_) [inline]

Definition at line 384 of file GLRenderStates.h.

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::GpuRenderStates::SetBlend ( bool  AlphaBlendEnable_,
unsigned int  SrcBlendFactor_,
unsigned int  DestBlendFactor_ 
) [inline]

Definition at line 402 of file GLRenderStates.h.

  {
    SetBlend(AlphaBlendEnable_);

    if ((RS_VALUE(render_state_changes_[GFXRS_SRCBLEND]) != SrcBlendFactor_) ||
         (RS_VALUE(render_state_changes_[GFXRS_DESTBLEND]) != DestBlendFactor_))
    {
      HW__SetSeparateAlphaBlendFactors(
        SrcBlendFactor_,
        DestBlendFactor_,
        SrcBlendFactor_,
        DestBlendFactor_);
    }
  }

Here is the call graph for this function:

void nux::GpuRenderStates::SetBlendOp ( unsigned int  BlendOp = GL_FUNC_ADD) [inline]

Definition at line 501 of file GLRenderStates.h.

  {
    if ((RS_VALUE(render_state_changes_[GFXRS_BLENDOP]) != BlendOp))
    {
      HW__SetAlphaBlendOp(BlendOp, BlendOp);
    }
  }

Here is the call graph for this function:

void nux::GpuRenderStates::SetColorMask ( unsigned int  bRed = TRUE,
unsigned int  bGreen = TRUE,
unsigned int  bBlue = TRUE,
unsigned int  bAlpha = TRUE 
) [inline]

Definition at line 769 of file GLRenderStates.h.

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::GpuRenderStates::SetCullMode ( bool  EnableCullFace,
unsigned int  FrontFace_ = GL_CCW,
unsigned int  Cullface_ = GL_BACK 
) [inline]

Definition at line 520 of file GLRenderStates.h.

  {
    if (EnableCullFace)
    {
      if (!RS_VALUE(render_state_changes_[GFXRS_CULLFACEENABLE]))
      {
        HW__EnableCulling(TRUE);
      }

      if (RS_VALUE(render_state_changes_[GFXRS_FRONTFACE]) != FrontFace_)
      {
        HW__SetFrontFace(FrontFace_);
      }

      if (RS_VALUE(render_state_changes_[GFXRS_CULLFACE]) != Cullface_)
      {
        HW__SetCullFace(Cullface_);
      }
    }
    else
    {
      HW__EnableCulling(FALSE);
      HW__SetFrontFace(FrontFace_);
      HW__SetCullFace(Cullface_);
    }
  }

Here is the call graph for this function:

void nux::GpuRenderStates::SetDepthMask ( unsigned int  bDepth = TRUE) [inline]

Definition at line 797 of file GLRenderStates.h.

Here is the call graph for this function:

void nux::GpuRenderStates::SetDepthRange ( float  zNear = 0.0f,
float  zFar = 1.0f 
) [inline]

Definition at line 578 of file GLRenderStates.h.

  {
    if ((RS_VALUE(render_state_changes_[GFXRS_ZNEAR]) != static_cast<unsigned int> (zNear)) ||
         (RS_VALUE(render_state_changes_[GFXRS_ZFAR]) != static_cast<unsigned int> (zFar)))
    {
      HW__SetDepthRange(zNear, zFar);
    }
  }

Here is the call graph for this function:

void nux::GpuRenderStates::SetDepthTest ( bool  EnableDepthTest,
unsigned int  WriteEnable_ = GL_TRUE,
unsigned int  DepthFunc_ = GL_LEQUAL 
) [inline]

Definition at line 549 of file GLRenderStates.h.

  {
    if (EnableDepthTest)
    {
      if (!RS_VALUE(render_state_changes_[GFXRS_ZTESTENABLE]))
      {
        HW__SetEnableDepthTest(TRUE);
      }

      if (RS_VALUE(render_state_changes_[GFXRS_ZWRITEENABLE]) != WriteEnable_)
      {
        HW__SetDepthMask(WriteEnable_);
      }

      if (RS_VALUE(render_state_changes_[GFXRS_ZFUNC]) != DepthFunc_)
      {
        HW__SetDepthFunc(DepthFunc_);
      }
    }
    else
    {
      HW__SetEnableDepthTest(FALSE);
      HW__SetDepthMask(WriteEnable_);
      HW__SetDepthFunc(DepthFunc_);
    }
  }

Here is the call graph for this function:

void nux::GpuRenderStates::SetPolygonMode ( unsigned int  FrontMode = GL_FILL,
unsigned int  BackMode = GL_FILL 
) [inline]

Definition at line 821 of file GLRenderStates.h.

Here is the call graph for this function:

void nux::GpuRenderStates::SetPolygonOffset ( unsigned int  bEnable,
float  Factor = 0.0f,
float  Units = 0.0f 
) [inline]

Definition at line 830 of file GLRenderStates.h.

  {
    if (bEnable)
    {
      if (!RS_VALUE(render_state_changes_[GFXRS_POLYGONOFFSETENABLE]))
      {
        HW__EnablePolygonOffset(GL_TRUE);
      }

      if ((RS_VALUE(render_state_changes_[GFXRS_POLYGONOFFSETFACTOR]) != static_cast<unsigned int> (Factor)) ||
           (RS_VALUE(render_state_changes_[GFXRS_POLYGONOFFSETUNITS]) != static_cast<unsigned int> (Units)))
      {
        HW__SetPolygonOffset(Factor, Units);
      }
    }
    else
    {
      HW__EnablePolygonOffset(GL_FALSE);
    }
  }

Here is the call graph for this function:

Definition at line 467 of file GLRenderStates.h.

  {
    static const struct
    {
      const unsigned int src_blend;
      const unsigned int dst_blend;
    } factor[13] =
    {
      { GL_ZERO,                GL_ZERO                }, // CLEAR
      { GL_ONE,                 GL_ZERO                }, // SRC
      { GL_ZERO,                GL_ONE                 }, // DST
      { GL_ONE,                 GL_ONE_MINUS_SRC_ALPHA }, // SRC_OVER
      { GL_ONE_MINUS_DST_ALPHA, GL_ONE                 }, // DST_OVER
      { GL_DST_ALPHA,           GL_ZERO                }, // SRC_IN
      { GL_ZERO,                GL_SRC_ALPHA           }, // DST_IN
      { GL_ONE_MINUS_DST_ALPHA, GL_ZERO                }, // SRC_OUT
      { GL_ZERO,                GL_ONE_MINUS_SRC_ALPHA }, // DST_OUT
      { GL_DST_ALPHA,           GL_ONE_MINUS_SRC_ALPHA }, // SRC_ATOP
      { GL_ONE_MINUS_DST_ALPHA, GL_SRC_ALPHA           }, // DST_ATOP
      { GL_ONE_MINUS_DST_ALPHA, GL_ONE_MINUS_SRC_ALPHA }, // XOR
      { GL_ONE,                 GL_ONE                 }  // PLUS
    };

    if ((RS_VALUE(render_state_changes_[GFXRS_SRCBLEND]) !=
         factor[op].src_blend) ||
        (RS_VALUE(render_state_changes_[GFXRS_DESTBLEND]) !=
         factor[op].dst_blend))
    {
      HW__SetSeparateAlphaBlendFactors
        (factor[op].src_blend, factor[op].dst_blend,
         factor[op].src_blend, factor[op].dst_blend);
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::GpuRenderStates::SetSeparateBlend ( bool  _bEnable,
unsigned int  SrcBlendFactor_,
unsigned int  DestBlendFactor_,
unsigned int  SrcFactorAlpha_,
unsigned int  DestFactorAlpha_ 
) [inline]

Definition at line 428 of file GLRenderStates.h.

  {
    SetBlend(EnableSeparateAlphaBlend);

//     if (EnableSeparateAlphaBlend)
//     {
//         if (!RS_VALUE(render_state_changes_[GFXRS_ALPHABLENDENABLE]))
//         {
//             HW__EnableAlphaBlend(TRUE);
//         }

    if ((RS_VALUE(render_state_changes_[GFXRS_SRCBLEND]) != SrcBlendFactor_) ||
         (RS_VALUE(render_state_changes_[GFXRS_DESTBLEND]) != DestBlendFactor_) ||
         (RS_VALUE(render_state_changes_[GFXRS_SRCBLENDALPHA]) != SrcBlendFactorAlpha_) ||
         (RS_VALUE(render_state_changes_[GFXRS_DESTBLENDALPHA]) != DestBlendFactorAlpha_))
    {
      HW__SetSeparateAlphaBlendFactors(
        SrcBlendFactor_,
        DestBlendFactor_,
        SrcBlendFactorAlpha_,
        DestBlendFactorAlpha_);
    }

//     }
//     else
//     {
//         HW__EnableAlphaBlend(GL_FALSE);
//         HW__SetSeparateAlphaBlendFactors(
//             SrcBlendFactor_,
//             DestBlendFactor_,
//             SrcBlendFactorAlpha_,
//             DestBlendFactorAlpha_);
//     }
  }

Here is the call graph for this function:

void nux::GpuRenderStates::SetSeparateBlendOp ( unsigned int  BlendOpRGB_ = GL_FUNC_ADD,
unsigned int  BlendOpAlpha_ = GL_FUNC_ADD 
) [inline]

Definition at line 509 of file GLRenderStates.h.

  {
    if ((RS_VALUE(render_state_changes_[GFXRS_BLENDOP]) != BlendOpRGB_) ||
         (RS_VALUE(render_state_changes_[GFXRS_BLENDOPALPHA]) != BlendOpAlpha_))
    {
      HW__SetAlphaBlendOp(BlendOpRGB_, BlendOpAlpha_);
    }
  }

Here is the call graph for this function:

void nux::GpuRenderStates::SetStencil ( bool  enable_stencil) [inline]

Definition at line 587 of file GLRenderStates.h.

  {
    if (enable_stencil)
    {
      if (!RS_VALUE(render_state_changes_[GFXRS_STENCILENABLE]))
      {
        HW__EnableStencil(TRUE);
      }
    }
    else
    {
      HW__EnableStencil(FALSE);
    }
  }

Here is the call graph for this function:

void nux::GpuRenderStates::SetStencilFunc ( unsigned int  func,
int  ref,
unsigned int  mask 
) [inline]

Definition at line 602 of file GLRenderStates.h.

Here is the call graph for this function:

void nux::GpuRenderStates::SetStencilOp ( unsigned int  stencil_fail,
unsigned int  stencil_pass_depth_fail,
unsigned int  stencil_pass_depth_pass 
) [inline]

Definition at line 614 of file GLRenderStates.h.

  {
    if (
      (RS_VALUE(render_state_changes_[GFXRS_FRONT_STENCILFAIL]) != stencil_fail) ||
      (RS_VALUE(render_state_changes_[GFXRS_FRONT_STENCILZFAIL]) != stencil_pass_depth_fail) ||
      (RS_VALUE(render_state_changes_[GFXRS_FRONT_STENCILZPASS]) != stencil_pass_depth_pass)
      )
    {
      HW__SetStencilOp(stencil_fail, stencil_pass_depth_fail, stencil_pass_depth_pass);
    }
  }

Here is the call graph for this function:

Definition at line 191 of file GLRenderStates.cpp.

  {
    HW__EnableCulling( render_state_changes_[GFXRS_CULLFACEENABLE].iValue );
    HW__SetFrontFace( render_state_changes_[GFXRS_FRONTFACE].iValue );
    HW__SetCullFace( render_state_changes_[GFXRS_CULLFACE].iValue );

    HW__SetDepthMask( render_state_changes_[GFXRS_ZWRITEENABLE].iValue );
    HW__SetDepthFunc( render_state_changes_[GFXRS_ZFUNC].iValue );
    HW__SetEnableDepthTest( render_state_changes_[GFXRS_ZTESTENABLE].iValue );
    HW__SetDepthRange( render_state_changes_[GFXRS_ZNEAR].fValue, render_state_changes_[GFXRS_ZFAR].fValue );

    HW__EnableAlphaBlend( render_state_changes_[GFXRS_ALPHABLENDENABLE].iValue );
    HW__SetAlphaBlendOp( render_state_changes_[GFXRS_BLENDOP].iValue, render_state_changes_[GFXRS_BLENDOPALPHA].iValue );
    HW__SetSeparateAlphaBlendFactors(
      render_state_changes_[GFXRS_SRCBLEND].iValue, render_state_changes_[GFXRS_DESTBLEND].iValue,
      render_state_changes_[GFXRS_SRCBLENDALPHA].iValue, render_state_changes_[GFXRS_DESTBLENDALPHA ].iValue );


    HW__EnableAlphaTest( render_state_changes_[GFXRS_ALPHATESTENABLE].iValue );
    HW__SetAlphaTestFunc( render_state_changes_[GFXRS_ALPHATESTFUNC].iValue, render_state_changes_[GFXRS_ALPHATESTREF].iValue );


    HW__EnableStencil( render_state_changes_[GFXRS_STENCILENABLE].iValue );

    HW__SetStencilFunc(
      render_state_changes_[GFXRS_FRONT_STENCILFUNC].iValue,
      render_state_changes_[GFXRS_FRONT_STENCILREF].iValue,
      render_state_changes_[GFXRS_FRONT_STENCILMASK].iValue);
    HW__SetStencilOp(
      render_state_changes_[GFXRS_FRONT_STENCILFAIL].iValue,
      render_state_changes_[GFXRS_FRONT_STENCILZFAIL].iValue,
      render_state_changes_[GFXRS_FRONT_STENCILZPASS].iValue);

    HW__EnableLineSmooth(render_state_changes_[GFXRS_LINESMOOTHENABLE].iValue);
    HW__SetLineWidth(render_state_changes_[GFXRS_LINEWIDTH].iValue, render_state_changes_[GFXRS_LINEHINT].iValue);

    HW__EnablePointSmooth(render_state_changes_[GFXRS_POINTSMOOTHENABLE].iValue);
    HW__SetPointSize(render_state_changes_[GFXRS_POINTSIZE].iValue, render_state_changes_[GFXRS_POINTHINT].iValue);
        
#if 0
    HW__EnableTwoSidedStencil( s_StateLUT.default_render_state[GFXRS_TWOSIDEDSTENCILENABLE].iValue );

    HW__SetFrontFaceStencilFunc(
      render_state_changes_[GFXRS_FRONT_STENCILFUNC].iValue,
      render_state_changes_[GFXRS_FRONT_STENCILREF].iValue,
      render_state_changes_[GFXRS_FRONT_STENCILMASK].iValue );
    HW__SetFrontFaceStencilOp(
      render_state_changes_[GFXRS_FRONT_STENCILFAIL].iValue,
      render_state_changes_[GFXRS_FRONT_STENCILZFAIL].iValue,
      render_state_changes_[GFXRS_FRONT_STENCILZPASS].iValue );

    HW__SetBackFaceStencilFunc(
      render_state_changes_[GFXRS_BACK_STENCILFUNC].iValue,
      render_state_changes_[GFXRS_BACK_STENCILREF].iValue,
      render_state_changes_[GFXRS_BACK_STENCILMASK].iValue );
    HW__SetBackFaceStencilOp(
      render_state_changes_[GFXRS_BACK_STENCILFAIL].iValue,
      render_state_changes_[GFXRS_BACK_STENCILZFAIL].iValue,
      render_state_changes_[GFXRS_BACK_STENCILZPASS].iValue );
#endif

    HW__EnableScissor( render_state_changes_[GFXRS_SCISSORTESTENABLE].iValue );

    HW__EnableFog( render_state_changes_[GFXRS_FOGENABLE].iValue );

  }

Here is the call graph for this function:


Member Data Documentation

Definition at line 267 of file GLRenderStates.h.

Definition at line 268 of file GLRenderStates.h.

Definition at line 346 of file GLRenderStates.h.

Definition at line 347 of file GLRenderStates.h.


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