PixelLightAPI  .
SurfaceHandler.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: SurfaceHandler.h                               *
00003  *
00004  *  Copyright (C) 2002-2011 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_SURFACE_HANDLER_H__
00024 #define __PLRENDERER_SURFACE_HANDLER_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 #include <PLCore/PLCore.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 
00046 
00047 //[-------------------------------------------------------]
00048 //[ Classes                                               ]
00049 //[-------------------------------------------------------]
00050 /**
00051 *  @brief
00052 *    A renderer surface handler will be informed automatically
00053 *    if it's renderer surface is destroyed
00054 */
00055 class SurfaceHandler {
00056 
00057 
00058     //[-------------------------------------------------------]
00059     //[ Friends                                               ]
00060     //[-------------------------------------------------------]
00061     friend class Surface;
00062 
00063 
00064     //[-------------------------------------------------------]
00065     //[ Public functions                                      ]
00066     //[-------------------------------------------------------]
00067     public:
00068         /**
00069         *  @brief
00070         *    Constructor
00071         */
00072         PLRENDERER_API SurfaceHandler();
00073 
00074         /**
00075         *  @brief
00076         *    Copy constructor
00077         *
00078         *  @param[in] cSource
00079         *    Source to copy from
00080         */
00081         PLRENDERER_API SurfaceHandler(const SurfaceHandler &cSource);
00082 
00083         /**
00084         *  @brief
00085         *    Destructor
00086         */
00087         PLRENDERER_API ~SurfaceHandler();
00088 
00089         /**
00090         *  @brief
00091         *    Copy operator
00092         *
00093         *  @param[in] cSource
00094         *    Source to copy from
00095         *
00096         *  @return
00097         *    Reference to this instance
00098         */
00099         PLRENDERER_API SurfaceHandler &operator =(const SurfaceHandler &cSource);
00100 
00101         /**
00102         *  @brief
00103         *    Returns the renderer surface of this handler
00104         *
00105         *  @return
00106         *    The renderer surface of this handler, can be a null pointer
00107         */
00108         inline Surface *GetSurface() const;
00109 
00110         /**
00111         *  @brief
00112         *    Set the renderer surface of this handler
00113         *
00114         *  @param[in] pSurface
00115         *    The renderer surface of this handler, can be a null pointer
00116         */
00117         PLRENDERER_API void SetSurface(Surface *pSurface = nullptr);
00118 
00119 
00120     //[-------------------------------------------------------]
00121     //[ Private data                                          ]
00122     //[-------------------------------------------------------]
00123     private:
00124         Surface *m_pSurface;    /**< The renderer handlers surface, can be a null pointer */
00125 
00126 
00127 };
00128 
00129 
00130 //[-------------------------------------------------------]
00131 //[ Namespace                                             ]
00132 //[-------------------------------------------------------]
00133 } // PLRenderer
00134 
00135 
00136 //[-------------------------------------------------------]
00137 //[ Implementation                                        ]
00138 //[-------------------------------------------------------]
00139 #include "PLRenderer/Renderer/SurfaceHandler.inl"
00140 
00141 
00142 #endif // __PLRENDERER_SURFACE_HANDLER_H__


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:51:04
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported