OmegaEngine API  1.0.3
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Static Public Member Functions | Static Package Functions | List of all members
OmegaEngine.Graphics.BufferHelper Class Reference

Helper methods for creating, reading from and writing to VertexBuffers and IndexBuffers. More...

Static Public Member Functions

static BoundingBox ComputeBoundingBox (VertexBuffer vb, int vertexCount)
 Generates a BoundingBox that completely contains all points within a VertexBuffer. More...
 
static BoundingBox ComputeBoundingBox (Mesh mesh)
 Generates a BoundingBox that completely contains all points within a Mesh. More...
 
static BoundingSphere ComputeBoundingSphere (VertexBuffer vb, int vertexCount)
 Generates a BoundingSphere that completely contains all points within a VertexBuffer. More...
 
static BoundingSphere ComputeBoundingSphere (Mesh mesh)
 Generates a BoundingSphere that completely contains all points within a Mesh. More...
 

Static Package Functions

static VertexBuffer CreateVertexBuffer< T > (Device device, T[] data, VertexFormat format)
 Creates a VertexBuffer and fills it with data. More...
 
static T[] ReadVertexBuffer< T > (VertexBuffer buffer)
 Copies the content of a VertexBuffer to an array of structs. More...
 
static T[] ReadVertexBuffer< T > (Mesh mesh)
 Copies the content of the VertexBuffer of a Mesh to an array of structs. More...
 
static void WriteVertexBuffer< T > (VertexBuffer buffer, T[] data)
 Fills a VertexBuffer with data. More...
 
static void WriteVertexBuffer< T > (Mesh mesh, T[] data)
 Fills the VertexBuffer of a Mesh with data. More...
 
static IndexBuffer CreateIndexBuffer (Device device, short[] data)
 Creates an IndexBuffer and fills it with data. More...
 
static IndexBuffer CreateIndexBuffer (Device device, int[] data)
 Creates an IndexBuffer and fills it with data. More...
 
static short[] Read16BitIndexBuffer (IndexBuffer buffer)
 Copies the content of an IndexBuffer to an array of 16-bit values. More...
 
static int[] Read32BitIndexBuffer (IndexBuffer buffer)
 Copies the content of an IndexBuffer to an array of 32-bit values. More...
 
static int[] ReadIndexBuffer (Mesh mesh)
 Copies the content of the IndexBuffer of a Mesh to an array of 32-bit values (16-bit values are automatically converted). More...
 
static void WriteIndexBuffer (IndexBuffer buffer, short[] data)
 Fills an IndexBuffer with 16-bit values. More...
 
static void WriteIndexBuffer (IndexBuffer buffer, int[] data)
 Fills an IndexBuffer with 32-bit values. More...
 
static void WriteIndexBuffer (Mesh mesh, short[] data)
 Fills the IndexBuffer of a Mesh with 16-bit values. More...
 
static void WriteIndexBuffer (Mesh mesh, int[] data)
 Fills the IndexBuffer of a Mesh with 32-bit values. More...
 

Detailed Description

Helper methods for creating, reading from and writing to VertexBuffers and IndexBuffers.

Member Function Documentation

static BoundingBox OmegaEngine.Graphics.BufferHelper.ComputeBoundingBox ( VertexBuffer  vb,
int  vertexCount 
)
inlinestatic

Generates a BoundingBox that completely contains all points within a VertexBuffer.

Parameters
vbThe VertexBuffer to be contained within the BoundingBox.
vertexCountThe total number of vertex contained within vb .
static BoundingBox OmegaEngine.Graphics.BufferHelper.ComputeBoundingBox ( Mesh  mesh)
inlinestatic

Generates a BoundingBox that completely contains all points within a Mesh.

Parameters
meshThe Mesh to be contained within the BoundingBox.
static BoundingSphere OmegaEngine.Graphics.BufferHelper.ComputeBoundingSphere ( VertexBuffer  vb,
int  vertexCount 
)
inlinestatic

Generates a BoundingSphere that completely contains all points within a VertexBuffer.

Parameters
vbThe VertexBuffer to be contained within the BoundingSphere.
vertexCountThe total number of vertex contained within vb .
static BoundingSphere OmegaEngine.Graphics.BufferHelper.ComputeBoundingSphere ( Mesh  mesh)
inlinestatic

Generates a BoundingSphere that completely contains all points within a Mesh.

Parameters
meshThe Mesh to be contained within the BoundingSphere.
static IndexBuffer OmegaEngine.Graphics.BufferHelper.CreateIndexBuffer ( Device  device,
short[]  data 
)
inlinestaticpackage

Creates an IndexBuffer and fills it with data.

Parameters
deviceThe device to create the buffer on.
dataThe values to fill the buffer with.
Returns
The newly created and filled IndexBuffer.
static IndexBuffer OmegaEngine.Graphics.BufferHelper.CreateIndexBuffer ( Device  device,
int[]  data 
)
inlinestaticpackage

