Back to index

nux  3.0.0
Public Member Functions | Public Attributes
nux::StateLookUpTable Struct Reference
Collaboration diagram for nux::StateLookUpTable:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 StateLookUpTable ()

Public Attributes

RenderStateMap default_render_state [GFXRS_MAX_RENDERSTATES]
RenderStateMap sampler_state_map [GFXSS_MAX_SAMPLERSTATES]

Detailed Description

Definition at line 29 of file GLRenderStates.cpp.


Constructor & Destructor Documentation

Definition at line 31 of file GLRenderStates.cpp.

    {
      // setup render state map
#define UL_MAP(state__, default_value__, checked__)                         \
        default_render_state[GFXRS_##state__].iValue     = default_value__;      \
        default_render_state[GFXRS_##state__].Checked   = checked__;

#define UL_MAP_FLOAT(state__, default_value__, checked__)                         \
    default_render_state[GFXRS_##state__].fValue     = default_value__;      \
    default_render_state[GFXRS_##state__].Checked   = checked__;            \
 

#ifndef NUX_OPENGLES_20
      UL_MAP(FRONT_POLYGONMODE            ,           GL_FILL         ,       1);
      UL_MAP(BACK_POLYGONMODE             ,           GL_FILL         ,       1);
#endif
      UL_MAP(CULLFACEENABLE               ,           GL_FALSE        ,       1);
      UL_MAP(CULLFACE                     ,           GL_BACK         ,       1);
      UL_MAP(FRONTFACE                    ,           GL_CCW          ,       1);

      UL_MAP(SCISSORTESTENABLE            ,           GL_FALSE        ,       1);
      UL_MAP(FOGENABLE                    ,           GL_FALSE        ,       1);

      UL_MAP(ZTESTENABLE                  ,           GL_FALSE        ,       1);
      UL_MAP(ZWRITEENABLE                 ,           GL_TRUE         ,       1);
      UL_MAP(ZFUNC                        ,           GL_LESS         ,       1);
      UL_MAP_FLOAT(ZNEAR                  ,           static_cast<unsigned int> (0.0f)            ,       1);
      UL_MAP_FLOAT(ZFAR                   ,           static_cast<unsigned int> (1.0f)            ,       1);

      UL_MAP(ALPHABLENDENABLE             ,           GL_FALSE        ,       1);
      UL_MAP(BLENDOP                      ,           GL_FUNC_ADD     ,       1);
      UL_MAP(BLENDOPALPHA                 ,           GL_FUNC_ADD     ,       1);
      UL_MAP(SRCBLEND                     ,           GL_ONE          ,       1);
      UL_MAP(DESTBLEND                    ,           GL_ZERO         ,       1);
      UL_MAP(SRCBLENDALPHA                ,           GL_ONE          ,       1);
      UL_MAP(DESTBLENDALPHA               ,           GL_ZERO         ,       1);

      UL_MAP(ALPHATESTENABLE              ,           GL_FALSE        ,       1);
      UL_MAP(ALPHATESTREF                 ,           0x0             ,       1);
      UL_MAP(ALPHATESTFUNC                ,           GL_ALWAYS       ,       1);

      UL_MAP(STENCILENABLE                ,           GL_FALSE        ,       1);
      UL_MAP(TWOSIDEDSTENCILENABLE        ,           GL_FALSE        ,       1);
      UL_MAP(FRONT_STENCILWRITEMASK       ,           0xFFFFFFFF      ,       1);
      UL_MAP(BACK_STENCILWRITEMASK        ,           0xFFFFFFFF      ,       1);

      UL_MAP(FRONT_STENCILFUNC            ,           GL_ALWAYS       ,       1);
      UL_MAP(FRONT_STENCILREF             ,           0x0             ,       1);
      UL_MAP(FRONT_STENCILMASK            ,           0xFF            ,       1);
      UL_MAP(FRONT_STENCILFAIL            ,           GL_KEEP         ,       1);
      UL_MAP(FRONT_STENCILZFAIL           ,           GL_KEEP         ,       1);
      UL_MAP(FRONT_STENCILZPASS           ,           GL_KEEP         ,       1);

      UL_MAP(BACK_STENCILFUNC             ,           GL_ALWAYS       ,       1);
      UL_MAP(BACK_STENCILREF              ,           0x0             ,       1);
      UL_MAP(BACK_STENCILMASK             ,           0xFF            ,       1);
      UL_MAP(BACK_STENCILFAIL             ,           GL_KEEP         ,       1);
      UL_MAP(BACK_STENCILZFAIL            ,           GL_KEEP         ,       1);
      UL_MAP(BACK_STENCILZPASS            ,           GL_KEEP         ,       1);


      UL_MAP(POINTSMOOTHENABLE            ,           GL_FALSE        ,       1);
      UL_MAP(LINESMOOTHENABLE             ,           GL_FALSE        ,       1);
      UL_MAP(POINTSIZE                    ,           1               ,       1);
      UL_MAP(LINEWIDTH                    ,           1               ,       1);
      UL_MAP(POINTHINT                    ,           GL_FASTEST      ,       1);
      UL_MAP(LINEHINT                     ,           GL_FASTEST      ,       1);

      UL_MAP(COLORWRITEENABLE_R           ,           GL_TRUE         ,       1);
      UL_MAP(COLORWRITEENABLE_G           ,           GL_TRUE         ,       1);
      UL_MAP(COLORWRITEENABLE_B           ,           GL_TRUE         ,       1);
      UL_MAP(COLORWRITEENABLE_A           ,           GL_TRUE         ,       1);

#undef UL_MAP
#undef UL_MAP_FLOAT
    };

Member Data Documentation

Definition at line 106 of file GLRenderStates.cpp.

Definition at line 109 of file GLRenderStates.cpp.


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