PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: SurfaceWindowHandler.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_WINDOW_HANDLER_H__ 00024 #define __PLRENDERER_SURFACE_WINDOW_HANDLER_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include "PLRenderer/PLRenderer.h" 00032 00033 00034 //[-------------------------------------------------------] 00035 //[ Forward declarations ] 00036 //[-------------------------------------------------------] 00037 namespace PLRenderer { 00038 struct DisplayMode; 00039 class Surface; 00040 class Renderer; 00041 class SurfaceHandler; 00042 } 00043 00044 00045 //[-------------------------------------------------------] 00046 //[ Namespace ] 00047 //[-------------------------------------------------------] 00048 namespace PLRenderer { 00049 00050 00051 //[-------------------------------------------------------] 00052 //[ Classes ] 00053 //[-------------------------------------------------------] 00054 /** 00055 * @brief 00056 * A renderer surface window handler will be informed automatically 00057 * if it's renderer surface is destroyed 00058 */ 00059 class SurfaceWindowHandler { 00060 00061 00062 //[-------------------------------------------------------] 00063 //[ Friends ] 00064 //[-------------------------------------------------------] 00065 friend class SurfaceWindow; 00066 00067 00068 //[-------------------------------------------------------] 00069 //[ Public functions ] 00070 //[-------------------------------------------------------] 00071 public: 00072 /** 00073 * @brief 00074 * Constructor 00075 */ 00076 PLRENDERER_API SurfaceWindowHandler(); 00077 00078 /** 00079 * @brief 00080 * Destructor 00081 */ 00082 PLRENDERER_API virtual ~SurfaceWindowHandler(); 00083 00084 /** 00085 * @brief 00086 * Returns the owner renderer 00087 * 00088 * @return 00089 * The owner renderer, can be a null pointer 00090 */ 00091 inline Renderer *GetRenderer() const; 00092 00093 /** 00094 * @brief 00095 * Returns the renderer surface of this handler 00096 * 00097 * @return 00098 * The renderer surface of this handler, can be a null pointer 00099 */ 00100 inline Surface *GetSurface() const; 00101 00102 00103 //[-------------------------------------------------------] 00104 //[ Protected functions ] 00105 //[-------------------------------------------------------] 00106 protected: 00107 /** 00108 * @brief 00109 * Initializes the surface window handler 00110 * 00111 * @param[in] cRenderer 00112 * Owner renderer 00113 * @param[in] nNativeWindowHandle 00114 * Native window of renderer surface handler is assigned with 00115 * @param[in] sDisplayMode 00116 * Display mode information 00117 * @param[in] bFullscreen 00118 * Fullscreen mode? 00119 */ 00120 PLRENDERER_API void Init(Renderer &cRenderer, PLCore::handle nNativeWindowHandle, const DisplayMode &sDisplayMode, bool bFullscreen = false); 00121 00122 /** 00123 * @brief 00124 * De-initializes the surface window handler 00125 */ 00126 PLRENDERER_API void DeInit(); 00127 00128 00129 //[-------------------------------------------------------] 00130 //[ Protected data ] 00131 //[-------------------------------------------------------] 00132 protected: 00133 Renderer *m_pRenderer; /**< Owner renderer (can be a null pointer) */ 00134 SurfaceHandler *m_pSurfaceHandler; /**< The renderer surface handler (NEVER a null pointer!) */ 00135 00136 00137 //[-------------------------------------------------------] 00138 //[ Private functions ] 00139 //[-------------------------------------------------------] 00140 private: 00141 /** 00142 * @brief 00143 * Copy constructor 00144 * 00145 * @param[in] cSource 00146 * Source to copy from 00147 */ 00148 SurfaceWindowHandler(const SurfaceWindowHandler &cSource); 00149 00150 /** 00151 * @brief 00152 * Copy operator 00153 * 00154 * @param[in] cSource 00155 * Source to copy from 00156 * 00157 * @return 00158 * Reference to this instance 00159 */ 00160 SurfaceWindowHandler &operator =(const SurfaceWindowHandler &cSource); 00161 00162 00163 }; 00164 00165 00166 //[-------------------------------------------------------] 00167 //[ Namespace ] 00168 //[-------------------------------------------------------] 00169 } // PLRenderer 00170 00171 00172 //[-------------------------------------------------------] 00173 //[ Implementation ] 00174 //[-------------------------------------------------------] 00175 #include "PLRenderer/Renderer/SurfaceWindowHandler.inl" 00176 00177 00178 #endif // __PLRENDERER_SURFACE_WINDOW_HANDLER_H__
|