Creates an IndexBuffer and fills it with data.

Parameters
deviceThe device to create the buffer on.
dataThe values to fill the buffer with.
Returns
The newly created and filled IndexBuffer.
static VertexBuffer OmegaEngine.Graphics.BufferHelper.CreateVertexBuffer< T > ( Device  device,
T[]  data,
VertexFormat  format 
)
inlinestaticpackage

Creates a VertexBuffer and fills it with data.

Template Parameters
TThe vertex format used in the buffer.
Parameters
deviceThe device to create the buffer on.
dataThe vertexes to fill the buffer with.
formatThe fixed-function vertex format.
Returns
The newly created and filled VertexBuffer.
Type Constraints
T :struct 
static short [] OmegaEngine.Graphics.BufferHelper.Read16BitIndexBuffer ( IndexBuffer  buffer)
inlinestaticpackage

Copies the content of an IndexBuffer to an array of 16-bit values.

Parameters
bufferThe buffer to read from.

Warning! No check is performed to ensure the buffer actually uses 16-bit values.

static int [] OmegaEngine.Graphics.BufferHelper.Read32BitIndexBuffer ( IndexBuffer  buffer)
inlinestaticpackage

Copies the content of an IndexBuffer to an array of 32-bit values.

Parameters
bufferThe buffer to read from.

Warning! No check is performed to ensure the buffer actually uses 32-bit values.

static int [] OmegaEngine.Graphics.BufferHelper.ReadIndexBuffer ( Mesh  mesh)
inlinestaticpackage

Copies the content of the IndexBuffer of a Mesh to an array of 32-bit values (16-bit values are automatically converted).

Parameters
meshThe Mesh containing the buffer to read from.
static T [] OmegaEngine.Graphics.BufferHelper.ReadVertexBuffer< T > ( VertexBuffer  buffer)
inlinestaticpackage

Copies the content of a VertexBuffer to an array of structs.

Template Parameters
TThe vertex format used in the buffer.
Parameters
bufferThe buffer to read from.
Returns
The content of the buffer .
Type Constraints
T :struct 
static T [] OmegaEngine.Graphics.BufferHelper.ReadVertexBuffer< T > ( Mesh  mesh)
inlinestaticpackage

Copies the content of the VertexBuffer of a Mesh to an array of structs.

Template Parameters
TThe vertex format used in the buffer.
Parameters
meshThe Mesh containing the buffer to read from.
Returns
The content of the buffer in mesh .
Type Constraints
T :struct 
static void OmegaEngine.Graphics.BufferHelper.WriteIndexBuffer ( IndexBuffer  buffer,
short[]  data 
)
inlinestaticpackage

Fills an IndexBuffer with 16-bit values.

Parameters
bufferThe buffer to write to.
dataThe values to fill the buffer with.

Warning! No check is performed to ensure the buffer actually uses 16-bit values.

static void OmegaEngine.Graphics.BufferHelper.WriteIndexBuffer ( IndexBuffer  buffer,
int[]  data 
)
inlinestaticpackage

Fills an IndexBuffer with 32-bit values.

Parameters
bufferThe buffer to write to.
dataThe values to fill the buffer with.

Warning! No check is performed to ensure the buffer actually uses 32-bit values.

static void OmegaEngine.Graphics.BufferHelper.WriteIndexBuffer ( Mesh  mesh,
short[]  data 
)
inlinestaticpackage

Fills the IndexBuffer of a Mesh with 16-bit values.

Parameters
meshThe Mesh containing the buffer to write to.
dataThe values to fill the buffer with.
static void OmegaEngine.Graphics.BufferHelper.WriteIndexBuffer ( Mesh  mesh,
int[]  data 
)
inlinestaticpackage

Fills the IndexBuffer of a Mesh with 32-bit values.

Parameters
meshThe Mesh containing the buffer to write to.
dataThe values to fill the buffer with.
static void OmegaEngine.Graphics.BufferHelper.WriteVertexBuffer< T > ( VertexBuffer  buffer,
T[]  data 
)
inlinestaticpackage

Fills a VertexBuffer with data.

Template Parameters
TThe vertex format used in the buffer.
Parameters
bufferThe buffer to write to.
dataThe vertexes to fill the buffer with.
Type Constraints
T :struct 
static void OmegaEngine.Graphics.BufferHelper.WriteVertexBuffer< T > ( Mesh  mesh,
T[]  data 
)
inlinestaticpackage

Fills the VertexBuffer of a Mesh with data.

Template Parameters
TThe vertex format used in the buffer.
Parameters
meshThe Mesh containing the buffer to write to.
dataThe vertexes to fill the buffer with.
Type Constraints
T :struct 

The documentation for this class was generated from the following file: