~ubuntu-branches/ubuntu/oneiric/nux/oneiric

« back to all changes in this revision

Viewing changes to NuxGraphics/GLRenderStates.h

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-12-09 19:56:53 UTC
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20101209195653-lsc4objqdxs9exp3
Tags: upstream-0.9.10
ImportĀ upstreamĀ versionĀ 0.9.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 * License version 3 along with this program.  If not, see
16
16
 * <http://www.gnu.org/licenses/>
17
17
 *
18
 
 * Authored by: Jay Taoko <jay.taoko_AT_gmail_DOT_com>
 
18
 * Authored by: Jay Taoko <jaytaoko@inalogic.com>
19
19
 *
20
20
 */
21
21
 
111
111
    GFXSS_MAX_SAMPLERSTATES,
112
112
  };
113
113
 
 
114
  //! Brand of GPUs.
114
115
  typedef enum
115
116
  {
116
 
    BOARD_UNKNOWN = 0,
117
 
    BOARD_ATI,
118
 
    BOARD_NVIDIA,
119
 
    BOARD_INTEL,
120
 
  } eGraphicsBoardVendor;
 
117
    GPU_VENDOR_UNKNOWN = 0,
 
118
    GPU_BRAND_AMD,
 
119
    GPU_BRAND_NVIDIA,
 
120
    GPU_BRAND_INTEL,
 
121
  } GpuBrand;
121
122
 
122
123
  struct RenderStateMap
123
124
  {
124
125
    t_u32   Checked;
125
126
    t_u32    State;
126
127
    t_u32    iValue;
127
 
    FLOAT   fValue;
 
128
    float   fValue;
128
129
  };
129
130
 
130
 
  class GLRenderStates
 
131
  class GpuRenderStates
131
132
  {
132
133
  public:
133
 
    GLRenderStates (eGraphicsBoardVendor board);
134
 
    ~GLRenderStates();
 
134
    GpuRenderStates (GpuBrand board);
 
135
    ~GpuRenderStates();
135
136
 
136
137
    void ResetDefault();
137
138
    void ResetStateChangeToDefault();
245
246
 
246
247
  private:
247
248
 
248
 
    eGraphicsBoardVendor m_BoardVendor;
 
249
    GpuBrand _gpu_brand;
249
250
 
250
251
    inline void HW__EnableAlphaTest (t_u32 b);
251
252
 
334
335
//#define RS_VALUE_FLOAT(a, b)      (a).fValue
335
336
 
336
337
 
337
 
  inline void GLRenderStates::SetAlphaTest (
 
338
  inline void GpuRenderStates::SetAlphaTest (
338
339
    bool EnableAlphaTest_,
339
340
    t_u32 AlphaTestFunc_,
340
341
    BYTE AlphaTestRef_)
359
360
    }
360
361
  }
361
362
 
362
 
  inline void GLRenderStates::SetBlend (bool AlphaBlendEnable_)
 
363
  inline void GpuRenderStates::SetBlend (bool AlphaBlendEnable_)
363
364
  {
364
365
    if (AlphaBlendEnable_)
365
366
    {
377
378
    }
378
379
  }
379
380
 
380
 
  inline void GLRenderStates::SetBlend (bool AlphaBlendEnable_,
 
381
  inline void GpuRenderStates::SetBlend (bool AlphaBlendEnable_,
381
382
                                        t_u32 SrcBlendFactor_,
382
383
                                        t_u32 DestBlendFactor_)
383
384
  {
394
395
    }
395
396
  }
396
397
 
397
 
  inline void GLRenderStates::GetBlend (t_u32& AlphaBlendEnable_,
 
398
  inline void GpuRenderStates::GetBlend (t_u32& AlphaBlendEnable_,
398
399
                    t_u32& SrcBlendFactor_,
399
400
                    t_u32& DestBlendFactor_)
400
401
  {
403
404
    DestBlendFactor_  = RS_VALUE (m_RenderStateChanges[GFXRS_DESTBLEND]);
404
405
  }
405
406
    
406
 
  inline void GLRenderStates::SetSeparateBlend (bool EnableSeparateAlphaBlend,
 
407
  inline void GpuRenderStates::SetSeparateBlend (bool EnableSeparateAlphaBlend,
407
408
      t_u32 SrcBlendFactor_,
408
409
      t_u32 DestBlendFactor_,
409
410
      t_u32 SrcBlendFactorAlpha_,
442
443
//     }
443
444
  }
444
445
 
445
 
  inline void GLRenderStates::SetBlendOp (t_u32 BlendOp)
 
446
  inline void GpuRenderStates::SetBlendOp (t_u32 BlendOp)
446
447
  {
447
448
    if ( (RS_VALUE (m_RenderStateChanges[GFXRS_BLENDOP]) != BlendOp) )
448
449
    {
450
451
    }
451
452
  }
452
453
 
453
 
  inline void GLRenderStates::SetSeparateBlendOp (
 
454
  inline void GpuRenderStates::SetSeparateBlendOp (
454
455
    t_u32 BlendOpRGB_,
455
456
    t_u32 BlendOpAlpha_)
456
457
  {
461
462
    }
462
463
  }
463
464
 
464
 
  inline void GLRenderStates::SetCullMode (bool EnableCullFace,
 
465
  inline void GpuRenderStates::SetCullMode (bool EnableCullFace,
465
466
      t_u32 FrontFace_,
466
467
      t_u32 Cullface_)
467
468
  {
490
491
    }
491
492
  }
492
493
 
493
 
  inline void GLRenderStates::SetDepthTest (bool EnableDepthTest,
 
494
  inline void GpuRenderStates::SetDepthTest (bool EnableDepthTest,
494
495
      t_u32 WriteEnable_,
495
496
      t_u32 DepthFunc_)
496
497
  {
519
520
    }
520
521
  }
521
522
 
522
 
  inline void GLRenderStates::SetDepthRange (FLOAT zNear, FLOAT zFar)
 
523
  inline void GpuRenderStates::SetDepthRange (FLOAT zNear, FLOAT zFar)
523
524
  {
524
525
    if ( (RS_VALUE (m_RenderStateChanges[GFXRS_ZNEAR]) != static_cast<t_u32> (zNear) ) ||
525
526
         (RS_VALUE (m_RenderStateChanges[GFXRS_ZFAR]) != static_cast<t_u32> (zFar) ) )
528
529
    }
529
530
  }
530
531
 
531
 
  inline void GLRenderStates::SetStencilFrontFace (
 
532
  inline void GpuRenderStates::SetStencilFrontFace (
532
533
    bool EnableStencil_,                            // GL_TRUE enable stencil test
533
534
    t_u32 Func_,
534
535
    t_u32 FailOp_,
565
566
    }
566
567
  }
567
568
 
568
 
  inline void GLRenderStates::SetStencilBackFace (
 
569
  inline void GpuRenderStates::SetStencilBackFace (
569
570
    bool EnableTwoSideStencil_,                     // GL_TRUE enable Two Sided Stencil test
570
571
    t_u32 Func_,
571
572
    t_u32 FailOp_,
607
608
    }
608
609
  }
609
610
 
610
 
  inline void GLRenderStates::SetFrontFaceStencilWriteMask (
 
611
  inline void GpuRenderStates::SetFrontFaceStencilWriteMask (
611
612
    t_u32 WriteMask_)
612
613
  {
613
614
    HW__SetStencilFrontFaceWriteMask (WriteMask_);
614
615
  }
615
616
 
616
 
  inline void GLRenderStates::SetBackFaceStencilWriteMask (
 
617
  inline void GpuRenderStates::SetBackFaceStencilWriteMask (
617
618
    t_u32 WriteMask_)
618
619
  {
619
620
    HW__SetStencilBackFaceWriteMask (WriteMask_);
620
621
  }
621
622
 
622
 
  inline void GLRenderStates::EnableLineSmooth (
 
623
  inline void GpuRenderStates::EnableLineSmooth (
623
624
    bool EnableLineSmooth,
624
625
    t_u32  LineWidth,
625
626
    t_u32 Hint)
644
645
    }
645
646
  }
646
647
 
647
 
  inline void GLRenderStates::EnablePointSmooth (
 
648
  inline void GpuRenderStates::EnablePointSmooth (
648
649
    bool EnablePointSmooth,
649
650
    t_u32  PointSize,
650
651
    t_u32 Hint)
669
670
    }
670
671
  }
671
672
 
672
 
  inline void GLRenderStates::SetColorMask (
 
673
  inline void GpuRenderStates::SetColorMask (
673
674
    t_u32 bRed,
674
675
    t_u32 bGreen,
675
676
    t_u32 bBlue,
685
686
 
686
687
  }
687
688
 
688
 
  inline void GLRenderStates::GetColorMask (
 
689
  inline void GpuRenderStates::GetColorMask (
689
690
    t_u32& bRed,
690
691
    t_u32& bGreen,
691
692
    t_u32& bBlue,
697
698
    bAlpha  = RS_VALUE (m_RenderStateChanges[GFXRS_COLORWRITEENABLE_A]);
698
699
  }
699
700
  
700
 
  inline void GLRenderStates::SetDepthMask (t_u32 bDepth)
 
701
  inline void GpuRenderStates::SetDepthMask (t_u32 bDepth)
701
702
  {
702
703
    if ( (RS_VALUE (m_RenderStateChanges[GFXRS_ZWRITEENABLE]) != bDepth) )
703
704
    {
705
706
    }
706
707
  }
707
708
 
708
 
  inline void GLRenderStates::EnableScissor (t_u32 bScissor)
 
709
  inline void GpuRenderStates::EnableScissor (t_u32 bScissor)
709
710
  {
710
711
    if ( (RS_VALUE (m_RenderStateChanges[GFXRS_SCISSORTESTENABLE]) != bScissor) )
711
712
    {
713
714
    }
714
715
  }
715
716
 
716
 
  inline void GLRenderStates::EnableFog (t_u32 bFog)
 
717
  inline void GpuRenderStates::EnableFog (t_u32 bFog)
717
718
  {
718
719
    if ( (RS_VALUE (m_RenderStateChanges[GFXRS_FOGENABLE]) != bFog) )
719
720
    {
721
722
    }
722
723
  }
723
724
 
724
 
  inline void GLRenderStates::SetPolygonMode (t_u32 FrontMode, t_u32 BackMode)
 
725
  inline void GpuRenderStates::SetPolygonMode (t_u32 FrontMode, t_u32 BackMode)
725
726
  {
726
727
    if ( (RS_VALUE (m_RenderStateChanges[GFXRS_FRONT_POLYGONMODE]) != FrontMode) ||
727
728
         (RS_VALUE (m_RenderStateChanges[GFXRS_BACK_POLYGONMODE]) != BackMode) )
730
731
    }
731
732
  }
732
733
 
733
 
  inline void GLRenderStates::SetPolygonOffset (t_u32 bEnable,
 
734
  inline void GpuRenderStates::SetPolygonOffset (t_u32 bEnable,
734
735
      FLOAT Factor, FLOAT Units)
735
736
  {
736
737
    if (bEnable)
754
755
 
755
756
 
756
757
//////////////////////////////////////
757
 
  inline void GLRenderStates::HW__EnableAlphaTest (t_u32 b)
 
758
  inline void GpuRenderStates::HW__EnableAlphaTest (t_u32 b)
758
759
  {
759
760
    if (b)
760
761
    {
768
769
    SET_RS_VALUE (m_RenderStateChanges[GFXRS_ALPHATESTENABLE], b ? GL_TRUE : GL_FALSE);
769
770
  }
770
771
 
771
 
  inline void GLRenderStates::HW__SetAlphaTestFunc (t_u32 AlphaTestFunc_,
 
772
  inline void GpuRenderStates::HW__SetAlphaTestFunc (t_u32 AlphaTestFunc_,
772
773
      BYTE  AlphaTestRef_)
773
774
  {
774
775
    nuxAssertMsg (
787
788
    SET_RS_VALUE (m_RenderStateChanges[GFXRS_ALPHATESTREF], AlphaTestRef_);
788
789
  }
789
790
 
790
 
  inline void GLRenderStates::HW__EnableAlphaBlend (t_u32 b)
 
791
  inline void GpuRenderStates::HW__EnableAlphaBlend (t_u32 b)
791
792
  {
792
793
    if (b)
793
794
    {
801
802
    SET_RS_VALUE (m_RenderStateChanges[GFXRS_ALPHABLENDENABLE], b ? GL_TRUE : GL_FALSE);
802
803
  }
803
804
 
804
 
  inline void GLRenderStates::HW__SetSeparateAlphaBlendFactors (
 
805
  inline void GpuRenderStates::HW__SetSeparateAlphaBlendFactors (
805
806
    t_u32 SrcBlendFactor_,
806
807
    t_u32 DestBlendFactor_,
807
808
    t_u32 SrcFactorAlpha_,
828
829
    SET_RS_VALUE (m_RenderStateChanges[GFXRS_DESTBLENDALPHA], DestFactorAlpha_);
829
830
  }
830
831
 
831
 
  inline void GLRenderStates::HW__SetAlphaBlendOp (
 
832
  inline void GpuRenderStates::HW__SetAlphaBlendOp (
832
833
    t_u32 BlendOpRGB_,
833
834
    t_u32 BlendOpAlpha_)
834
835
  {
853
854
    SET_RS_VALUE (m_RenderStateChanges[GFXRS_BLENDOPALPHA], BlendOpAlpha_);
854
855
  }
855
856
 
856
 
  inline void GLRenderStates::HW__EnableCulling (t_u32 b)
 
857
  inline void GpuRenderStates::HW__EnableCulling (t_u32 b)
857
858
  {
858
859
    if (b)
859
860
    {
868
869
  }
869
870
 
870
871
 
871
 
  inline void GLRenderStates::HW__SetFrontFace (t_u32 FrontFace_)
 
872
  inline void GpuRenderStates::HW__SetFrontFace (t_u32 FrontFace_)
872
873
  {
873
874
    nuxAssertMsg (
874
875
      (FrontFace_ == GL_CW) ||
879
880
    SET_RS_VALUE (m_RenderStateChanges[GFXRS_FRONTFACE], FrontFace_);
880
881
  }
881
882
 
882
 
  inline void GLRenderStates::HW__SetCullFace (t_u32 CullFace_)
 
883
  inline void GpuRenderStates::HW__SetCullFace (t_u32 CullFace_)
883
884
  {
884
885
    nuxAssertMsg (
885
886
      (CullFace_ == GL_FRONT) ||
891
892
    SET_RS_VALUE (m_RenderStateChanges[GFXRS_CULLFACE], CullFace_);
892
893
  }
893
894
 
894
 
  inline void GLRenderStates::HW__SetEnableDepthTest (t_u32 b)
 
895
  inline void GpuRenderStates::HW__SetEnableDepthTest (t_u32 b)
895
896
  {
896
897
    if (b)
897
898
    {
905
906
    SET_RS_VALUE (m_RenderStateChanges[GFXRS_ZTESTENABLE], b ? GL_TRUE : GL_FALSE);
906
907
  }
907
908
 
908
 
  inline void GLRenderStates::HW__SetDepthRange (FLOAT zNear, FLOAT zFar)
 
909
  inline void GpuRenderStates::HW__SetDepthRange (FLOAT zNear, FLOAT zFar)
909
910
  {
910
911
    CHECKGL (glDepthRange (zNear, zFar) );
911
912
    SET_RS_VALUE (m_RenderStateChanges[GFXRS_ZNEAR], static_cast<t_u32> (Clamp (zNear, 0.0f, 1.0f) ) );
912
913
    SET_RS_VALUE (m_RenderStateChanges[GFXRS_ZFAR], static_cast<t_u32> (Clamp (zFar, 0.0f, 1.0f) ) );
913
914
  }
914
915
 
915
 
  inline void GLRenderStates::HW__SetDepthFunc (t_u32 Func)
 
916
  inline void GpuRenderStates::HW__SetDepthFunc (t_u32 Func)
916
917
  {
917
918
    nuxAssertMsg (
918
919
      (Func == GL_NEVER) ||
929
930
    SET_RS_VALUE (m_RenderStateChanges[GFXRS_ZFUNC], Func);
930
931
  }
931
932
 
932
 
  inline void GLRenderStates::HW__EnableStencil (t_u32 b)
 
933
  inline void GpuRenderStates::HW__EnableStencil (t_u32 b)
933
934
  {
934
935
    if (b)
935
936
    {
943
944
    SET_RS_VALUE (m_RenderStateChanges[GFXRS_STENCILENABLE], b ? GL_TRUE : GL_FALSE);
944
945
  }
945
946
 
946
 
  inline void GLRenderStates::HW__EnableTwoSidedStencil (t_u32 b)
 
947
  inline void GpuRenderStates::HW__EnableTwoSidedStencil (t_u32 b)
947
948
  {
948
949
    if (b)
949
950
    {
950
 
      if (m_BoardVendor == BOARD_ATI)
 
951
      if (_gpu_brand == GPU_BRAND_AMD)
951
952
      {
952
953
        CHECKGL (glEnable (GL_STENCIL_TEST) );
953
954
      }
958
959
    }
959
960
    else
960
961
    {
961
 
      if (m_BoardVendor == BOARD_ATI)
 
962
      if (_gpu_brand == GPU_BRAND_AMD)
962
963
      {
963
964
        CHECKGL (glDisable (GL_STENCIL_TEST) );
964
965
      }
971
972
    SET_RS_VALUE (m_RenderStateChanges[GFXRS_TWOSIDEDSTENCILENABLE], b ? GL_TRUE : GL_FALSE);
972
973
  }
973
974
 
974
 
  inline void GLRenderStates::HW__SetStencilFrontFaceWriteMask (t_u32 WriteMask_)
 
975
  inline void GpuRenderStates::HW__SetStencilFrontFaceWriteMask (t_u32 WriteMask_)
975
976
  {
976
977
    CHECKGL (glActiveStencilFaceEXT (GL_FRONT) );
977
978
    CHECKGL (glStencilMask (WriteMask_) );
978
979
    SET_RS_VALUE (m_RenderStateChanges[GFXRS_FRONT_STENCILWRITEMASK], WriteMask_);
979
980
  }
980
981
 
981
 
  inline void GLRenderStates::HW__SetStencilBackFaceWriteMask (t_u32 WriteMask_)
 
982
  inline void GpuRenderStates::HW__SetStencilBackFaceWriteMask (t_u32 WriteMask_)
982
983
  {
983
984
    CHECKGL (glActiveStencilFaceEXT (GL_BACK) );
984
985
    CHECKGL (glStencilMask (WriteMask_) );
986
987
  }
987
988
 
988
989
 
989
 
  inline void GLRenderStates::HW__SetFrontFaceStencilFunc (t_u32 Func_,
 
990
  inline void GpuRenderStates::HW__SetFrontFaceStencilFunc (t_u32 Func_,
990
991
      t_u32 Ref_,
991
992
      t_u32 Mask_)
992
993
  {
1009
1010
    SET_RS_VALUE (m_RenderStateChanges[GFXRS_FRONT_STENCILMASK], Mask_);
1010
1011
  }
1011
1012
 
1012
 
  inline void GLRenderStates::HW__SetBackFaceStencilFunc (
 
1013
  inline void GpuRenderStates::HW__SetBackFaceStencilFunc (
1013
1014
    t_u32 Func_,
1014
1015
    t_u32 Ref_,
1015
1016
    t_u32 Mask_)
1025
1026
      (Func_ == GL_ALWAYS),
1026
1027
      TEXT ("Error(HW__SetBackFaceStencilFunc): Invalid Stencil Function RenderState") );
1027
1028
 
1028
 
    if (m_BoardVendor == BOARD_ATI)
 
1029
    if (_gpu_brand == GPU_BRAND_AMD)
1029
1030
    {
1030
1031
      CHECKGL (glStencilFuncSeparateATI (Func_/*Front function*/, Func_/*Back function*/, Ref_, Mask_) ); // incorrect
1031
1032
    }
1040
1041
    SET_RS_VALUE (m_RenderStateChanges[GFXRS_BACK_STENCILMASK], Mask_);
1041
1042
  }
1042
1043
 
1043
 
  inline void GLRenderStates::HW__SetFrontFaceStencilOp (
 
1044
  inline void GpuRenderStates::HW__SetFrontFaceStencilOp (
1044
1045
    t_u32 FailOp_,
1045
1046
    t_u32 ZFailOp_,
1046
1047
    t_u32 ZPassOp_)
1078
1079
      (ZPassOp_ == GL_INVERT),
1079
1080
      TEXT ("Error(HW__SetFrontFaceStencilOp): Invalid ZPassOp RenderState") );
1080
1081
 
1081
 
    if (m_BoardVendor == BOARD_ATI)
 
1082
    if (_gpu_brand == GPU_BRAND_AMD)
1082
1083
    {
1083
1084
      CHECKGL (glStencilOpSeparateATI (GL_FRONT, FailOp_, ZFailOp_, ZPassOp_) );
1084
1085
    }
1093
1094
    SET_RS_VALUE (m_RenderStateChanges[GFXRS_FRONT_STENCILZPASS], ZPassOp_);
1094
1095
  }
1095
1096
 
1096
 
  inline void GLRenderStates::HW__SetBackFaceStencilOp (
 
1097
  inline void GpuRenderStates::HW__SetBackFaceStencilOp (
1097
1098
    t_u32 FailOp_,
1098
1099
    t_u32 ZFailOp_,
1099
1100
    t_u32 ZPassOp_)
1131
1132
      (ZPassOp_ == GL_INVERT),
1132
1133
      TEXT ("Error(HW__SetBackFaceStencilOp): Invalid ZPassOp RenderState") );
1133
1134
 
1134
 
    if (m_BoardVendor == BOARD_ATI)
 
1135
    if (_gpu_brand == GPU_BRAND_AMD)
1135
1136
    {
1136
1137
      CHECKGL (glStencilOpSeparateATI (GL_BACK, FailOp_, ZFailOp_, ZPassOp_) );
1137
1138
    }
1146
1147
    SET_RS_VALUE (m_RenderStateChanges[GFXRS_BACK_STENCILZPASS], ZPassOp_);
1147
1148
  }
1148
1149
 
1149
 
  inline void GLRenderStates::HW__EnableLineSmooth (t_u32 EnableLineSmooth)
 
1150
  inline void GpuRenderStates::HW__EnableLineSmooth (t_u32 EnableLineSmooth)
1150
1151
  {
1151
1152
    if (EnableLineSmooth)
1152
1153
    {
1160
1161
    SET_RS_VALUE (m_RenderStateChanges[GFXRS_LINESMOOTHENABLE], EnableLineSmooth ? GL_TRUE : GL_FALSE);
1161
1162
  }
1162
1163
 
1163
 
  inline void GLRenderStates::HW__SetLineWidth (t_u32 width,  t_u32 Hint)
 
1164
  inline void GpuRenderStates::HW__SetLineWidth (t_u32 width,  t_u32 Hint)
1164
1165
  {
1165
1166
    nuxAssertMsg (
1166
1167
      (Hint == GL_NICEST) ||
1174
1175
    SET_RS_VALUE (m_RenderStateChanges[GFXRS_LINEHINT], Hint);
1175
1176
  }
1176
1177
 
1177
 
  inline void GLRenderStates::HW__EnablePointSmooth (t_u32 EnablePointSmooth)
 
1178
  inline void GpuRenderStates::HW__EnablePointSmooth (t_u32 EnablePointSmooth)
1178
1179
  {
1179
1180
    if (EnablePointSmooth)
1180
1181
    {
1188
1189
    SET_RS_VALUE (m_RenderStateChanges[GFXRS_POINTSMOOTHENABLE], EnablePointSmooth ? GL_TRUE : GL_FALSE);
1189
1190
  }
1190
1191
 
1191
 
  inline void GLRenderStates::HW__SetPointSize (t_u32 size,  t_u32 Hint)
 
1192
  inline void GpuRenderStates::HW__SetPointSize (t_u32 size,  t_u32 Hint)
1192
1193
  {
1193
1194
    nuxAssertMsg (
1194
1195
      (Hint == GL_NICEST) ||
1202
1203
    SET_RS_VALUE (m_RenderStateChanges[GFXRS_POINTHINT], Hint);
1203
1204
  }
1204
1205
 
1205
 
  inline void GLRenderStates::HW__SetColorMask (
 
1206
  inline void GpuRenderStates::HW__SetColorMask (
1206
1207
    t_u32 bRed,
1207
1208
    t_u32 bGreen,
1208
1209
    t_u32 bBlue,
1215
1216
    SET_RS_VALUE (m_RenderStateChanges[GFXRS_COLORWRITEENABLE_A], bAlpha);
1216
1217
  }
1217
1218
 
1218
 
  inline void GLRenderStates::HW__SetDepthMask (t_u32 bDepth)
 
1219
  inline void GpuRenderStates::HW__SetDepthMask (t_u32 bDepth)
1219
1220
  {
1220
1221
    CHECKGL (glDepthMask (bDepth) );
1221
1222
    SET_RS_VALUE (m_RenderStateChanges[GFXRS_ZWRITEENABLE], bDepth);
1222
1223
  }
1223
1224
 
1224
 
  inline void GLRenderStates::HW__EnableScissor (t_u32 bScissor)
 
1225
  inline void GpuRenderStates::HW__EnableScissor (t_u32 bScissor)
1225
1226
  {
1226
1227
    if (bScissor)
1227
1228
    {
1235
1236
    SET_RS_VALUE (m_RenderStateChanges[GFXRS_SCISSORTESTENABLE], bScissor ? GL_TRUE : GL_FALSE);
1236
1237
  }
1237
1238
 
1238
 
  inline void GLRenderStates::HW__EnableFog (t_u32 bFog)
 
1239
  inline void GpuRenderStates::HW__EnableFog (t_u32 bFog)
1239
1240
  {
1240
1241
    if (bFog)
1241
1242
    {
1249
1250
    SET_RS_VALUE (m_RenderStateChanges[GFXRS_FOGENABLE], bFog ? GL_TRUE : GL_FALSE);
1250
1251
  }
1251
1252
 
1252
 
  inline void GLRenderStates::HW__SetPolygonMode (t_u32 FrontMode, t_u32 BackMode)
 
1253
  inline void GpuRenderStates::HW__SetPolygonMode (t_u32 FrontMode, t_u32 BackMode)
1253
1254
  {
1254
1255
    nuxAssertMsg (
1255
1256
      (FrontMode == GL_FILL) ||
1270
1271
    SET_RS_VALUE (m_RenderStateChanges[GFXRS_BACK_POLYGONMODE], BackMode);
1271
1272
  }
1272
1273
 
1273
 
  inline void GLRenderStates::HW__EnablePolygonOffset (t_u32 EnablePolygonOffset)
 
1274
  inline void GpuRenderStates::HW__EnablePolygonOffset (t_u32 EnablePolygonOffset)
1274
1275
  {
1275
1276
    if (EnablePolygonOffset)
1276
1277
    {
1284
1285
    SET_RS_VALUE (m_RenderStateChanges[GL_POLYGON_OFFSET_FILL], EnablePolygonOffset ? GL_TRUE : GL_FALSE);
1285
1286
  }
1286
1287
 
1287
 
  inline void GLRenderStates::HW__SetPolygonOffset (FLOAT Factor, FLOAT Units)
 
1288
  inline void GpuRenderStates::HW__SetPolygonOffset (FLOAT Factor, FLOAT Units)
1288
1289
  {
1289
1290
    CHECKGL (glPolygonOffset (Factor, Units) );
1290
1291