PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: SNBitmap2D.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 __PLSCENE_SCENENODE_BITMAP2D_H__ 00024 #define __PLSCENE_SCENENODE_BITMAP2D_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include "PLScene/Scene/SceneNodes/SNBitmap.h" 00032 00033 00034 //[-------------------------------------------------------] 00035 //[ Namespace ] 00036 //[-------------------------------------------------------] 00037 namespace PLScene { 00038 00039 00040 //[-------------------------------------------------------] 00041 //[ Classes ] 00042 //[-------------------------------------------------------] 00043 /** 00044 * @brief 00045 * 2D bitmap (overlay) scene node 00046 * 00047 * @remarks 00048 * This scene node type can for instance be used to draw logos 00049 * or to composite simple 'Head-Up Displays' (HUD). 00050 * 00051 * @note 00052 * - It's NOT recommended to use this scene node to construct complex GUIs! 00053 */ 00054 class SNBitmap2D : public SNBitmap { 00055 00056 00057 //[-------------------------------------------------------] 00058 //[ Public definitions ] 00059 //[-------------------------------------------------------] 00060 public: 00061 /** 00062 * @brief 00063 * Scene node flags (SceneNode flags extension) 00064 */ 00065 enum EFlags { 00066 Center = 1<<11, /**< Center the bitmap */ 00067 Pos3D = 1<<12, /**< The bitmap is placed within 3D. If this flag is not set, the node position is in 'screen space' between 0.0 and 1.0. */ 00068 Background = 1<<13 /**< Draw the bitmap at the background ('pre-draw') */ 00069 }; 00070 pl_enum(EFlags) 00071 pl_enum_base(SNBitmap::EFlags) 00072 pl_enum_value(Center, "Center the bitmap") 00073 pl_enum_value(Pos3D, "The bitmap is placed within 3D. If this flag is not set, the node position is in 'screen space' between 0.0 and 1.0.") 00074 pl_enum_value(Background, "Draw the bitmap at the background ('pre-draw')") 00075 pl_enum_end 00076 00077 00078 //[-------------------------------------------------------] 00079 //[ RTTI interface ] 00080 //[-------------------------------------------------------] 00081 pl_class(PLS_RTTI_EXPORT, SNBitmap2D, "PLScene", PLScene::SNBitmap, "2D bitmap (overlay) scene node") 00082 // Attributes 00083 pl_attribute(Width, float, 1.0f, ReadWrite, DirectValue, "Bitmap width 'screen space' between 0.0 and 1.0", "") 00084 pl_attribute(Height, float, 1.0f, ReadWrite, DirectValue, "Bitmap height 'screen space' between 0.0 and 1.0", "") 00085 // Overwritten SceneNode attributes 00086 pl_attribute(Flags, pl_flag_type(EFlags), NoCulling, ReadWrite, GetSet, "Flags", "") 00087 // Constructors 00088 pl_constructor_0(DefaultConstructor, "Default constructor", "") 00089 pl_class_end 00090 00091 00092 //[-------------------------------------------------------] 00093 //[ Public functions ] 00094 //[-------------------------------------------------------] 00095 public: 00096 /** 00097 * @brief 00098 * Default constructor 00099 */ 00100 PLS_API SNBitmap2D(); 00101 00102 /** 00103 * @brief 00104 * Destructor 00105 */ 00106 PLS_API virtual ~SNBitmap2D(); 00107 00108 00109 //[-------------------------------------------------------] 00110 //[ Private functions ] 00111 //[-------------------------------------------------------] 00112 private: 00113 /** 00114 * @brief 00115 * Draws the bitmap 00116 * 00117 * @param[in] cRenderer 00118 * The used renderer 00119 * @param[in] pVisNode 00120 * The current visibility node of this scene node, can be a null pointer 00121 */ 00122 void DrawBitmap(PLRenderer::Renderer &cRenderer, const VisNode *pVisNode); 00123 00124 00125 //[-------------------------------------------------------] 00126 //[ Public virtual SceneNode functions ] 00127 //[-------------------------------------------------------] 00128 public: 00129 PLS_API virtual void DrawPre(PLRenderer::Renderer &cRenderer, const VisNode *pVisNode) override; 00130 PLS_API virtual void DrawPost(PLRenderer::Renderer &cRenderer, const VisNode *pVisNode) override; 00131 00132 00133 }; 00134 00135 00136 //[-------------------------------------------------------] 00137 //[ Namespace ] 00138 //[-------------------------------------------------------] 00139 } // PLScene 00140 00141 00142 #endif // __PLSCENE_SCENENODE_BITMAP2D_H__
|