TINMAN 3D / REALTIME TERRAIN
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

Remarks

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

See also:

TerrainBufferOptions

Public / Attributes

Cache

The wrapped PyramidFileCache object.

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

Flags

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

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

IsSoleOwnership

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

[ThreadSafe]
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

LifecycleState

Returns the lifecycle state of this object.

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

MeshBuffer

The wrapped MeshBuffer object.

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

VertexLayout

The layout of the shared vertex buffer.

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

Remarks:

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

Public / Constructors

TerrainBuffer

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.

Remarks:

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

Public / Methods

AcquireBase

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

Remarks:

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.

Exceptions:

ClearCache

Clears the terrain buffer caches.

public method ClearCache ()

Remarks:

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

See also:

TerrainBufferOptions.CachePath

Exceptions:

CreateResource

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

[OwnerReturn]
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

Remarks:

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).

Exceptions:

Dispose

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

Remarks:

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

Implementing methods must not throw any exceptions.

Equals

Compares this object with the given one.

[Pure]
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

GetHashCode

[Pure]
public override method GetHashCode ()
type int32