C# Class Duality.Resources.Texture

Inheritance: Resource
Afficher le fichier Open project: BraveSirAndrew/duality Class Usage Examples

Méthodes publiques

Свойство Type Description
None ContentRef

Private Properties

Свойство Type Description
Init void
InitDefaultContent void

Méthodes publiques

Méthode Description
Bind ( ContentRef tex, int texUnit ) : void

Binds the given Texture to a texture unit in order to use it for rendering.

CreateFromPixmap ( ContentRef pixmap ) : ContentRef

Creates a new Texture Resource based on the specified Pixmap, saves it and returns a reference to it.

LoadData ( ContentRef basePixmap ) : void

Loads the specified Pixmaps pixel data.

LoadData ( ContentRef basePixmap, SizeMode sizeMode ) : void

Loads the specified Pixmaps pixel data.

LoadData ( IntPtr data, int width, int height ) : void
LookupAtlas ( int index ) : System.Drawing.Rect

Does a safe (null-checked, clamped) texture Duality.Resources.Pixmap.Atlas lookup.

LookupAtlas ( int index, System.Drawing.Rect &uv ) : void

Does a safe (null-checked, clamped) texture Duality.Resources.Pixmap.Atlas lookup.

ReloadData ( ) : void

Reloads this Textures pixel data. If the referred Duality.Resources.Pixmap has been modified, changes will now be visible.

ResetBinding ( int beginAtIndex ) : void

Resets all Texture bindings to texture units beginning at a certain index.

RetrievePixelData ( ) : Duality.Resources.Pixmap.Layer

Retrieves the pixel data that is currently stored in video memory.

Texture ( ) : System

Sets up a new, uninitialized Texture.

Texture ( ContentRef basePixmap, SizeMode sizeMode = SizeMode.Default, TextureMagFilter filterMag = TextureMagFilter.Linear, TextureMinFilter filterMin = TextureMinFilter.LinearMipmapLinear, TextureWrapMode wrapX = TextureWrapMode.ClampToEdge, TextureWrapMode wrapY = TextureWrapMode.ClampToEdge, PixelInternalFormat format = PixelInternalFormat.Rgba, PixelType pixelType = PixelType.UnsignedByte, bool keepPixmapDataResident = false ) : System

Creates a new Texture based on a Duality.Resources.Pixmap.

Texture ( int width, int height, SizeMode sizeMode = SizeMode.Default, TextureMagFilter filterMag = TextureMagFilter.Linear, TextureMinFilter filterMin = TextureMinFilter.LinearMipmapLinear, TextureWrapMode wrapX = TextureWrapMode.ClampToEdge, TextureWrapMode wrapY = TextureWrapMode.ClampToEdge, PixelInternalFormat format = PixelInternalFormat.Rgba, PixelType pixelType = PixelType.UnsignedByte ) : System

Creates a new empty Texture with the specified size.

Méthodes protégées

Méthode Description
AdjustSize ( float width, float height ) : void

Processes the specified size based on the Textures SizeMode.

OnCopyTo ( Resource r, Duality provider ) : void
OnDisposing ( bool manually ) : void
OnLoaded ( ) : void
SetupOpenGLRes ( ) : void

Sets up the Textures OpenGL resources, clearing previously uploaded pixel data.

Private Methods

Méthode Description
Init ( ) : void
InitDefaultContent ( ) : void

Method Details

AdjustSize() protected méthode

Processes the specified size based on the Textures SizeMode.
protected AdjustSize ( float width, float height ) : void
width float
height float
Résultat void

Bind() public static méthode

Binds the given Texture to a texture unit in order to use it for rendering.
public static Bind ( ContentRef tex, int texUnit ) : void
tex ContentRef The Texture to bind.
texUnit int The texture unit where the Texture will be bound to.
Résultat void

CreateFromPixmap() public static méthode

Creates a new Texture Resource based on the specified Pixmap, saves it and returns a reference to it.
public static CreateFromPixmap ( ContentRef pixmap ) : ContentRef
pixmap ContentRef
Résultat ContentRef

LoadData() public méthode

Loads the specified Pixmaps pixel data.
public LoadData ( ContentRef basePixmap ) : void
basePixmap ContentRef The that is used as pixel data source.
Résultat void

LoadData() public méthode

Loads the specified Pixmaps pixel data.
public LoadData ( ContentRef basePixmap, SizeMode sizeMode ) : void
basePixmap ContentRef The that is used as pixel data source.
sizeMode SizeMode Specifies behaviour in case the source data has non-power-of-two dimensions.
Résultat void

