"L. Spiro Engine"

F:/My Projects/LSEngine/Modules/LSGraphicsLib/Src/IndexBuffer/LSGIndexBufferBase.h

00001 
00019 #ifndef __LSG_INDEXBUFFERBASE_H__
00020 #define __LSG_INDEXBUFFERBASE_H__
00021 
00022 #include "../LSGGraphicsLib.h"
00023 #include "../VertexBuffer/LSGVertexBuffer.h"
00024 #include "Allocator/LSTLAllocator.h"
00025 #include "Vector/LSTLVectorPoD.h"
00026 
00027 namespace lsg {
00028 
00029 #ifdef _DEBUG
00030 #define LSG_IB_INTERFACE        virtual
00031 #else   // #ifdef _DEBUG
00032 #define LSG_IB_INTERFACE
00033 #endif  // #ifdef _DEBUG
00034 
00035         // == Enumerations.
00039         enum LSG_INDEX_BUFFER_USAGE_TYPES {
00040                 LSG_IBUT_SETONLY                                                                = (1 << 0),                                                             // Vertex data is never read or written to.
00041                 LSG_IBUT_STANDARD                                                               = (1 << 1),                                                             // Vertex data is not read or written to often by the CPU.
00042                 LSG_IBUT_DYNAMIC                                                                = (1 << 2),                                                             // Vertex data is updated frequently.
00043 
00044                 LSG_IBUT_MASK                                                                   = (LSG_IBUT_SETONLY | LSG_IBUT_STANDARD | LSG_IBUT_DYNAMIC),
00045                 LSG_IBUT_FORCE_DWORD                                                    = 0x7FFFFFFF
00046         };
00047 
00048 
00058         class CIndexBufferBase {
00059         public :
00060                 // == Various constructors.
00061                 LSE_CALLCTOR                                                                    CIndexBufferBase();
00062                 LSE_CALLCTOR                                                                    ~CIndexBufferBase();
00063 
00064 
00065         protected :
00066                 // == Members.
00070                 CVectorPoD<LSUINT8, LSUINT32>                                   m_vBuffer;
00071 
00075                 LSUINT32                                                                                m_ui32ElementSize;
00076 
00080                 LSUINT32                                                                                m_ui32Usage;
00081 
00085                 LSUINT32                                                                                m_ui32LockCount;
00086 
00090                 LSUINT32                                                                                m_ui32AddedPrimitives;
00091 
00095                 LSUINT32                                                                                m_ui32TotalIndices;
00096 
00100                 LSBOOL                                                                                  m_bFinalized;
00101 
00102 #ifdef _DEBUG
00103                 // == Functions.
00109                 LSG_IB_INTERFACE LSVOID LSE_CALL                                InitApi( CAllocator * _paAllocator ) = 0;
00110 
00118                 LSG_IB_INTERFACE LSBOOL LSE_CALL                                CreateApiIndexBuffer() = 0;
00119 
00124                 LSG_IB_INTERFACE LSVOID LSE_CALL                                ResetApi() = 0;
00125 
00132                 LSG_IB_INTERFACE LSVOID LSE_CALL                                RenderApi( const CVertexBuffer &_vbBuffer, LSUINT32 _ui32TotalPrimitives ) const = 0;
00133                 
00139                 LSG_IB_INTERFACE LSVOID LSE_CALL                                SetApiStripType( LSG_VERTEX_BUFFER_PRIMITIVES _vbpType ) = 0;
00140 
00141 #endif  // #ifdef _DEBUG
00142         };
00143 
00144 }       // namespace lsg
00145 
00146 #endif  // __LSG_INDEXBUFFERBASE_H__
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator