C# Class Axiom.RenderSystems.Xna.XnaHardwarePixelBuffer

Xna implementation of HardwarePixelBuffer
Inheritance: Axiom.Graphics.HardwarePixelBuffer
Show file Open project: WolfgangSt/axiom Class Usage Examples

Protected Properties

Property Type Description
HWMipmaps bool
device Microsoft.Xna.Framework.Graphics.GraphicsDevice
doMipmapGen bool
fsaaSurface Microsoft.Xna.Framework.Graphics.RenderTarget2D
mipLevel ushort
mipTex Microsoft.Xna.Framework.Graphics.Texture
sliceTRT List
surface Microsoft.Xna.Framework.Graphics.Texture2D
tempSurface Microsoft.Xna.Framework.Graphics.Texture2D
tempVolume Microsoft.Xna.Framework.Graphics.Texture3D
volume Microsoft.Xna.Framework.Graphics.Texture3D

Public Methods

Method Description
Bind ( Microsoft.Xna.Framework.Graphics device, Microsoft.Xna.Framework.Graphics surface, bool update ) : void
Bind ( Microsoft.Xna.Framework.Graphics device, Microsoft.Xna.Framework.Graphics surface, ushort miplevel, bool update ) : void

Call this to associate a Xna Texture2D with this pixel buffer

BlitFromMemory ( PixelBox src, BasicBox dstBox ) : void

Copies a region from normal memory to a region of this pixelbuffer. The source image can be in any pixel format supported by Axiom, and in any size.

The source and destination regions dimensions don't have to match, in which case scaling is done. This scaling is generally done using a bilinear filter in hardware, but it is faster to pass the source image in the right dimensions. Only call this function when both buffers are unlocked.

BlitToMemory ( BasicBox srcBox, PixelBox dst ) : void

Copies a region of this pixelbuffer to normal memory.

The source and destination regions don't have to match, in which case scaling is done. Only call this function when the buffer is unlocked.

GenMipmaps ( ) : void

Internal function to update mipmaps on update of level 0

GetRenderTarget ( int slice ) : RenderTexture
XnaHardwarePixelBuffer ( BufferUsage usage ) : System
XnaHardwarePixelBuffer ( int width, int height, int depth, PixelFormat format, BufferUsage usage, bool useSystemMemory, bool useShadowBuffer ) : System

Protected Methods

Method Description
CreateRenderTextures ( bool update ) : void

Create (or update) render textures for slices

DestroyRenderTextures ( ) : void

Destroy render textures for slices

LockImpl ( BasicBox lockBox, BufferLocking options ) : PixelBox

Internal implementation of HardwareBuffer.Lock.

UnlockImpl ( ) : void

Internal implementation of HardwareBuffer.Unlock.

Private Methods

Method Description
SetMipmapping ( bool doMipmapGen, bool MipmapsHardwareGenerated, Microsoft texture ) : void

Method Details

Bind() public method

public Bind ( Microsoft.Xna.Framework.Graphics device, Microsoft.Xna.Framework.Graphics surface, bool update ) : void
device Microsoft.Xna.Framework.Graphics
surface Microsoft.Xna.Framework.Graphics
update bool
return void

Bind() public method

Call this to associate a Xna Texture2D with this pixel buffer
public Bind ( Microsoft.Xna.Framework.Graphics device, Microsoft.Xna.Framework.Graphics surface, ushort miplevel, bool update ) : void
device Microsoft.Xna.Framework.Graphics
surface Microsoft.Xna.Framework.Graphics
miplevel ushort
update bool
return void

BlitFromMemory() public method

Copies a region from normal memory to a region of this pixelbuffer. The source image can be in any pixel format supported by Axiom, and in any size.
The source and destination regions dimensions don't have to match, in which case scaling is done. This scaling is generally done using a bilinear filter in hardware, but it is faster to pass the source image in the right dimensions. Only call this function when both buffers are unlocked.
public BlitFromMemory ( PixelBox src, BasicBox dstBox ) : void
src Axiom.Media.PixelBox PixelBox containing the source pixels and format in memory
dstBox Axiom.Media.BasicBox Image.BasicBox describing the destination region in this buffer
return void