LoadData() public méthode

public LoadData ( IntPtr data, int width, int height ) : void
data System.IntPtr
width int
height int
Résultat void

LookupAtlas() public méthode

Does a safe (null-checked, clamped) texture Duality.Resources.Pixmap.Atlas lookup.
public LookupAtlas ( int index ) : System.Drawing.Rect
index int
Résultat System.Drawing.Rect

LookupAtlas() public méthode

Does a safe (null-checked, clamped) texture Duality.Resources.Pixmap.Atlas lookup.
public LookupAtlas ( int index, System.Drawing.Rect &uv ) : void
index int
uv System.Drawing.Rect
Résultat void

OnCopyTo() protected méthode

protected OnCopyTo ( Resource r, Duality provider ) : void
r Resource
provider Duality
Résultat void

OnDisposing() protected méthode

protected OnDisposing ( bool manually ) : void
manually bool
Résultat void

OnLoaded() protected méthode

protected OnLoaded ( ) : void
Résultat void

ReloadData() public méthode

Reloads this Textures pixel data. If the referred Duality.Resources.Pixmap has been modified, changes will now be visible.
public ReloadData ( ) : void
Résultat void

ResetBinding() public static méthode

Resets all Texture bindings to texture units beginning at a certain index.
public static ResetBinding ( int beginAtIndex ) : void
beginAtIndex int The first texture unit index from which on all bindings will be cleared.
Résultat void

RetrievePixelData() public méthode

Retrieves the pixel data that is currently stored in video memory.
public RetrievePixelData ( ) : Duality.Resources.Pixmap.Layer
Résultat Duality.Resources.Pixmap.Layer

SetupOpenGLRes() protected méthode

Sets up the Textures OpenGL resources, clearing previously uploaded pixel data.
protected SetupOpenGLRes ( ) : void
Résultat void

Texture() public méthode

Sets up a new, uninitialized Texture.
public Texture ( ) : System
Résultat System

Texture() public méthode

Creates a new Texture based on a Duality.Resources.Pixmap.
public Texture ( ContentRef basePixmap, SizeMode sizeMode = SizeMode.Default, TextureMagFilter filterMag = TextureMagFilter.Linear, TextureMinFilter filterMin = TextureMinFilter.LinearMipmapLinear, TextureWrapMode wrapX = TextureWrapMode.ClampToEdge, TextureWrapMode wrapY = TextureWrapMode.ClampToEdge, PixelInternalFormat format = PixelInternalFormat.Rgba, PixelType pixelType = PixelType.UnsignedByte, bool keepPixmapDataResident = false ) : System
basePixmap ContentRef The to use as source for pixel data.
sizeMode SizeMode Specifies behaviour in case the source data has non-power-of-two dimensions.
filterMag TextureMagFilter The OpenGL filter mode for drawing the Texture bigger than it is.
filterMin TextureMinFilter The OpenGL fitler mode for drawing the Texture smaller than it is.
wrapX TextureWrapMode The OpenGL wrap mode on the texel x axis.
wrapY TextureWrapMode The OpenGL wrap mode on the texel y axis.
format PixelInternalFormat The format in which OpenGL stores the pixel data.
pixelType PixelType
keepPixmapDataResident bool
Résultat System

Texture() public méthode

Creates a new empty Texture with the specified size.
public Texture ( int width, int height, SizeMode sizeMode = SizeMode.Default, TextureMagFilter filterMag = TextureMagFilter.Linear, TextureMinFilter filterMin = TextureMinFilter.LinearMipmapLinear, TextureWrapMode wrapX = TextureWrapMode.ClampToEdge, TextureWrapMode wrapY = TextureWrapMode.ClampToEdge, PixelInternalFormat format = PixelInternalFormat.Rgba, PixelType pixelType = PixelType.UnsignedByte ) : System
width int The Textures width.
height int The Textures height
sizeMode SizeMode Specifies behaviour in case the specified size has non-power-of-two dimensions.
filterMag TextureMagFilter The OpenGL filter mode for drawing the Texture bigger than it is.
filterMin TextureMinFilter The OpenGL fitler mode for drawing the Texture smaller than it is.
wrapX TextureWrapMode The OpenGL wrap mode on the texel x axis.
wrapY TextureWrapMode The OpenGL wrap mode on the texel y axis.
format PixelInternalFormat The format in which OpenGL stores the pixel data.
pixelType PixelType
Résultat System

Property Details

None public_oe static_oe property

Refers to a null reference Texture.
public static ContentRef None
Résultat ContentRef