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 VL_INSTRUMENT_CLASS(vl::Clear, Renderable)
00072
00073 public:
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 virtual void updateDirtyBufferObject(EBufferObjectUpdateMode) {}
00109
00110 virtual void deleteBufferObject() {}
00111
00112 protected:
00113 virtual void computeBounds_Implementation() { setBoundingBox(AABB()); setBoundingSphere(Sphere()); }
00114
00115 protected:
00116 fvec4 mClearColorValue;
00117 ivec4 mClearColorValueInt;
00118 uvec4 mClearColorValueUInt;
00119 int mScissorBox[4];
00120 EClearColorMode mClearColorMode;
00121 float mClearDepthValue;
00122 int mClearStencilValue;
00123 bool mClearColorBuffer;
00124 bool mClearDepthBuffer;
00125 bool mClearStencilBuffer;
00126 };
00127 }
00128
00129 #endif