- added lock/unlock methods to the buffer implementations.
These are not interchangeable with Map/Unmap! Map/Unmap is for mapping a buffer for updating on old hardware, Lock/Unlock are for manually copying some initialization data directly into a static buffer.
This commit is contained in:
parent
5a4e5a8038
commit
5201501534
3 changed files with 61 additions and 2 deletions
|
|
@ -43,6 +43,8 @@ public:
|
|||
virtual ~IVertexBuffer() {}
|
||||
virtual void SetData(size_t size, void *data, bool staticdata = true) = 0;
|
||||
virtual void SetFormat(int numBindingPoints, int numAttributes, size_t stride, const FVertexBufferAttribute *attrs) = 0;
|
||||
virtual void *Lock(unsigned int size) = 0;
|
||||
virtual void Unlock() = 0;
|
||||
virtual void Map() {} // Only needed by old OpenGL but this needs to be in the interface.
|
||||
virtual void Unmap() {}
|
||||
void *Memory() { assert(map); return map; }
|
||||
|
|
@ -59,5 +61,7 @@ protected:
|
|||
public:
|
||||
virtual ~IIndexBuffer() {}
|
||||
virtual void SetData(size_t size, void *data, bool staticdata = true) = 0;
|
||||
virtual void *Lock(unsigned int size) = 0;
|
||||
virtual void Unlock() = 0;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue