00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __PLRENDERER_FIXEDFUNCTIONSRENDERSTATES_H__
00024 #define __PLRENDERER_FIXEDFUNCTIONSRENDERSTATES_H__
00025 #pragma once
00026
00027
00028
00029
00030
00031 #include <PLCore/Base/Object.h>
00032 #include <PLGraphics/Color/Color4.h>
00033 #include "PLRenderer/Renderer/FixedFunctions.h"
00034
00035
00036
00037
00038
00039 namespace PLRenderer {
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 class FixedFunctionsRenderStates : public PLCore::Object {
00050
00051
00052
00053
00054
00055 pl_class(PLRENDERER_RTTI_EXPORT, FixedFunctionsRenderStates, "PLRenderer", PLCore::Object, "Fixed functions render states RTTI wrapper class")
00056
00057
00058 pl_attribute(FogEnable, bool, false, ReadWrite, GetSet, "Enable/disable fog", "")
00059 pl_attribute(FogColor, PLGraphics::Color4, PLGraphics::Color4(0.0f, 0.0f, 0.0f, 0.0f), ReadWrite, GetSet, "RGBA fog color", "")
00060 pl_attribute(FogDensity, float, 1.0f, ReadWrite, GetSet, "Fog density", "")
00061 pl_attribute(FogStart, float, 0.0f, ReadWrite, GetSet, "Fog start", "")
00062 pl_attribute(FogEnd, float, 1.0f, ReadWrite, GetSet, "Fog end", "")
00063 pl_attribute(FogMode, pl_enum_type(FixedFunctions::Fog::Enum), FixedFunctions::Fog::Exp, ReadWrite, GetSet, "Fog mode", "")
00064
00065 pl_attribute(AlphaTestEnable, bool, false, ReadWrite, GetSet, "Enable/disable alpha test", "")
00066 pl_attribute(AlphaTestFunction, pl_enum_type(Compare::Enum), Compare::GreaterEqual, ReadWrite, GetSet, "Alpha test comparison function", "")
00067 pl_attribute(AlphaTestReference, float, 1.0f, ReadWrite, GetSet, "Alpha test reference value", "")
00068
00069 pl_attribute(Lighting, bool, true, ReadWrite, GetSet, "Enable/disable lighting", "")
00070 pl_attribute(Ambient, PLGraphics::Color4, PLGraphics::Color4(0.0f, 0.0f, 0.0f, 0.0f), ReadWrite, GetSet, "General RGBA ambient color", "")
00071 pl_attribute(NormalizeNormals, bool, true, ReadWrite, GetSet, "Enable/disable normalize normals", "")
00072 pl_attribute(ShadeMode, pl_enum_type(FixedFunctions::Shade::Enum), FixedFunctions::Shade::Smooth, ReadWrite, GetSet, "Shade mode", "")
00073 pl_class_end
00074
00075
00076
00077
00078
00079 public:
00080
00081 PLRENDERER_API bool GetFogEnable() const;
00082 PLRENDERER_API void SetFogEnable(bool bValue);
00083 PLRENDERER_API PLGraphics::Color4 GetFogColor() const;
00084 PLRENDERER_API void SetFogColor(const PLGraphics::Color4 &cValue);
00085 PLRENDERER_API float GetFogDensity() const;
00086 PLRENDERER_API void SetFogDensity(float fValue);
00087 PLRENDERER_API float GetFogStart() const;
00088 PLRENDERER_API void SetFogStart(float fValue);
00089 PLRENDERER_API float GetFogEnd() const;
00090 PLRENDERER_API void SetFogEnd(float fValue);
00091 PLRENDERER_API FixedFunctions::Fog::Enum GetFogMode() const;
00092 PLRENDERER_API void SetFogMode(FixedFunctions::Fog::Enum nValue);
00093
00094 PLRENDERER_API bool GetAlphaTestEnable() const;
00095 PLRENDERER_API void SetAlphaTestEnable(bool bValue);
00096 PLRENDERER_API Compare::Enum GetAlphaTestFunction() const;
00097 PLRENDERER_API void SetAlphaTestFunction(Compare::Enum nValue);
00098 PLRENDERER_API float GetAlphaTestReference() const;
00099 PLRENDERER_API void SetAlphaTestReference(float fValue);
00100
00101 PLRENDERER_API bool GetLighting() const;
00102 PLRENDERER_API void SetLighting(bool bValue);
00103 PLRENDERER_API PLGraphics::Color4 GetAmbient() const;
00104 PLRENDERER_API void SetAmbient(const PLGraphics::Color4 &cValue);
00105 PLRENDERER_API bool GetNormalizeNormals() const;
00106 PLRENDERER_API void SetNormalizeNormals(bool bValue);
00107 PLRENDERER_API FixedFunctions::Shade::Enum GetShadeMode() const;
00108 PLRENDERER_API void SetShadeMode(FixedFunctions::Shade::Enum nValue);
00109
00110
00111
00112
00113
00114 public:
00115
00116
00117
00118
00119 PLRENDERER_API FixedFunctionsRenderStates();
00120
00121
00122
00123
00124
00125
00126
00127
00128 PLRENDERER_API FixedFunctionsRenderStates(const FixedFunctionsRenderStates &cSource);
00129
00130
00131
00132
00133
00134 PLRENDERER_API virtual ~FixedFunctionsRenderStates();
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150 PLRENDERER_API PLCore::uint32 Get(FixedFunctions::RenderState::Enum nState) const;
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169 PLRENDERER_API bool Set(FixedFunctions::RenderState::Enum nState, PLCore::uint32 nValue);
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181 PLRENDERER_API FixedFunctionsRenderStates &operator =(const FixedFunctionsRenderStates &cSource);
00182
00183
00184
00185
00186
00187 private:
00188
00189 PLCore::uint32 m_nRS[FixedFunctions::RenderState::Number];
00190
00191
00192 };
00193
00194
00195
00196
00197
00198 }
00199
00200
00201 #endif // __PLRENDERER_FIXEDFUNCTIONSRENDERSTATES_H__