PixelLightAPI  .
SurfaceWindow.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: SurfaceWindow.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_H__
00024 #define __PLRENDERER_SURFACE_WINDOW_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 #include "PLRenderer/Renderer/Surface.h"
00032 
00033 
00034 //[-------------------------------------------------------]
00035 //[ Forward declarations                                  ]
00036 //[-------------------------------------------------------]
00037 namespace PLRenderer {
00038     class SurfaceWindowHandler;
00039 }
00040 
00041 
00042 //[-------------------------------------------------------]
00043 //[ Namespace                                             ]
00044 //[-------------------------------------------------------]
00045 namespace PLRenderer {
00046 
00047 
00048 //[-------------------------------------------------------]
00049 //[ Classes                                               ]
00050 //[-------------------------------------------------------]
00051 /**
00052 *  @brief
00053 *    A window renderer surface where we can render in
00054 */
00055 class SurfaceWindow : public Surface {
00056 
00057 
00058     //[-------------------------------------------------------]
00059     //[ Friends                                               ]
00060     //[-------------------------------------------------------]
00061     friend class SurfaceWindowHandler;
00062 
00063 
00064     //[-------------------------------------------------------]
00065     //[ Public functions                                      ]
00066     //[-------------------------------------------------------]
00067     public:
00068         /**
00069         *  @brief
00070         *    Destructor
00071         */
00072         PLRENDERER_API virtual ~SurfaceWindow();
00073 
00074         /**
00075         *  @brief
00076         *    Returns the renderer surface handler this surface is assigned with
00077         *
00078         *  @return
00079         *    The renderer surface handler this surface is assigned with, can be a null pointer
00080         */
00081         inline SurfaceWindowHandler *GetHandler() const;
00082 
00083         /**
00084         *  @brief
00085         *    Returns the native window the surface is assigned with
00086         *
00087         *  @return
00088         *    The native window the surface is assigned with, can be a null pointer
00089         */
00090         inline PLCore::handle GetNativeWindowHandle() const;
00091 
00092         /**
00093         *  @brief
00094         *    Returns whether the window is in fullscreen mode or not
00095         *
00096         *  @return
00097         *    'true' if the window is in fullscreen mode, else 'false'
00098         */
00099         inline bool IsFullscreen() const;
00100 
00101 
00102     //[-------------------------------------------------------]
00103     //[ Public virtual SurfaceWindow functions                ]
00104     //[-------------------------------------------------------]
00105     public:
00106         /**
00107         *  @brief
00108         *    Gets the current gamma components
00109         *
00110         *  @param[out] fRed
00111         *    Receives the red gamma component value
00112         *  @param[out] fGreen
00113         *    Receives the green gamma component value
00114         *  @param[out] fBlue
00115         *    Receives the blue gamma component value
00116         *
00117         *  @return
00118         *    'true' if all went fine, else 'false'
00119         *    (e.g. device does not support gamma correction)
00120         */
00121         virtual bool GetGamma(float &fRed, float &fGreen, float &fBlue) const = 0;
00122 
00123         /**
00124         *  @brief
00125         *    Sets the current gamma components
00126         *
00127         *  @param[in] fRed
00128         *    Red gamma component value
00129         *  @param[in] fGreen
00130         *    Green gamma component value
00131         *  @param[in] fBlue
00132         *    Blue gamma component value
00133         *
00134         *  @return
00135         *    'true' if all went fine, else 'false'
00136         *    (e.g. device does not support gamma correction)
00137         */
00138         virtual bool SetGamma(float fRed = 1.0f, float fGreen = 1.0f, float fBlue = 1.0f) = 0;
00139 
00140 
00141     //[-------------------------------------------------------]
00142     //[ Protected functions                                   ]
00143     //[-------------------------------------------------------]
00144     protected:
00145         /**
00146         *  @brief
00147         *    Constructor
00148         *
00149         *  @param[in] cHandler
00150         *    Renderer surface handler this surface is assigned with (MUST be valid!)
00151         *  @param[in] nNativeWindowHandle
00152         *    Native window the surface is assigned with
00153         *  @param[in] bFullscreen
00154         *    Fullscreen mode?
00155         */
00156         PLRENDERER_API SurfaceWindow(SurfaceWindowHandler &cHandler, PLCore::handle nNativeWindowHandle, bool bFullscreen = false);
00157 
00158 
00159     //[-------------------------------------------------------]
00160     //[ Protected data                                        ]
00161     //[-------------------------------------------------------]
00162     protected:
00163         bool m_bIsFullscreen;   /**< Is this window in fullscreen mode? */
00164 
00165 
00166     //[-------------------------------------------------------]
00167     //[ Private functions                                     ]
00168     //[-------------------------------------------------------]
00169     private:
00170         /**
00171         *  @brief
00172         *    Copy constructor
00173         *
00174         *  @param[in] cSource
00175         *    Source to copy from
00176         */
00177         SurfaceWindow(const SurfaceWindow &cSource);
00178 
00179         /**
00180         *  @brief
00181         *    Copy operator
00182         *
00183         *  @param[in] cSource
00184         *    Source to copy from
00185         *
00186         *  @return
00187         *    Reference to this instance
00188         */
00189         SurfaceWindow &operator =(const SurfaceWindow &cSource);
00190 
00191 
00192     //[-------------------------------------------------------]
00193     //[ Private data                                          ]
00194     //[-------------------------------------------------------]
00195     private:
00196         SurfaceWindowHandler *m_pHandler;               /**< Renderer surface handler this surface is assigned with, can be a null pointer */
00197         PLCore::handle        m_nNativeWindowHandle;    /**< System native window handle the surface is assigned with, can be a null pointer */
00198 
00199 
00200 };
00201 
00202 
00203 //[-------------------------------------------------------]
00204 //[ Namespace                                             ]
00205 //[-------------------------------------------------------]
00206 } // PLRenderer
00207 
00208 
00209 //[-------------------------------------------------------]
00210 //[ Implementation                                        ]
00211 //[-------------------------------------------------------]
00212 #include "PLRenderer/Renderer/SurfaceWindow.inl"
00213 
00214 
00215 #endif // __PLRENDERER_SURFACE_WINDOW_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