summaryrefslogtreecommitdiffstats
path: root/Graphics
diff options
context:
space:
mode:
Diffstat (limited to 'Graphics')
-rw-r--r--Graphics/GraphicsAccessories/interface/GraphicsAccessories.h19
-rw-r--r--Graphics/GraphicsAccessories/src/GraphicsAccessories.cpp61
2 files changed, 80 insertions, 0 deletions
diff --git a/Graphics/GraphicsAccessories/interface/GraphicsAccessories.h b/Graphics/GraphicsAccessories/interface/GraphicsAccessories.h
index a0011231..08c42da1 100644
--- a/Graphics/GraphicsAccessories/interface/GraphicsAccessories.h
+++ b/Graphics/GraphicsAccessories/interface/GraphicsAccessories.h
@@ -278,6 +278,13 @@ const Char* GetTextureAddressModeLiteralName(TEXTURE_ADDRESS_MODE AddressMode, b
const Char* GetComparisonFunctionLiteralName(COMPARISON_FUNCTION ComparisonFunc, bool bGetFullName);
+/// Returns the literal name of a stencil operation.
+
+/// \param [in] StencilOp - Stencil operation, see Diligent::STENCIL_OP.
+/// \return Literal name of the stencil operation.
+const Char* GetStencilOpLiteralName(STENCIL_OP StencilOp);
+
+
/// Returns the literal name of a blend factor.
/// \param [in] BlendFactor - Blend factor, see Diligent::BLEND_FACTOR.
@@ -292,6 +299,18 @@ const Char* GetBlendFactorLiteralName(BLEND_FACTOR BlendFactor);
const Char* GetBlendOperationLiteralName(BLEND_OPERATION BlendOp);
+/// Returns the literal name of a fill mode.
+
+/// \param [in] FillMode - Fill mode, see Diligent::FILL_MODE.
+/// \return Literal name of the fill mode.
+const Char* GetFillModeLiteralName(FILL_MODE FillMode);
+
+/// Returns the literal name of a cull mode.
+
+/// \param [in] CullMode - Cull mode, see Diligent::CULL_MODE.
+/// \return Literal name of the cull mode.
+const Char* GetCullModeLiteralName(CULL_MODE CullMode);
+
/// Returns the string containing the map type
const Char* GetMapTypeString(MAP_TYPE MapType);
diff --git a/Graphics/GraphicsAccessories/src/GraphicsAccessories.cpp b/Graphics/GraphicsAccessories/src/GraphicsAccessories.cpp
index fe954b81..2047c561 100644
--- a/Graphics/GraphicsAccessories/src/GraphicsAccessories.cpp
+++ b/Graphics/GraphicsAccessories/src/GraphicsAccessories.cpp
@@ -618,6 +618,30 @@ const Char* GetComparisonFunctionLiteralName(COMPARISON_FUNCTION ComparisonFunc,
}
}
+const Char* GetStencilOpLiteralName(STENCIL_OP StencilOp)
+{
+#define STENCIL_OP_TO_STR(Op) \
+ case Op: return #Op
+
+ switch (StencilOp)
+ {
+ STENCIL_OP_TO_STR(STENCIL_OP_UNDEFINED);
+ STENCIL_OP_TO_STR(STENCIL_OP_KEEP);
+ STENCIL_OP_TO_STR(STENCIL_OP_ZERO);
+ STENCIL_OP_TO_STR(STENCIL_OP_REPLACE);
+ STENCIL_OP_TO_STR(STENCIL_OP_INCR_SAT);
+ STENCIL_OP_TO_STR(STENCIL_OP_DECR_SAT);
+ STENCIL_OP_TO_STR(STENCIL_OP_INVERT);
+ STENCIL_OP_TO_STR(STENCIL_OP_INCR_WRAP);
+ STENCIL_OP_TO_STR(STENCIL_OP_DECR_WRAP);
+
+ default:
+ UNEXPECTED("Unexepcted stencil operation (", static_cast<Uint32>(StencilOp), ")");
+ return "UNKNOWN";
+ }
+#undef STENCIL_OP_TO_STR
+}
+
const Char* GetBlendFactorLiteralName(BLEND_FACTOR BlendFactor)
{
#define BLEND_FACTOR_TO_STR(Factor) \
@@ -672,6 +696,43 @@ const Char* GetBlendOperationLiteralName(BLEND_OPERATION BlendOp)
#undef BLEND_OP_TO_STR
}
+const Char* GetFillModeLiteralName(FILL_MODE FillMode)
+{
+#define FILL_MODE_TO_STR(Mode) \
+ case Mode: return #Mode
+
+ switch (FillMode)
+ {
+ FILL_MODE_TO_STR(FILL_MODE_UNDEFINED);
+ FILL_MODE_TO_STR(FILL_MODE_WIREFRAME);
+ FILL_MODE_TO_STR(FILL_MODE_SOLID);
+
+ default:
+ UNEXPECTED("Unexepcted fill mode (", static_cast<int>(FillMode), ")");
+ return "UNKNOWN";
+ }
+#undef FILL_MODE_TO_STR
+}
+
+const Char* GetCullModeLiteralName(CULL_MODE CullMode)
+{
+#define CULL_MODE_TO_STR(Mode) \
+ case Mode: return #Mode
+
+ switch (CullMode)
+ {
+ CULL_MODE_TO_STR(CULL_MODE_UNDEFINED);
+ CULL_MODE_TO_STR(CULL_MODE_NONE);
+ CULL_MODE_TO_STR(CULL_MODE_FRONT);
+ CULL_MODE_TO_STR(CULL_MODE_BACK);
+
+ default:
+ UNEXPECTED("Unexepcted cull mode (", static_cast<int>(CullMode), ")");
+ return "UNKNOWN";
+ }
+#undef CULL_MODE_TO_STR
+}
+
const Char* GetMapTypeString(MAP_TYPE MapType)
{
switch (MapType)