PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: TextureBufferCube.h * 00003 * 00004 * Copyright (C) 2002-2012 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_TEXTUREBUFFERCUBE_H__ 00024 #define __PLRENDERER_TEXTUREBUFFERCUBE_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include "PLRenderer/Renderer/TextureBuffer.h" 00032 00033 00034 //[-------------------------------------------------------] 00035 //[ Namespace ] 00036 //[-------------------------------------------------------] 00037 namespace PLRenderer { 00038 00039 00040 //[-------------------------------------------------------] 00041 //[ Classes ] 00042 //[-------------------------------------------------------] 00043 /** 00044 * @brief 00045 * Abstract renderer cube texture buffer resource 00046 * 00047 * @remarks 00048 * The order of the cube map faces is: x-positive (0, left), x-negative (1, right), 00049 * y-positive (2, top), y-negative (3, bottom), z-positive (4, back), z-negative (5, front) 00050 * 00051 * @code 00052 * Texture buffer faces: 00053 * ---------- 00054 * | Top | 00055 * | + Y | 00056 * ----------------------------------- 00057 * | Left | Front | Right | Back | 00058 * | + X | - Z | - X | + Z | 00059 * ----------------------------------- 00060 * | Bottom | 00061 * | - Y | 00062 * ---------- 00063 * 00064 * Coordinate system: 00065 * +y (top) 00066 * | 00067 * | -z (front) 00068 * | / 00069 * | / 00070 * -x (right) _______|/_______ +x (left) 00071 * /| 00072 * / | 00073 * / | 00074 * +z (back) | 00075 * -y (bottom) 00076 * @endcode 00077 */ 00078 class TextureBufferCube : public TextureBuffer { 00079 00080 00081 //[-------------------------------------------------------] 00082 //[ Public functions ] 00083 //[-------------------------------------------------------] 00084 public: 00085 /** 00086 * @brief 00087 * Destructor 00088 */ 00089 PLRENDERER_API virtual ~TextureBufferCube(); 00090 00091 /** 00092 * @brief 00093 * Returns the texture buffer size 00094 * 00095 * @param[in] nMipmap 00096 * Mipmap level (0 - GetNumOfMipmaps()) 00097 * 00098 * @return 00099 * Texture buffer size 00100 */ 00101 PLRENDERER_API PLCore::uint32 GetSize(PLCore::uint32 nMipmap = 0) const; 00102 00103 00104 //[-------------------------------------------------------] 00105 //[ Protected functions ] 00106 //[-------------------------------------------------------] 00107 protected: 00108 /** 00109 * @brief 00110 * Constructor 00111 * 00112 * @param[in] cRenderer 00113 * Owner renderer 00114 * @param[in] nFlags 00115 * Texture buffer flags (see EFlags) 00116 */ 00117 PLRENDERER_API TextureBufferCube(Renderer &cRenderer, PLCore::uint32 nFlags); 00118 00119 00120 //[-------------------------------------------------------] 00121 //[ Protected data ] 00122 //[-------------------------------------------------------] 00123 protected: 00124 PLCore::uint32 m_nSize; /**< Texture buffer size */ 00125 00126 00127 //[-------------------------------------------------------] 00128 //[ Private functions ] 00129 //[-------------------------------------------------------] 00130 private: 00131 /** 00132 * @brief 00133 * Copy constructor 00134 * 00135 * @param[in] cSource 00136 * Source to copy from 00137 */ 00138 TextureBufferCube(const TextureBufferCube &cSource); 00139 00140 /** 00141 * @brief 00142 * Copy operator 00143 * 00144 * @param[in] cSource 00145 * Source to copy from 00146 * 00147 * @return 00148 * Reference to this instance 00149 */ 00150 TextureBufferCube &operator =(const TextureBufferCube &cSource); 00151 00152 00153 //[-------------------------------------------------------] 00154 //[ Public virtual TextureBuffer functions ] 00155 //[-------------------------------------------------------] 00156 public: 00157 PLRENDERER_API virtual bool IsPowerOfTwo() const override; 00158 PLRENDERER_API virtual PLCore::uint32 GetNumOfPixels(PLCore::uint32 nMipmap = 0) const override; 00159 PLRENDERER_API virtual PLCore::uint32 GetNumOfBytes(PLCore::uint32 nMipmap = 0, EPixelFormat nFormat = Unknown) const override; 00160 00161 00162 }; 00163 00164 00165 //[-------------------------------------------------------] 00166 //[ Namespace ] 00167 //[-------------------------------------------------------] 00168 } // PLRenderer 00169 00170 00171 #endif // __PLRENDERER_TEXTUREBUFFERCUBE_H__
|