C# Class Axiom.Core.TextureManager

Class for loading & managing textures.
Texture manager serves as an abstract singleton for all API specific texture managers. When a class inherits from this and is created, a instance of that class (i.e. GLTextureManager) is stored in the global singleton instance of the TextureManager. Note: This will not take place until the RenderSystem is initialized and at least one RenderWindow has been created.
Inheritance: ResourceManager
Afficher le fichier Open project: WolfgangSt/axiom Class Usage Examples

Protected Properties

Свойство Type Description
_defaultMipmapCount int

Méthodes publiques

Méthode Description
CreateManual ( string name, string group, TextureType type, int width, int height, int numMipmaps, PixelFormat format ) : Axiom.Core.Texture
CreateManual ( string name, string group, TextureType type, int width, int height, int numMipmaps, PixelFormat format, TextureUsage usage ) : Axiom.Core.Texture

Create a manual texture with a depth of 1 (not loaded from a file).

CreateManual ( string name, string group, TextureType type, int width, int height, int numMipmaps, PixelFormat format, TextureUsage usage, IManualResourceLoader loader ) : Axiom.Core.Texture

Create a manual texture with a depth of 1 (not loaded from a file).

CreateManual ( string name, string group, TextureType type, int width, int height, int numMipmaps, PixelFormat format, TextureUsage usage, IManualResourceLoader loader, bool hwGammaCorrection ) : Axiom.Core.Texture
CreateManual ( string name, string group, TextureType type, int width, int height, int numMipmaps, PixelFormat format, TextureUsage usage, IManualResourceLoader loader, bool hwGammaCorrection, int fsaa ) : Axiom.Core.Texture
CreateManual ( string name, string group, TextureType type, int width, int height, int numMipmaps, PixelFormat format, TextureUsage usage, IManualResourceLoader loader, bool hwGammaCorrection, int fsaa, string fsaaHint ) : Axiom.Core.Texture
CreateManual ( string name, string group, TextureType type, int width, int height, int depth, int numMipmaps, PixelFormat format, TextureUsage usage, IManualResourceLoader loader ) : Axiom.Core.Texture
CreateManual ( string name, string group, TextureType type, int width, int height, int depth, int numMipmaps, PixelFormat format, TextureUsage usage, IManualResourceLoader loader, bool hwGammaCorrection ) : Axiom.Core.Texture
CreateManual ( string name, string group, TextureType type, int width, int height, int depth, int numMipmaps, PixelFormat format, TextureUsage usage, IManualResourceLoader loader, bool hwGammaCorrection, int fsaa ) : Axiom.Core.Texture
CreateManual ( string name, string group, TextureType type, int width, int height, int depth, int numMipMaps, PixelFormat format, TextureUsage usage, IManualResourceLoader loader, bool hwGammaCorrection, int fsaa, string fsaaHint ) : Axiom.Core.Texture

Create a manual texture with specified width, height and depth (not loaded from a file).

GetNativeFormat ( TextureType ttype, PixelFormat format, TextureUsage usage ) : PixelFormat
IsEquivalentFormatSupported ( TextureType ttype, PixelFormat format, TextureUsage usage ) : bool
IsFormatSupported ( TextureType ttype, PixelFormat format, TextureUsage usage ) : bool
IsHardwareFilteringSupported ( TextureType ttype, PixelFormat format, int usage ) : bool

Returns whether this render system has hardware filtering supported for the texture format requested with the given usage options.

IsHardwareFilteringSupported ( TextureType ttype, PixelFormat format, int usage, bool preciseFormatOnly ) : bool

Returns whether this render system has hardware filtering supported for the texture format requested with the given usage options.

Load ( string name, string group ) : Axiom.Core.Texture

Loads a texture with the specified name.

Load ( string name, string group, TextureType type ) : Axiom.Core.Texture

Load ( string name, string group, TextureType type, int numMipMaps ) : Axiom.Core.Texture
Load ( string name, string group, TextureType type, int numMipMaps, float gamma, bool isAlpha ) : Axiom.Core.Texture

Load ( string name, string group, TextureType type, int numMipMaps, float gamma, bool isAlpha, PixelFormat desiredFormat ) : Axiom.Core.Texture

LoadImage ( string name, string group, Image image ) : Axiom.Core.Texture

Loads a pre-existing image into the texture.

LoadImage ( string name, string group, Image image, TextureType texType ) : Axiom.Core.Texture

Loads a pre-existing image into the texture.

LoadImage ( string name, string group, Image image, TextureType texType, int numMipMaps, float gamma, bool isAlpha, PixelFormat desiredFormat ) : Axiom.Core.Texture

Loads a pre-existing image into the texture.

