Software Development Kit - User Manual

class TerrainBuffer in Tinman.Engine.Components

The TerrainBuffer component is used as a shared buffer by zero or more TerrainMesh components.

sealed class TerrainBuffer extends Disposable
  implements IResourceHandle


TerrainBuffer objects act as resource handles and produce TerrainBufferResource resource objects.

See also:


Public / Attributes


The wrapped PyramidFileCache object.

public property Cache { get }
type PyramidFileCache
value [not-null] The cache.


Returns the flags that have been used to create this terrain buffer.

public property Flags { get }
type TerrainBufferFlags
value The terrain buffer flags.


Will this object be disposed upon the next call to Dispose?

public property IsSoleOwnership { get }
type bool
value true if the object will be disposed when Dispose is called,
false if the object will not be disposed, because some other code is still holding shared ownership (see AcquireBase).
inherited Disposable.IsSoleOwnership


Returns the lifecycle state of this object.

public property LifecycleState { get }
type LifecycleState
value The lifecycle state.
inherited Disposable.LifecycleState


The wrapped MeshBuffer object.

public property MeshBuffer { get }
type MeshBuffer
value [not-null] The mesh buffer.


The layout of the shared vertex buffer.

public property VertexLayout { get }
type VertexElements
value [not-null] The vertex buffer layout.


The layout always the following VertexElementUsage semantics, in the given order:

Public / Constructors


Creates a new instance of TerrainBuffer.

public constructor TerrainBuffer ([Owner] PyramidFileCache cache, TerrainBufferOptions options)
params cache The pyramid file cache or null.
  options The terrain buffer options.


The CacheOptions and CachePath properties are ignored by this method. Use CreateTerrainBuffer if you want these to be taken into account.

Public / Methods


Acquires a strong reference to this disposable object.

[OwnerReturn, Pure]
public method AcquireBase (bool allowNull = false)
type IDisposable
params allowNull Depicts what to do when this object is no longer valid:
true: return null
false: throw an exception
returns The strong reference to this disposable object or null iff allowNull is true and this object is no longer valid.
inherited Disposable.AcquireBase


The object will not be actually disposed by calls to IDisposable when there is at least one strong reference left. Code that calls this method is responsible for calling the IDisposable method accordingly.

This method is not intended to be used in performance-critical code. It should only be used to high-level resource management.

Using this method usually requires type casting. Subclasses may additionally implement IDisposableGeneric, in order to provide some syntactic sugar for that.



Clears the terrain buffer caches.

public method ClearCache ()


The texel pyramid cache (see Cache) is cleared with Clear and the cache of each TextureAtlas object is cleared with Clear.

See also:




Creates a new resource object, using the given graphics context.

public method CreateResource (Graphics graphics)
type IResource
params graphics [not-null] The graphics context to use.
returns [not-null] The resource object.
implements IResourceHandle.CreateResource


Resource objects may implement the IMemoryConsumption interface. In this case, the reported memory consumption will be interpreted as an estimate on how much GPU memory is consumed by the resource. This estimate can then be used for resource caching (e.g. CacheMemory).



Releases 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


The Dispose method silently returns if the object has already been disposed.

Implementing methods must not throw any exceptions.


Compares this object with the given one.

public method Equals (IResourceHandle other)
type bool
params other The object to compare to.
returns true if this object is equal to other, false if not.
implements IEquatable.Equals


public override method GetHashCode ()
type int32