An implementation of the IVertexUpdater interface that generates binary vertex data using an IVertexFormat and stores it in an IVertexBuffer.
sealed class
|
VertexBufferUpdater
|
extends
|
VertexUpdater
|
Returns the lifecycle state of this object.
public
virtual
property
|
LifecycleState
{
get
}
|
||
type
|
LifecycleState
|
||
value
|
The lifecycle state. | ||
inherited
|
Disposable.LifecycleState
|
The vertex buffer to update.
public
property
|
VertexBuffer
{
get
set
}
|
||
type
|
IVertexBuffer
|
||
value
|
The
vertex
buffer
or
null . |
The vertex format to use.
public
property
|
VertexFormat
{
get
set
}
|
||
type
|
IVertexFormat
|
||
value
|
The
vertex
format
or
null . |
Creates a new instance of VertexBufferUpdater.
public
constructor
|
VertexBufferUpdater
(IVertexFormat vertexFormat = null)
|
||
params
|
vertexFormat
|
The
initial
vertex
format
(see
VertexFormat).
Defaults
to
null .
|
Acquires a strong reference to this disposable object.
[OwnerReturn, ThreadSafe]
|
||||
public
method
|
AcquireTry
()
|
|||
type
|
IDisposable
|
|||
returns
|
this
if
a
new
strong
reference
has
been
acquired,
null
if
this
object
is
already
being
disposed.
|
|||
inherited
|
Disposable.AcquireTry
|
Remarks:
The object will not be actually disposed by calls to Dispose when there is at least one strong reference left. Code that calls the AcquireTry method is responsible for calling the Dispose method accordingly.
This method is not intended to be used in performance-critical code. It should only be used to high-level resource management.
Begins an access to this object.
public
override
method
|
Begin
()
|
||
implements
|
VertexUpdater.Begin
|
Remarks:
See the documentation of the class which implements this interface for details on the operations that must be wrapped in Begin and End calls.
See also:
BeginEndReleases all resources held by this object if there are no more strong references to it, decrements the reference counter by one otherwise.
[Dispose, OwnerThis, ThreadSafe]
|
||||
public
method
|
Dispose
()
|
|||
inherited
|
Disposable.Dispose
|
Remarks:
The Dispose method silently returns if the object has already been disposed.
Ends the current access to this object.
public
override
method
|
End
()
|
||
implements
|
VertexUpdater.End
|
Remarks:
See the documentation of the class which implements this interface for details on the operations that must be wrapped in Begin and End calls.
See also:
BeginEndCauses
the
next
call
to
Validate
to
return
false
.
public
method
|
Invalidate
()
|
Remarks:
Call this method if the vertex buffer needs to be refreshed.
Sets the vertex data containers from which this vertex converter shall read vertex data.
public
override
method
|
SetVertexArrays
(VertexArrays vertexArrays)
|
||
params
|
vertexArrays
|
[not-null]
|
The vertex data collection. |
overrides
|
VertexUpdater.SetVertexArrays
|
Validates this vertex updater.
public
override
method
|
Validate
()
|
||
type
|
bool
|
||
returns
|
true
if
the
vertex
updater
is
valid
and
can
consume
vertex
data
updates,
false
if
it
is
invalid
(vertex
updates
must
be
discarded).
|
||
overrides
|
VertexUpdater.Validate
|
Remarks:
When a vertex updater becomes invalid, a full vertex update will become necessary once the update is valid again.
Updates data for the given vertices.
[BeginEnd]
|
||||
public
override
method
|
VertexUpdate
(int32[] vertices,
int32 count)
|
|||
params
|
vertices
|
[not-null]
|
An array that holds the vertex indices. | |
count
|
[>0]
|
Total number of indices to read from vertices. | ||
implements
|
VertexUpdater.VertexUpdate
|
Remarks:
A typical implementation will read vertex data from the VertexArrays object, construct some application-specific vertex value and store that value in some kind of vertex buffer (e.g. for rendering).
Updates data for all vertices.
[BeginEnd]
|
||||
public
override
method
|
VertexUpdateAll
()
|
|||
overrides
|
VertexUpdater.VertexUpdateAll
|
Remarks:
A typical implementation will read vertex data from the VertexArrays object, construct some application-specific vertex value and store that value in some kind of vertex buffer (e.g. for rendering).