SetPreferredBitDepths ( ushort integerBits, ushort floatBits, bool reloadTextures ) : void
SetPreferredFloatBitDepth ( ushort bits, bool reloadTextures ) : void
SetPreferredIntegerBitDepth ( ushort bits, bool reloadTextures ) : void
this ( string name ) : Axiom.Core.Texture

Returns an instance of Texture that has the supplied name.

Méthodes protégées

Méthode Description
TextureManager ( ) : System

Internal constructor. This class cannot be instantiated externally.

Protected internal because this singleton will actually hold the instance of a subclass created by a render system plugin.

dispose ( bool disposeManagedResources ) : void

Called when the engine is shutting down.

Method Details

CreateManual() public méthode

public CreateManual ( string name, string group, TextureType type, int width, int height, int numMipmaps, PixelFormat format ) : Axiom.Core.Texture
name string
group string
type TextureType
width int
height int
numMipmaps int
format PixelFormat
Résultat Axiom.Core.Texture

CreateManual() public méthode

Create a manual texture with a depth of 1 (not loaded from a file).
public CreateManual ( string name, string group, TextureType type, int width, int height, int numMipmaps, PixelFormat format, TextureUsage usage ) : Axiom.Core.Texture
name string The name to give the resulting texture
group string The name of the resource group to assign the texture to
type TextureType The type of texture to load/create, defaults to normal 2D textures
width int The dimensions of the texture
height int The dimensions of the texture
numMipmaps int /// The number of pre-filtered mipmaps to generate. If left to MIP_DEFAULT then /// the TextureManager's default number of mipmaps will be used (see setDefaultNumMipmaps()). /// If set to MIP_UNLIMITED mipmaps will be generated until the lowest possible /// level, 1x1x1. ///
format PixelFormat /// The internal format you wish to request; the manager reserves /// the right to create a different format if the one you select is /// not available in this context. ///
usage TextureUsage /// The kind of usage this texture is intended for. It /// is a combination of TU_STATIC, TU_DYNAMIC, TU_WRITE_ONLY, /// TU_AUTOMIPMAP and TU_RENDERTARGET (see TextureUsage enum). You are /// strongly advised to use HBU_STATIC_WRITE_ONLY wherever possible, if you need to /// update regularly, consider HBU_DYNAMIC_WRITE_ONLY. ///
Résultat Axiom.Core.Texture

CreateManual() public méthode

Create a manual texture with a depth of 1 (not loaded from a file).
public CreateManual ( string name, string group, TextureType type, int width, int height, int numMipmaps, PixelFormat format, TextureUsage usage, IManualResourceLoader loader ) : Axiom.Core.Texture
name string The name to give the resulting texture
group string The name of the resource group to assign the texture to
type TextureType The type of texture to load/create, defaults to normal 2D textures
width int The dimensions of the texture
height int The dimensions of the texture
numMipmaps int /// The number of pre-filtered mipmaps to generate. If left to MIP_DEFAULT then /// the TextureManager's default number of mipmaps will be used (see setDefaultNumMipmaps()). /// If set to MIP_UNLIMITED mipmaps will be generated until the lowest possible /// level, 1x1x1. ///
format PixelFormat /// The internal format you wish to request; the manager reserves /// the right to create a different format if the one you select is /// not available in this context. ///
usage TextureUsage /// The kind of usage this texture is intended for. It /// is a combination of TU_STATIC, TU_DYNAMIC, TU_WRITE_ONLY, /// TU_AUTOMIPMAP and TU_RENDERTARGET (see TextureUsage enum). You are /// strongly advised to use HBU_STATIC_WRITE_ONLY wherever possible, if you need to /// update regularly, consider HBU_DYNAMIC_WRITE_ONLY. ///
loader IManualResourceLoader /// If you intend the contents of the manual texture to be /// regularly updated, to the extent that you don't need to recover /// the contents if the texture content is lost somehow, you can leave /// this parameter as null. However, if you intend to populate the /// texture only once, then you should implement ManualResourceLoader /// and pass a pointer to it in this parameter; this means that if the /// manual texture ever needs to be reloaded, the ManualResourceLoader /// will be called to do it. ///
Résultat Axiom.Core.Texture

CreateManual() public méthode

public CreateManual ( string name, string group, TextureType type, int width, int height, int numMipmaps, PixelFormat format, TextureUsage usage, IManualResourceLoader loader, bool hwGammaCorrection ) : Axiom.Core.Texture
name string
group string
type TextureType
width int
height int
numMipmaps int
format PixelFormat
usage TextureUsage
loader IManualResourceLoader
hwGammaCorrection bool
Résultat Axiom.Core.Texture

CreateManual() public méthode

