Go to the documentation of this file.00001
00002
00003 #ifndef _MEMORY_INDEX_BUFFER_H_
00004 #define _MEMORY_INDEX_BUFFER_H_
00005
00006 #include <EngineConfig.h>
00007 #include <core/Types.h>
00008 #include <render/IndexBuffer.h>
00009
00010 namespace render
00011 {
00012
00013 class ENGINE_PUBLIC_EXPORT MemoryIndexBuffer : public IndexBuffer
00014 {
00015 public:
00016
00017 MemoryIndexBuffer(IndexType idxType, u32 numIndexes, resource::BufferUsage usage);
00018
00019 virtual ~MemoryIndexBuffer();
00020
00021 void* lock(u32 offset, u32 length, resource::BufferLocking options);
00022
00023 void unlock();
00024
00025 void readData(u32 offset, u32 length, void* pDest);
00026
00027 void writeData(u32 offset, u32 length, const void* pSource, bool discardWholeBuffer = false);
00028
00029 protected:
00030
00031 u8* mpData;
00032
00033 void* lockImpl(u32 offset, u32 length, resource::BufferLocking options);
00034
00035 void unlockImpl();
00036 };
00037
00038 }
00039
00040 #endif// _MEMORYINDEXBUFFER_H_