Go to the documentation of this file.00001
00002
00003 #ifndef _MEMORY_PIXEL_BUFFER_H_
00004 #define _MEMORY_PIXEL_BUFFER_H_
00005
00006 #include <EngineConfig.h>
00007 #include <core/Types.h>
00008 #include <render/PixelBuffer.h>
00009
00010 namespace render
00011 {
00012
00013 class ENGINE_PUBLIC_EXPORT MemoryPixelBuffer : public PixelBuffer
00014 {
00015 public:
00016
00017 MemoryPixelBuffer(u32 width, u32 height, u32 depth, resource::PixelFormat format, resource::BufferUsage usage);
00018
00019 virtual ~MemoryPixelBuffer();
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// _MEMORYPIXELBUFFER_H_