public CreateManual ( string name, string group, TextureType type, int width, int height, int numMipmaps, PixelFormat format, TextureUsage usage, IManualResourceLoader loader, bool hwGammaCorrection, int fsaa ) : Axiom.Core.Texture
name string
group string
type TextureType
width int
height int
numMipmaps int
format PixelFormat
usage TextureUsage
loader IManualResourceLoader
hwGammaCorrection bool
fsaa int
Résultat Axiom.Core.Texture

CreateManual() public méthode

public CreateManual ( string name, string group, TextureType type, int width, int height, int numMipmaps, PixelFormat format, TextureUsage usage, IManualResourceLoader loader, bool hwGammaCorrection, int fsaa, string fsaaHint ) : Axiom.Core.Texture
name string
group string
type TextureType
width int
height int
numMipmaps int
format PixelFormat
usage TextureUsage
loader IManualResourceLoader
hwGammaCorrection bool
fsaa int
fsaaHint string
Résultat Axiom.Core.Texture

CreateManual() public méthode

public CreateManual ( string name, string group, TextureType type, int width, int height, int depth, int numMipmaps, PixelFormat format, TextureUsage usage, IManualResourceLoader loader ) : Axiom.Core.Texture
name string
group string
type TextureType
width int
height int
depth int
numMipmaps int
format PixelFormat
usage TextureUsage
loader IManualResourceLoader
Résultat Axiom.Core.Texture

CreateManual() public méthode

public CreateManual ( string name, string group, TextureType type, int width, int height, int depth, int numMipmaps, PixelFormat format, TextureUsage usage, IManualResourceLoader loader, bool hwGammaCorrection ) : Axiom.Core.Texture
name string
group string
type TextureType
width int
height int
depth int
numMipmaps int
format PixelFormat
usage TextureUsage
loader IManualResourceLoader
hwGammaCorrection bool
Résultat Axiom.Core.Texture

CreateManual() public méthode

public CreateManual ( string name, string group, TextureType type, int width, int height, int depth, int numMipmaps, PixelFormat format, TextureUsage usage, IManualResourceLoader loader, bool hwGammaCorrection, int fsaa ) : Axiom.Core.Texture
name string
group string
type TextureType
width int
height int
depth int
numMipmaps int
format PixelFormat
usage TextureUsage
loader IManualResourceLoader
hwGammaCorrection bool
fsaa int
Résultat Axiom.Core.Texture

CreateManual() public méthode

Create a manual texture with specified width, height and depth (not loaded from a file).
public CreateManual ( string name, string group, TextureType type, int width, int height, int depth, int numMipMaps, PixelFormat format, TextureUsage usage, IManualResourceLoader loader, bool hwGammaCorrection, int fsaa, string fsaaHint ) : Axiom.Core.Texture
name string The name to give the resulting texture
group string The name of the resource group to assign the texture to
type TextureType The type of texture to load/create, defaults to normal 2D textures
width int The dimensions of the texture
height int The dimensions of the texture
depth int The dimensions of the texture
numMipMaps int /// The number of pre-filtered mipmaps to generate. If left to MIP_DEFAULT then /// the TextureManager's default number of mipmaps will be used (see setDefaultNumMipmaps()). /// If set to MIP_UNLIMITED mipmaps will be generated until the lowest possible /// level, 1x1x1. ///
format PixelFormat /// The internal format you wish to request; the manager reserves /// the right to create a different format if the one you select is /// not available in this context. ///
usage TextureUsage /// The kind of usage this texture is intended for. It /// is a combination of TU_STATIC, TU_DYNAMIC, TU_WRITE_ONLY, /// TU_AUTOMIPMAP and TU_RENDERTARGET (see TextureUsage enum). You are /// strongly advised to use HBU_STATIC_WRITE_ONLY wherever possible, if you need to /// update regularly, consider HBU_DYNAMIC_WRITE_ONLY. ///
loader IManualResourceLoader /// If you intend the contents of the manual texture to be /// regularly updated, to the extent that you don't need to recover /// the contents if the texture content is lost somehow, you can leave /// this parameter as null. However, if you intend to populate the /// texture only once, then you should implement ManualResourceLoader /// and pass a pointer to it in this parameter; this means that if the /// manual texture ever needs to be reloaded, the ManualResourceLoader /// will be called to do it. ///
hwGammaCorrection bool
fsaa int
fsaaHint string
Résultat Axiom.Core.Texture

GetNativeFormat() public méthode

public GetNativeFormat ( TextureType ttype, PixelFormat format, TextureUsage usage ) : PixelFormat
ttype TextureType
format PixelFormat
usage TextureUsage
Résultat PixelFormat

IsEquivalentFormatSupported() public méthode

public IsEquivalentFormatSupported ( TextureType ttype, PixelFormat format, TextureUsage usage ) : bool
ttype TextureType
format PixelFormat
usage TextureUsage
Résultat bool

