PixelLightAPI  .
TextureBuffer2D.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: TextureBuffer2D.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_TEXTUREBUFFER2D_H__
00024 #define __PLRENDERER_TEXTUREBUFFER2D_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 #include <PLMath/Vector2i.h>
00032 #include "PLRenderer/Renderer/TextureBuffer.h"
00033 
00034 
00035 //[-------------------------------------------------------]
00036 //[ Namespace                                             ]
00037 //[-------------------------------------------------------]
00038 namespace PLRenderer {
00039 
00040 
00041 //[-------------------------------------------------------]
00042 //[ Classes                                               ]
00043 //[-------------------------------------------------------]
00044 /**
00045 *  @brief
00046 *    Abstract renderer 2D texture buffer resource
00047 */
00048 class TextureBuffer2D : public TextureBuffer {
00049 
00050 
00051     //[-------------------------------------------------------]
00052     //[ Public functions                                      ]
00053     //[-------------------------------------------------------]
00054     public:
00055         /**
00056         *  @brief
00057         *    Destructor
00058         */
00059         PLRENDERER_API virtual ~TextureBuffer2D();
00060 
00061         /**
00062         *  @brief
00063         *    Returns the texture buffer size
00064         *
00065         *  @param[in] nMipmap
00066         *    Mipmap level (0 - GetNumOfMipmaps())
00067         *
00068         *  @return
00069         *    Texture buffer size
00070         */
00071         PLRENDERER_API PLMath::Vector2i GetSize(PLCore::uint32 nMipmap = 0) const;
00072 
00073 
00074     //[-------------------------------------------------------]
00075     //[ Protected functions                                   ]
00076     //[-------------------------------------------------------]
00077     protected:
00078         /**
00079         *  @brief
00080         *    Constructor
00081         *
00082         *  @param[in] cRenderer
00083         *    Owner renderer
00084         *  @param[in] nFlags
00085         *    Texture buffer flags (see EFlags)
00086         */
00087         PLRENDERER_API TextureBuffer2D(Renderer &cRenderer, PLCore::uint32 nFlags);
00088 
00089 
00090     //[-------------------------------------------------------]
00091     //[ Protected data                                        ]
00092     //[-------------------------------------------------------]
00093     protected:
00094         PLMath::Vector2i m_vSize;   /**< Texture buffer size */
00095 
00096 
00097     //[-------------------------------------------------------]
00098     //[ Private functions                                     ]
00099     //[-------------------------------------------------------]
00100     private:
00101         /**
00102         *  @brief
00103         *    Copy constructor
00104         *
00105         *  @param[in] cSource
00106         *    Source to copy from
00107         */
00108         TextureBuffer2D(const TextureBuffer2D &cSource);
00109 
00110         /**
00111         *  @brief
00112         *    Copy operator
00113         *
00114         *  @param[in] cSource
00115         *    Source to copy from
00116         *
00117         *  @return
00118         *    Reference to this instance
00119         */
00120         TextureBuffer2D &operator =(const TextureBuffer2D &cSource);
00121 
00122 
00123     //[-------------------------------------------------------]
00124     //[ Public virtual TextureBuffer functions                ]
00125     //[-------------------------------------------------------]
00126     public:
00127         PLRENDERER_API virtual bool IsPowerOfTwo() const override;
00128         PLRENDERER_API virtual PLCore::uint32 GetNumOfPixels(PLCore::uint32 nMipmap = 0) const override;
00129         PLRENDERER_API virtual PLCore::uint32 GetNumOfBytes(PLCore::uint32 nMipmap = 0, EPixelFormat nFormat = Unknown) const override;
00130 
00131 
00132 };
00133 
00134 
00135 //[-------------------------------------------------------]
00136 //[ Namespace                                             ]
00137 //[-------------------------------------------------------]
00138 } // PLRenderer
00139 
00140 
00141 #endif // __PLRENDERER_TEXTUREBUFFER2D_H__


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:09:01
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported