C# Class Axiom.Graphics.BufferStream

This class is intended to allow a clean stream interface for writing to hardware buffers. An instance of this would be returned by one of the HardwareBuffer.Lock methods, which would allow easily and safely writing to a hardware buffer without having to use unsafe code.
Datei anzeigen Open project: WolfgangSt/axiom

Protected Properties

Property Type Description
data System.IntPtr
owner Axiom.Graphics.HardwareBuffer
position long
tmp System.ValueType[]

Public Methods

Method Description
Read ( byte buffer, int offset, int count ) : int

Seek ( long offset ) : long

Moves the "cursor" position within the buffer.

Seek ( long offset, SeekOrigin origin ) : long

Moves the "cursor" position within the buffer.

Write ( System val ) : void
Write ( System val, int offset ) : void
Write ( System val, int offset, int count ) : void

Write ( Vector3 vec, int offset ) : void
Write ( Vector4 vec, int offset ) : void
Write ( byte val, int offset ) : void
Write ( float val, int offset ) : void
Write ( short val, int offset ) : void

Private Methods

Method Description
BufferStream ( Axiom.Graphics.HardwareBuffer owner, IntPtr data ) : System

Constructor.

Method Details

Read() public method

public Read ( byte buffer, int offset, int count ) : int
buffer byte
offset int
count int
return int

Seek() public method

Moves the "cursor" position within the buffer.
public Seek ( long offset ) : long
offset long Offset (in bytes) to move from the current position.
return long

Seek() public method

Moves the "cursor" position within the buffer.
public Seek ( long offset, SeekOrigin origin ) : long
offset long Number of bytes to move.
origin SeekOrigin How to treat the offset amount.
return long

Write() public method

public Write ( System val ) : void
val System
return void

Write() public method

public Write ( System val, int offset ) : void
val System
offset int
return void

Write() public method

public Write ( System val, int offset, int count ) : void
val System
offset int
count int
return void

Write() public method

public Write ( Vector3 vec, int offset ) : void
vec Vector3
offset int
return void

Write() public method

public Write ( Vector4 vec, int offset ) : void
vec Vector4
offset int
return void

Write() public method

public Write ( byte val, int offset ) : void
val byte
offset int
return void

Write() public method

public Write ( float val, int offset ) : void
val float
offset int
return void

Write() public method

public Write ( short val, int offset ) : void
val short
offset int
return void

Property Details

data protected_oe property

Pointer to the raw data we will be writing to.
protected IntPtr,System data
return System.IntPtr

owner protected_oe property

Reference to the hardware buffer who owns this stream.
protected HardwareBuffer,Axiom.Graphics owner
return Axiom.Graphics.HardwareBuffer

position protected_oe property

Current position (as a byte offset) into the stream.
protected long position
return long

tmp protected_oe property

Temp array.
protected ValueType[],System tmp
return System.ValueType[]