IsFormatSupported() public méthode

public IsFormatSupported ( TextureType ttype, PixelFormat format, TextureUsage usage ) : bool
ttype TextureType
format PixelFormat
usage TextureUsage
Résultat bool

IsHardwareFilteringSupported() public méthode

Returns whether this render system has hardware filtering supported for the texture format requested with the given usage options.
public IsHardwareFilteringSupported ( TextureType ttype, PixelFormat format, int usage ) : bool
ttype TextureType The texture type requested
format PixelFormat The pixel format requested
usage int the kind of usage this texture is intended for, a combination of the TextureUsage flags.
Résultat bool

IsHardwareFilteringSupported() public méthode

Returns whether this render system has hardware filtering supported for the texture format requested with the given usage options.
public IsHardwareFilteringSupported ( TextureType ttype, PixelFormat format, int usage, bool preciseFormatOnly ) : bool
ttype TextureType The texture type requested
format PixelFormat The pixel format requested
usage int the kind of usage this texture is intended for, a combination of the TextureUsage flags.
preciseFormatOnly bool /// Whether precise or fallback format mode is used to detecting. /// In case the pixel format doesn't supported by device, false will be returned /// if in precise mode, and natively used pixel format will be actually use to /// check if in fallback mode. ///
Résultat bool

Load() public méthode

Loads a texture with the specified name.
public Load ( string name, string group ) : Axiom.Core.Texture
name string
group string
Résultat Axiom.Core.Texture

Load() public méthode

public Load ( string name, string group, TextureType type ) : Axiom.Core.Texture
name string
group string
type TextureType
Résultat Axiom.Core.Texture

Load() public méthode

public Load ( string name, string group, TextureType type, int numMipMaps ) : Axiom.Core.Texture
name string
group string
type TextureType
numMipMaps int
Résultat Axiom.Core.Texture

Load() public méthode

public Load ( string name, string group, TextureType type, int numMipMaps, float gamma, bool isAlpha ) : Axiom.Core.Texture
name string
group string
type TextureType
numMipMaps int
gamma float
isAlpha bool
Résultat Axiom.Core.Texture

Load() public méthode

public Load ( string name, string group, TextureType type, int numMipMaps, float gamma, bool isAlpha, PixelFormat desiredFormat ) : Axiom.Core.Texture
name string
group string
type TextureType
numMipMaps int
gamma float
isAlpha bool
desiredFormat PixelFormat
Résultat Axiom.Core.Texture

LoadImage() public méthode

Loads a pre-existing image into the texture.
public LoadImage ( string name, string group, Image image ) : Axiom.Core.Texture
name string
group string
image Image
Résultat Axiom.Core.Texture

LoadImage() public méthode

Loads a pre-existing image into the texture.
public LoadImage ( string name, string group, Image image, TextureType texType ) : Axiom.Core.Texture
name string
group string
image Image
texType TextureType
Résultat Axiom.Core.Texture

LoadImage() public méthode

Loads a pre-existing image into the texture.
public LoadImage ( string name, string group, Image image, TextureType texType, int numMipMaps, float gamma, bool isAlpha, PixelFormat desiredFormat ) : Axiom.Core.Texture
name string
group string
image Image
texType TextureType
numMipMaps int
gamma float
isAlpha bool
desiredFormat PixelFormat
Résultat Axiom.Core.Texture

SetPreferredBitDepths() public méthode

public SetPreferredBitDepths ( ushort integerBits, ushort floatBits, bool reloadTextures ) : void
integerBits ushort
floatBits ushort
reloadTextures bool
Résultat void

SetPreferredFloatBitDepth() public méthode

public SetPreferredFloatBitDepth ( ushort bits, bool reloadTextures ) : void
bits ushort
reloadTextures bool
Résultat void

SetPreferredIntegerBitDepth() public méthode

public SetPreferredIntegerBitDepth ( ushort bits, bool reloadTextures ) : void
bits ushort
reloadTextures bool
Résultat void

TextureManager() protected méthode

Internal constructor. This class cannot be instantiated externally.
Protected internal because this singleton will actually hold the instance of a subclass created by a render system plugin.
protected TextureManager ( ) : System
Résultat System

dispose() protected méthode

Called when the engine is shutting down.
protected dispose ( bool disposeManagedResources ) : void
disposeManagedResources bool
Résultat void

this() public méthode

Returns an instance of Texture that has the supplied name.
public this ( string name ) : Axiom.Core.Texture
name string
Résultat Axiom.Core.Texture

Property Details

_defaultMipmapCount protected_oe property

Default number of mipmaps to be used for loaded textures.
protected int _defaultMipmapCount
Résultat int