File indexing completed on 2026-09-23 09:18:38
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _OpenGl_MaterialState_HeaderFile
0017 #define _OpenGl_MaterialState_HeaderFile
0018
0019 #include <OpenGl_ShaderStates.hxx>
0020 #include <OpenGl_Material.hxx>
0021
0022
0023 class OpenGl_MaterialState : public OpenGl_StateInterface
0024 {
0025 public:
0026
0027 OpenGl_MaterialState()
0028 : myAlphaCutoff(0.5f),
0029 myToDistinguish(false),
0030 myToMapTexture(false)
0031 {
0032 }
0033
0034
0035 void Set(const OpenGl_Material& theMat,
0036 const float theAlphaCutoff,
0037 const bool theToDistinguish,
0038 const bool theToMapTexture)
0039 {
0040 myMaterial = theMat;
0041 myAlphaCutoff = theAlphaCutoff;
0042 myToDistinguish = theToDistinguish;
0043 myToMapTexture = theToMapTexture;
0044 }
0045
0046
0047 const OpenGl_Material& Material() const { return myMaterial; }
0048
0049
0050 float AlphaCutoff() const { return myAlphaCutoff; }
0051
0052
0053 bool HasAlphaCutoff() const { return myAlphaCutoff <= 1.0f; }
0054
0055
0056 bool ToDistinguish() const { return myToDistinguish; }
0057
0058
0059 bool ToMapTexture() const { return myToMapTexture; }
0060
0061 private:
0062 OpenGl_Material myMaterial;
0063 float myAlphaCutoff;
0064 bool myToDistinguish;
0065 bool myToMapTexture;
0066 };
0067
0068 #endif