summaryrefslogtreecommitdiff
path: root/Runtime/GfxDevice/opengles30/FixedFunctionStateGLES30.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Runtime/GfxDevice/opengles30/FixedFunctionStateGLES30.cpp')
-rw-r--r--Runtime/GfxDevice/opengles30/FixedFunctionStateGLES30.cpp71
1 files changed, 71 insertions, 0 deletions
diff --git a/Runtime/GfxDevice/opengles30/FixedFunctionStateGLES30.cpp b/Runtime/GfxDevice/opengles30/FixedFunctionStateGLES30.cpp
new file mode 100644
index 0000000..de052b9
--- /dev/null
+++ b/Runtime/GfxDevice/opengles30/FixedFunctionStateGLES30.cpp
@@ -0,0 +1,71 @@
+#include "UnityPrefix.h"
+#include "FixedFunctionStateGLES30.h"
+#include <sstream>
+
+
+FixedFunctionStateGLES30::FixedFunctionStateGLES30 ()
+: texUnitCount(0),
+ lightType(0),
+ texUnitMatrix(0),
+ lightingEnabled(false),
+ specularEnabled(true),
+ onlyDirectionalLights(false),
+ lightCount(0),
+ useUniformInsteadOfVertexColor(false),
+ useVertexColorAsAmbientAndDiffuse(false),
+ useVertexColorAsEmission(false),
+ fogMode(kFogDisabled),
+ addSpecularAfterTexturing(false),
+ alphaTest(kFuncDisabled)
+{
+ for (int q = 0; q < kMaxSupportedTextureUnitsGLES; ++q)
+ {
+ texUnitCube[q] = false;
+ texUnitGen[q] = kTexGenDisabled;
+ texUnitColorCombiner[q] = ~0UL;
+ texUnitAlphaCombiner[q] = ~0UL;
+ }
+}
+
+static std::string CombinerToString (unsigned int combinerDesc)
+{
+ std::ostringstream s;
+ s << combinerDesc;
+ return s.str().c_str();
+}
+
+
+std::string FixedFunctionStateGLES30::ToString () const
+{
+ std::ostringstream s;
+
+ s << "FixedFunctionStateGLES30::ToString():\n";
+ s << " lightingEnabled = " << lightingEnabled << "\n";
+ s << " specularEnabled = " << specularEnabled << "\n";
+ s << " lights = " << lightCount << "\n";
+ for (int i = 0; i < lightCount; ++i)
+ s << " light" << i << " : " << GetLightType(i) << "\n";
+
+ s << " useUniformInsteadOfVertexColor = " << useUniformInsteadOfVertexColor << "\n";
+ s << " useVertexColorAsAmbientAndDiffuse = " << useVertexColorAsAmbientAndDiffuse << "\n";
+ s << " useVertexColorAsEmission = " << useVertexColorAsEmission << "\n";
+
+ s << " fogMode = " << fogMode << "\n";
+
+ for (int i = 0; i < texUnitCount; ++i)
+ {
+ s << " texture " << i << "\n";
+
+ s << " CUBE = " << ((texUnitCube[i])? "true": "false") << "\n";
+ s << " rgb combiner = " << CombinerToString(texUnitColorCombiner[i]) << "\n";
+ s << " alpba combiner = " << CombinerToString(texUnitAlphaCombiner[i]) << "\n";
+ s << " texGen = " << texUnitGen[i] << "\n";
+ s << " need matrix: " << (NeedTexUnitMatrix(i)?"true":"false") << "\n";
+ s << " need perspective divide: " << (IsTexUnitProjected(i)?"true":"false") << "\n";
+ }
+
+ s << " addSpecularafterTexturing = " << addSpecularAfterTexturing << "\n";
+ s << " alphaTest = " << alphaTest << "\n";
+
+ return s.str().c_str();
+}