the IDirect3DVertexBuffer9 has that methods
STDMETHOD(Lock)(THIS_ UINT OffsetToLock,UINT SizeToLock,void** ppbData,DWORD Flags) PURE
STDMETHOD(Unlock)(THIS) PURE
I don't know the internal implementation of these functions. I do expect next.
-
The 'Lock' method maps a VertexBuffer's video memory to ppbData. it gains much fater performance.
-
The 'Lock' method is allocs a system-mem and make ppbData to point it. And the 'UnLock' method is copy that memory to real video memory. this approach by placing a abstraction layer in hardware eliminates differences.
i guess that : in 'D3DPOOL_SYSTEMMEM' mode, it implemented by way 2. in 'D3DPOOL_DEFAULT' mode, it implemented by way 1.
/* Pool types */
typedef enum _D3DPOOL {
D3DPOOL_DEFAULT = 0,
D3DPOOL_MANAGED = 1,
D3DPOOL_SYSTEMMEM = 2,
D3DPOOL_SCRATCH = 3,
D3DPOOL_FORCE_DWORD = 0x7fffffff
} D3DPOOL;
but i don't know how implemented in every D3DPOOL mode. help me~~