PixelLightAPI  .
SNConsole.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: SNConsole.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_STANDARDCONSOLE_H__
00024 #define __PLENGINE_COMPOSITING_STANDARDCONSOLE_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 
00032 
00033 // [TODO] Use FS own functions for this if implemented...
00034 #ifdef WIN32
00035     #include <PLCore/PLCoreWindowsIncludes.h>
00036 #endif
00037 
00038 
00039 #include <PLRenderer/Material/MaterialHandler.h>
00040 #include "PLEngine/Compositing/Console/SNConsoleBase.h"
00041 
00042 
00043 //[-------------------------------------------------------]
00044 //[ Namespace                                             ]
00045 //[-------------------------------------------------------]
00046 namespace PLEngine {
00047 
00048 
00049 //[-------------------------------------------------------]
00050 //[ Classes                                               ]
00051 //[-------------------------------------------------------]
00052 /**
00053 *  @brief
00054 *    Standard console implementation
00055 */
00056 class SNConsole : public SNConsoleBase {
00057 
00058 
00059     //[-------------------------------------------------------]
00060     //[ Public definitions                                    ]
00061     //[-------------------------------------------------------]
00062     public:
00063         static const PLCore::String StandardMaterial; /**< Standard console material */
00064 
00065 
00066     //[-------------------------------------------------------]
00067     //[ RTTI interface                                        ]
00068     //[-------------------------------------------------------]
00069     pl_class(PL_RTTI_EXPORT, SNConsole, "PLEngine", PLEngine::SNConsoleBase, "Standard console implementation")
00070         // Constructors
00071         pl_constructor_0(DefaultConstructor,    "Default constructor",  "")
00072     pl_class_end
00073 
00074 
00075     //[-------------------------------------------------------]
00076     //[ Public functions                                      ]
00077     //[-------------------------------------------------------]
00078     public:
00079         /**
00080         *  @brief
00081         *    Default constructor
00082         */
00083         PL_API SNConsole();
00084 
00085         /**
00086         *  @brief
00087         *    Destructor
00088         */
00089         PL_API virtual ~SNConsole();
00090 
00091         // Get
00092         PL_API float GetPos() const;
00093         PL_API float GetMaxPos() const;
00094         PL_API PLRenderer::Material *GetMaterial();
00095 
00096         // Set
00097         PL_API void SetPos(float fNewPos);
00098         PL_API void SetMaxPos(float fMax);
00099         PL_API void SetAlpha(float fNewAlpha);
00100 
00101         // Overridden virtual
00102         PL_API PLCore::String GetDescription() const;
00103 
00104 
00105     //[-------------------------------------------------------]
00106     //[ Private functions                                     ]
00107     //[-------------------------------------------------------]
00108     private:
00109         /**
00110         *  @brief
00111         *    Called when the scene node needs to be updated
00112         */
00113         void OnUpdate();
00114 
00115 
00116     //[-------------------------------------------------------]
00117     //[ Private event handlers                                ]
00118     //[-------------------------------------------------------]
00119     private:
00120         PLCore::EventHandler<> EventHandlerUpdate;
00121 
00122 
00123     //[-------------------------------------------------------]
00124     //[ Private data                                          ]
00125     //[-------------------------------------------------------]
00126     private:
00127         int                         m_nRow;         /**< Current log row */
00128         PLCore::uint32              m_nLastRow;     /**< Last log row */
00129         float                       m_fPos;         /**< Y position (between 0 and 1) */
00130         float                       m_fMaxPos;      /**< Maximum position (between 0..1) */
00131         float                       m_fAlpha;       /**< Transparency (255 = full opacity) */
00132         PLRenderer::MaterialHandler m_cMaterial;    /**< Console material */
00133 
00134 
00135         // [TODO] Use FS own functions for this if implemented...
00136         // Log view
00137         #ifdef WIN32
00138             FILETIME  m_LastTime;
00139             DWORD     m_nLastFileSizeHigh;
00140             DWORD     m_nLastFileSizeLow;
00141         #endif
00142 
00143 
00144         PLCore::Array<PLCore::String> m_lstLogLines;    /**< Log lines */
00145 
00146 
00147     //[-------------------------------------------------------]
00148     //[ Public virtual PLScene::SceneNode functions           ]
00149     //[-------------------------------------------------------]
00150     public:
00151         PL_API virtual void DrawPost(PLRenderer::Renderer &cRenderer, const PLScene::VisNode *pVisNode = nullptr) override;
00152 
00153 
00154     //[-------------------------------------------------------]
00155     //[ Private virtual PLScene::SceneNode functions          ]
00156     //[-------------------------------------------------------]
00157     private:
00158         virtual void InitFunction() override;
00159 
00160 
00161 };
00162 
00163 
00164 //[-------------------------------------------------------]
00165 //[ Namespace                                             ]
00166 //[-------------------------------------------------------]
00167 } // PLEngine
00168 
00169 
00170 #endif // __PLENGINE_COMPOSITING_STANDARDCONSOLE_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