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