PixelLightAPI  .
SNLoadScreenBase.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: SNLoadScreenBase.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 __PLENGINE_COMPOSITING_LOADSCREENBASE_H__
00024 #define __PLENGINE_COMPOSITING_LOADSCREENBASE_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 #include <PLScene/Scene/SceneNode.h>
00032 #include "PLEngine/PLEngine.h"
00033 
00034 
00035 //[-------------------------------------------------------]
00036 //[ Namespace                                             ]
00037 //[-------------------------------------------------------]
00038 namespace PLEngine {
00039 
00040 
00041 //[-------------------------------------------------------]
00042 //[ Classes                                               ]
00043 //[-------------------------------------------------------]
00044 /**
00045 *  @brief
00046 *    Abstract load screen base scene node
00047 *
00048 *  @remarks
00049 *    This scene node listens to the 'load progress'-event of its parent and visualizes it. If
00050 *    the progress is NOT between 0.0-1.0 the load screen will hide itself.
00051 */
00052 class SNLoadScreenBase : public PLScene::SceneNode {
00053 
00054 
00055     //[-------------------------------------------------------]
00056     //[ RTTI interface                                        ]
00057     //[-------------------------------------------------------]
00058     pl_class(PL_RTTI_EXPORT, SNLoadScreenBase, "PLEngine", PLScene::SceneNode, "Abstract load screen base scene node")
00059         // Attributes
00060             // Overwritten SceneNode attributes
00061         pl_attribute(Flags, pl_flag_type(EFlags),   NoCulling,  ReadWrite,  GetSet, "Flags",    "")
00062     pl_class_end
00063 
00064 
00065     //[-------------------------------------------------------]
00066     //[ Protected functions                                   ]
00067     //[-------------------------------------------------------]
00068     protected:
00069         /**
00070         *  @brief
00071         *    Default constructor
00072         */
00073         PL_API SNLoadScreenBase();
00074 
00075         /**
00076         *  @brief
00077         *    Destructor
00078         */
00079         PL_API virtual ~SNLoadScreenBase();
00080 
00081         /**
00082         *  @brief
00083         *    Returns the current load progress
00084         *
00085         *  @return
00086         *    The current load progress between 0.0-1.0
00087         */
00088         PL_API float GetLoadProgress() const;
00089 
00090 
00091     //[-------------------------------------------------------]
00092     //[ Private functions                                     ]
00093     //[-------------------------------------------------------]
00094     private:
00095         /**
00096         *  @brief
00097         *    Called when the scene node container changed
00098         */
00099         void OnContainer();
00100 
00101         /**
00102         *  @brief
00103         *    Called on load progress
00104         *
00105         *  @param[in] fLoadProgress
00106         *    Load progress (0.0-1.0)
00107         */
00108         void OnLoadProgress(float fLoadProgress);
00109 
00110 
00111     //[-------------------------------------------------------]
00112     //[ Private event handlers                                ]
00113     //[-------------------------------------------------------]
00114     private:
00115         PLCore::EventHandler<>      EventHandlerContainer;
00116         PLCore::EventHandler<float> EventHandlerLoadProgress;
00117 
00118 
00119     //[-------------------------------------------------------]
00120     //[ Private data                                          ]
00121     //[-------------------------------------------------------]
00122     private:
00123         PLScene::SceneContainer *m_pContainer;      /**< Current parent container, can be a null pointer */
00124         float                    m_fLoadProgress;   /**< Current load progress (0.0-1.0) */
00125 
00126 
00127     //[-------------------------------------------------------]
00128     //[ Public virtual PLScene::SceneNode functions           ]
00129     //[-------------------------------------------------------]
00130     public:
00131         PL_API virtual void DrawPost(PLRenderer::Renderer &cRenderer, const PLScene::VisNode *pVisNode = nullptr) override;
00132 
00133 
00134 };
00135 
00136 
00137 //[-------------------------------------------------------]
00138 //[ Namespace                                             ]
00139 //[-------------------------------------------------------]
00140 } // PLEngine
00141 
00142 
00143 #endif // __PLENGINE_COMPOSITING_LOADSCREENBASE_H__


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