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