A texture loaded from one of DirectX's natively supported image formats (PNG, JPG, DDS, ...).
More...
|
| XTexture (Engine engine, Stream stream) |
| Loads a texture from an image file. More...
|
|
override void | Dispose (bool disposing) |
| To be called by IDisposable.Dispose and the object destructor. More...
|
|
A texture loaded from one of DirectX's natively supported image formats (PNG, JPG, DDS, ...).
◆ XTexture()
OmegaEngine.Assets.XTexture.XTexture |
( |
Engine |
engine, |
|
|
Stream |
stream |
|
) |
| |
|
inlineprotected |
Loads a texture from an image file.
- Parameters
-
engine | The Engine providing rendering capabilities. |
stream | The image file to load the texture from. |
- Exceptions
-
InvalidDataException | stream does not contain a texture file. |
This should only be called by Get to prevent unnecessary duplicates.
◆ Dispose()
override void OmegaEngine.Assets.XTexture.Dispose |
( |
bool |
disposing | ) |
|
|
inlineprotectedvirtual |
To be called by IDisposable.Dispose and the object destructor.
- Parameters
-
disposing | true if called manually and not by the garbage collector. |
Reimplemented from OmegaEngine.Assets.Asset.
◆ Get()
static XTexture OmegaEngine.Assets.XTexture.Get |
( |
Engine |
engine, |
|
|
string |
id, |
|
|
bool |
meshTexture = false |
|
) |
| |
|
inlinestatic |
Returns a cached XTexture or creates a new one if the requested ID is not cached.
- Parameters
-
engine | The Engine providing the cache and rendering capabilities. |
id | The ID of the asset to be returned. |
meshTexture | Shall the texture be loaded from the meshes directory instead of the textures directory? |
- Returns
- The requested asset;
null
if id was empty.
- Exceptions
-
FileNotFoundException | The specified file could not be found. |
IOException | There was an error reading the file. |
UnauthorizedAccessException | Read access to the file is not permitted. |
InvalidDataException | The file does not contain a valid texture. |
Remember to call CacheManager.Clean when done, otherwise this object will never be released.
◆ operator Texture()
static implicit OmegaEngine.Assets.XTexture.operator Texture |
( |
XTexture |
xTexture | ) |
|
|
inlinestatic |
Convert a XTexture into its contained SlimDX.Direct3D9.Texture.
◆ Texture
Texture OmegaEngine.Assets.XTexture.Texture |
|
get |
The SlimDX.Direct3D9.Texture inside this asset.
The documentation for this class was generated from the following file:
- OmegaEngine/Assets/XTexture.cs