Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef Clear_INCLUDE_ONCE
00033 #define Clear_INCLUDE_ONCE
00034
00035 #include <vlCore/Vector4.hpp>
00036 #include <vlGraphics/link_config.hpp>
00037 #include <vlGraphics/Renderable.hpp>
00038
00039 namespace vl
00040 {
00041
00042
00043
00069 class VLGRAPHICS_EXPORT Clear: public Renderable
00070 {
00071 public:
00072 virtual const char* className() { return "vl::Clear"; }
00073
00074 Clear();
00075
00076 virtual void render_Implementation(const Actor*, const Shader*, const Camera*, OpenGLContext*) const;
00077
00078 void setClearColorBuffer(bool clear) { mClearColorBuffer = clear; }
00079
00080 void setClearDepthBuffer(bool clear) { mClearDepthBuffer = clear; }
00081
00082 void setClearStencilBuffer(bool clear) { mClearStencilBuffer = clear; }
00083
00084 void setClearColorValue(const fvec4& clear_val) { mClearColorValue = clear_val; }
00085
00086 void setClearColorValueInt(const ivec4& clear_val) { mClearColorValueInt = clear_val; }
00087
00088 void setClearColorValueUInt(const uvec4& clear_val) { mClearColorValueUInt = clear_val; }
00089
00090 void setClearDepthValue(float clear_val) { mClearDepthValue = clear_val; }
00091
00092 void setClearStencilValue(int clear_val) { mClearStencilValue = clear_val; }
00093
00094 void setClearColorMode(EClearColorMode mode) { mClearColorMode = mode; }
00095
00096 EClearColorMode clearColorMode() const { return mClearColorMode; }
00097
00102 void setScissorBox(int x, int y, int w, int h) { mScissorBox[0] = x; mScissorBox[1] = y; mScissorBox[2] = w; mScissorBox[3] = h; }
00103
00104 void getScissorBox(int& x, int& y, int& w, int& h) { x = mScissorBox[0]; y = mScissorBox[1]; w = mScissorBox[2]; h = mScissorBox[3]; }
00105
00106
00107
00108 void updateVBOs(bool,bool) {}
00109
00110 protected:
00111 virtual void computeBounds_Implementation() { setBoundingBox(AABB()); setBoundingSphere(Sphere()); }
00112
00113 protected:
00114 fvec4 mClearColorValue;
00115 ivec4 mClearColorValueInt;
00116 uvec4 mClearColorValueUInt;
00117 int mScissorBox[4];
00118 EClearColorMode mClearColorMode;
00119 float mClearDepthValue;
00120 int mClearStencilValue;
00121 bool mClearColorBuffer;
00122 bool mClearDepthBuffer;
00123 bool mClearStencilBuffer;
00124 };
00125 }
00126
00127 #endif