BlitToMemory() public method

Copies a region of this pixelbuffer to normal memory.
The source and destination regions don't have to match, in which case scaling is done. Only call this function when the buffer is unlocked.
public BlitToMemory ( BasicBox srcBox, PixelBox dst ) : void
srcBox Axiom.Media.BasicBox BasicBox describing the source region of this buffer
dst Axiom.Media.PixelBox PixelBox describing the destination pixels and format in memory
return void

CreateRenderTextures() protected method

Create (or update) render textures for slices
protected CreateRenderTextures ( bool update ) : void
update bool are we updating an existing texture
return void

DestroyRenderTextures() protected method

Destroy render textures for slices
protected DestroyRenderTextures ( ) : void
return void

GenMipmaps() public method

Internal function to update mipmaps on update of level 0
public GenMipmaps ( ) : void
return void

GetRenderTarget() public method

public GetRenderTarget ( int slice ) : RenderTexture
slice int
return Axiom.Graphics.RenderTexture

LockImpl() protected method

Internal implementation of HardwareBuffer.Lock.
protected LockImpl ( BasicBox lockBox, BufferLocking options ) : PixelBox
lockBox Axiom.Media.BasicBox
options BufferLocking
return Axiom.Media.PixelBox

UnlockImpl() protected method

Internal implementation of HardwareBuffer.Unlock.
protected UnlockImpl ( ) : void
return void

XnaHardwarePixelBuffer() public method

public XnaHardwarePixelBuffer ( BufferUsage usage ) : System
usage BufferUsage
return System

XnaHardwarePixelBuffer() public method

public XnaHardwarePixelBuffer ( int width, int height, int depth, PixelFormat format, BufferUsage usage, bool useSystemMemory, bool useShadowBuffer ) : System
width int
height int
depth int
format PixelFormat
usage BufferUsage
useSystemMemory bool
useShadowBuffer bool
return System

Property Details

HWMipmaps protected property

Hardware Mipmaps?
protected bool HWMipmaps
return bool

device protected property

Xna Device
protected GraphicsDevice,Microsoft.Xna.Framework.Graphics device
return Microsoft.Xna.Framework.Graphics.GraphicsDevice

doMipmapGen protected property

Doing Mipmapping?
protected bool doMipmapGen
return bool

fsaaSurface protected property

FSAA Surface abstracted by this buffer
protected RenderTarget2D,Microsoft.Xna.Framework.Graphics fsaaSurface
return Microsoft.Xna.Framework.Graphics.RenderTarget2D

mipLevel protected property

Surface abstracted by this buffer
protected ushort mipLevel
return ushort

mipTex protected property

The Mipmap texture?
protected Texture,Microsoft.Xna.Framework.Graphics mipTex
return Microsoft.Xna.Framework.Graphics.Texture

sliceTRT protected property

Render targets
protected List sliceTRT
return List

surface protected property

protected Texture2D,Microsoft.Xna.Framework.Graphics surface
return Microsoft.Xna.Framework.Graphics.Texture2D

tempSurface protected property

Temporary surface in main memory if direct locking of mSurface is not possible
protected Texture2D,Microsoft.Xna.Framework.Graphics tempSurface
return Microsoft.Xna.Framework.Graphics.Texture2D

tempVolume protected property

Temporary volume in main memory if direct locking of mVolume is not possible
protected Texture3D,Microsoft.Xna.Framework.Graphics tempVolume
return Microsoft.Xna.Framework.Graphics.Texture3D

volume protected property

Volume abstracted by this buffer
protected Texture3D,Microsoft.Xna.Framework.Graphics volume
return Microsoft.Xna.Framework.Graphics.Texture3D