Welcome to
www.tdxlibrary.org
Home of the
the TDx_Library...
"RAD DirectX"
for
C++ Builder
...
|
TDx_3DI_Library v2.00 Component Reference
|
|
[ TDx_3DVertexBuffer::Lock() ]
[ next: Optimize() ]
[ prev: GetVertexBufferDesc() ]
public:
virtual bool __fastcall Lock( dword pFlags, void** pData, dword* pSize );
TDX_3DVERTEXBUFFER::LOCK()
[ component method ]
- Description
The
TDx_3DVertexBuffer::Lock()
method
retrieves
a
pointer
to
the
now
locked
vertex
buffer's
memory.
While
locked,
the
vertex
buffer
can
be
accessed
and
modified
as
required.
Attempting
to
render
a
locked
vertex
buffer
will
merely
return
D3DERR_VERTEXBUFFERLOCKED
errors
until
TDx_3DVertexBuffer::Unlock()
is
called.
Locking
often
causes
the
system
to
hold
Win16Mutex
(also
called
Win16Lock),
meaning
GUI
debuggers
cannot
operate
during
the
lock
period.
If
the
method
call
fails,
the
OnError
event
will
be
triggered
with
one
of
the
following
values:
D3DERR_VERTEXBUFFEROPTIMIZED
DDERR_INVALIDPARAMS
DDERR_OUTOFMEMORY
DDERR_SURFACEBUSY
DDERR_SURFACELOST
- Parameters
Flags
The Flags parameter indicates the type of lock required.
The described effect applies when the flag is set.
DDLOCK_DISCARDCONTENTS
Allow Direct3D or the device driver to designate alternative memory areas for the vertex buffer if neccessary.
Mainly useful when clearing and rewriting the vertex buffer.
DDLOCK_NOOVERWRITE
No vertices referred to in vertex buffer drawing calls since the start of the last frame or last lock without this flag will be changed during this lock.
Mainly useful when appending to the vertex buffer.
DDLOCK_NOSYSLOCK
Avoid using Win16Mutex (Win16Lock) if possible.
DDLOCK_READONLY
Vertex buffer data will only be read during this lock.
DDLOCK_SURFACEMEMORYPTR
A valid vertex buffer memory pointer is retrieved.
This is the default setting.
DDLOCK_WAIT
Retry locking until a lock is obtained or an error other than DDERR_SURFACEBUSY occurs.
DDLOCK_WRITEONLY
Vertex buffer data will only be written during this lock.
Data
The Data parameter will reference a vertex buffer memory pointer if the method returns successfully.
Size
The Size parameter will reference the memory size of the vertex buffer if the method returns successfully.
Set this parameter to NULL if the buffer size is not needed.
- See Also
- Top
If you would like to submit additions or improvements to this page, click: darren_john_dwyer@hotmail.com.
|
|