PixelLightAPI  .
SurfacePainter.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: SurfacePainter.h                               *
00003  *
00004  *  Copyright (C) 2002-2012 The PixelLight Team (http://www.pixellight.org/)
00005  *
00006  *  This file is part of PixelLight.
00007  *
00008  *  PixelLight is free software: you can redistribute it and/or modify
00009  *  it under the terms of the GNU Lesser General Public License as published by
00010  *  the Free Software Foundation, either version 3 of the License, or
00011  *  (at your option) any later version.
00012  *
00013  *  PixelLight is distributed in the hope that it will be useful,
00014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00016  *  GNU Lesser General Public License for more details.
00017  *
00018  *  You should have received a copy of the GNU Lesser General Public License
00019  *  along with PixelLight. If not, see <http://www.gnu.org/licenses/>.
00020 \*********************************************************/
00021 
00022 
00023 #ifndef __PLRENDERER_SURFACEPAINTER_H__
00024 #define __PLRENDERER_SURFACEPAINTER_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 #include <PLCore/Base/Object.h>
00032 #include "PLRenderer/PLRenderer.h"
00033 
00034 
00035 //[-------------------------------------------------------]
00036 //[ Namespace                                             ]
00037 //[-------------------------------------------------------]
00038 namespace PLRenderer {
00039 
00040 
00041 //[-------------------------------------------------------]
00042 //[ Forward declarations                                  ]
00043 //[-------------------------------------------------------]
00044 class Surface;
00045 class Renderer;
00046 
00047 
00048 //[-------------------------------------------------------]
00049 //[ Classes                                               ]
00050 //[-------------------------------------------------------]
00051 /**
00052 *  @brief
00053 *    Abstract surface painter base class
00054 *
00055 *  @note
00056 *    - Derived classes should use a 'SP' name prefix (example: SPPreview)
00057 */
00058 class SurfacePainter : public PLCore::Object {
00059 
00060 
00061     //[-------------------------------------------------------]
00062     //[ Friends                                               ]
00063     //[-------------------------------------------------------]
00064     friend class Surface;
00065 
00066 
00067     //[-------------------------------------------------------]
00068     //[ RTTI interface                                        ]
00069     //[-------------------------------------------------------]
00070     pl_class(PLRENDERER_RTTI_EXPORT, SurfacePainter, "PLRenderer", PLCore::Object, "Abstract surface painter base class")
00071     pl_class_end
00072 
00073 
00074     //[-------------------------------------------------------]
00075     //[ Public functions                                      ]
00076     //[-------------------------------------------------------]
00077     public:
00078         /**
00079         *  @brief
00080         *    Returns the owner renderer
00081         *
00082         *  @return
00083         *    The owner renderer
00084         */
00085         inline Renderer &GetRenderer() const;
00086 
00087 
00088     //[-------------------------------------------------------]
00089     //[ Protected functions                                   ]
00090     //[-------------------------------------------------------]
00091     protected:
00092         /**
00093         *  @brief
00094         *    Copy constructor (not implemented!)
00095         *
00096         *  @param[in] cSource
00097         *    Source to copy from
00098         */
00099         SurfacePainter(const SurfacePainter &cSource);
00100 
00101         /**
00102         *  @brief
00103         *    Constructor
00104         *
00105         *  @param[in] cRenderer
00106         *    Renderer to use
00107         */
00108         PLRENDERER_API SurfacePainter(Renderer &cRenderer);
00109 
00110 
00111     //[-------------------------------------------------------]
00112     //[ Protected virtual SurfacePainter functions            ]
00113     //[-------------------------------------------------------]
00114     protected:
00115         /**
00116         *  @brief
00117         *    Destructor
00118         */
00119         PLRENDERER_API virtual ~SurfacePainter();
00120 
00121         /**
00122         *  @brief
00123         *    Is called when the owner surface is paint process begins
00124         *
00125         *  @param[in] cSurface
00126         *    Surface we're painting on
00127         *
00128         *  @return
00129         *    'true' if all went fine, else 'false'
00130         */
00131         PLRENDERER_API virtual bool OnPaintBegin(Surface &cSurface);
00132 
00133         /**
00134         *  @brief
00135         *    Is called when the owner surface is painted
00136         *
00137         *  @param[in] cSurface
00138         *    Surface we're painting on
00139         */
00140         virtual void OnPaint(Surface &cSurface) = 0;
00141 
00142         /**
00143         *  @brief
00144         *    Is called when the owner surface is paint process ends
00145         *
00146         *  @param[in] cSurface
00147         *    Surface we're painting on
00148         */
00149         PLRENDERER_API virtual void OnPaintEnd(Surface &cSurface);
00150 
00151 
00152     //[-------------------------------------------------------]
00153     //[ Private functions                                     ]
00154     //[-------------------------------------------------------]
00155     private:
00156         /**
00157         *  @brief
00158         *    Copy operator
00159         *
00160         *  @param[in] cSource
00161         *    Source to copy from
00162         *
00163         *  @return
00164         *    Reference to this instance
00165         */
00166         SurfacePainter &operator =(const SurfacePainter &cSource);
00167 
00168 
00169     //[-------------------------------------------------------]
00170     //[ Private data                                          ]
00171     //[-------------------------------------------------------]
00172     private:
00173         Renderer *m_pRenderer;  /**< The owner renderer (always valid!) */
00174 
00175 
00176 };
00177 
00178 
00179 //[-------------------------------------------------------]
00180 //[ Namespace                                             ]
00181 //[-------------------------------------------------------]
00182 } // PLRenderer
00183 
00184 
00185 //[-------------------------------------------------------]
00186 //[ Implementation                                        ]
00187 //[-------------------------------------------------------]
00188 #include "PLRenderer/Renderer/SurfacePainter.inl"
00189 
00190 
00191 #endif // __PLRENDERER_SURFACEPAINTER_H__


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:09:01
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported