File indexing completed on 2025-01-18 10:04:34
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
0028 OpenGl_MaterialState() : myAlphaCutoff (0.5f), myToDistinguish (false), myToMapTexture (false) {}
0029
0030
0031 void Set (const OpenGl_Material& theMat,
0032 const float theAlphaCutoff,
0033 const bool theToDistinguish,
0034 const bool theToMapTexture)
0035 {
0036 myMaterial = theMat;
0037 myAlphaCutoff = theAlphaCutoff;
0038 myToDistinguish = theToDistinguish;
0039 myToMapTexture = theToMapTexture;
0040 }
0041
0042
0043 const OpenGl_Material& Material() const { return myMaterial; }
0044
0045
0046 float AlphaCutoff() const { return myAlphaCutoff; }
0047
0048
0049 bool HasAlphaCutoff() const { return myAlphaCutoff <= 1.0f; }
0050
0051
0052 bool ToDistinguish() const { return myToDistinguish; }
0053
0054
0055 bool ToMapTexture() const { return myToMapTexture; }
0056
0057 private:
0058
0059 OpenGl_Material myMaterial;
0060 float myAlphaCutoff;
0061 bool myToDistinguish;
0062 bool myToMapTexture;
0063
0064 };
0065
0066 #endif