# Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics

[Home] [Tutorials] [All Classes] [Grouped Classes]

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

# D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlGraphics/Clear.hpp

Go to the documentation of this file.

    00001 /**************************************************************************************/
    00002 /*                                                                                    */
    00003 /*  Visualization Library                                                             */
    00004 /*  http://www.visualizationlibrary.org                                               */
    00005 /*                                                                                    */
    00006 /*  Copyright (c) 2005-2010, Michele Bosi                                             */
    00007 /*  All rights reserved.                                                              */
    00008 /*                                                                                    */
    00009 /*  Redistribution and use in source and binary forms, with or without modification,  */
    00010 /*  are permitted provided that the following conditions are met:                     */
    00011 /*                                                                                    */
    00012 /*  - Redistributions of source code must retain the above copyright notice, this     */
    00013 /*  list of conditions and the following disclaimer.                                  */
    00014 /*                                                                                    */
    00015 /*  - Redistributions in binary form must reproduce the above copyright notice, this  */
    00016 /*  list of conditions and the following disclaimer in the documentation and/or       */
    00017 /*  other materials provided with the distribution.                                   */
    00018 /*                                                                                    */
    00019 /*  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND   */
    00020 /*  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED     */
    00021 /*  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE            */
    00022 /*  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR  */
    00023 /*  ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES    */
    00024 /*  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;      */
    00025 /*  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON    */
    00026 /*  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT           */
    00027 /*  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS     */
    00028 /*  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.                      */
    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   // Clear
    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     // Renderable interface implementation.
    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

Visualization Library v2011.09.1162 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu Jan 26 2012 00:43:36.
Permission is granted to use this page to write and publish articles regarding Visualization Library.