VisimBox 1.0 VisimBox 3d simulation and visualisation ToolBox

- Main Page
- Packages
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | Protected Attributes | Properties
VisimBox.Renderer.Texture Class Reference

Basic texture class. More...

Inheritance diagram for VisimBox.Renderer.Texture:

List of all members.

## Public Member Functions
virtual void | Dispose ()
virtual void | AddReference (IResourceConsumer consumer)
| Adds reference to this resource.
virtual void | RemoveReference (IResourceConsumer consumer)
| Removes reference to this resource.
virtual bool | ReplaceReferences (IResource newresource)
| Manager wants to replace this resource by another - resource should inform all of it's consumers that it's being replaced and update references based on their response It should also check if new resource is of compatible type.
abstract void | Activate (IRenderContext rc)
| Activates texture in specified render context.
abstract System.Drawing.Bitmap | GetBitmap ()
| Creates System.Drawin.Bitmap from actual version of the texture and returns it User must dispose it correctly by himself.
System.Xml.Schema.XmlSchema | GetSchema ()
| Reqired by IXMLserializable.
virtual void | ReadXml (System.Xml.XmlReader reader)
| Deserializes object from XML.
virtual void | WriteXml (System.Xml.XmlWriter writer)
| Serializes object to XML.
## Protected Member Functions
virtual void | DisposeConsumers ()
## Protected Attributes
string | _name
string | _filename
int | bytesSize
ResourceUsage | usage
int | _width
int | _originalwidth
TextureFormat | _format
List< IResourceConsumer > | Consumers = new List<IResourceConsumer>()
## Properties
string | Name`[get]`
| Internal name of the texture.
string | FileName`[get, set]`
| File name of the texture.
int | Width`[get]`
| Actual width of the texture (textures with incorrect sizes will be resized to width/height of power of two)
int | Height`[get]`
| Actual height of the texture (textures with incorrect sizes will be resized to width/height of power of two)
int | OriginalWidth`[get]`
| Original width of the texture (as was in the file / source data)
int | OriginalHeight`[get]`
| Original height of the texture (as was in the file / source data)
int | CenterX`[get, set]`
| Center of the texture in X.
int | CenterY`[get, set]`
| Center of the texture in Y.
virtual bool | Wrappable`[get, set]`
| Is texture wrappable?
virtual int | SizeInBytes`[get]`
| Size of the texture in bytes.
TextureFormat | Format`[get]`
| Texture format (RGB/RGBA)
virtual bool | HasAlpha`[get]`
| True if texture contains alpha value.
virtual bool | AlwaysStay`[get, set]`
| If true, resource will stay in memory even if it's not referenced.
ResourceType | ResourceType`[get]`
| Generic type of the resource.
ResourceUsage | Usage`[get]`
| Type of the resource usage (static/dynamic)
int | References`[get]`
| Number of current references.
int | NullReferences`[get]`
| Returns number of null generic references.
virtual int | InternalID`[get]`
| Returns internal ID for direct (and faster) access to renderer. Not all renderers may support this. If InternalID = -1, texture doesn't have internal id or is not valid.

## Detailed Description

Basic texture class.

## Member Function Documentation

abstract void VisimBox.Renderer.Texture.Activate | ( | IRenderContext | rc | ) | `[pure virtual]`

Activates texture in specified render context.

Parameters:

  rc |

Implemented in VisimRenderGL.GLTexture.

virtual void VisimBox.Renderer.Texture.AddReference | ( | IResourceConsumer | consumer | ) | `[virtual]`

Adds reference to this resource.

Parameters:

  consumer | Consumer of resource

Implements VisimBox.Resources.IResource.

virtual void VisimBox.Renderer.Texture.Dispose | ( |  | ) | `[virtual]`

Reimplemented in VisimRenderGL.GLTexture.

virtual void VisimBox.Renderer.Texture.DisposeConsumers | ( |  | ) | `[protected, virtual]`

abstract System.Drawing.Bitmap VisimBox.Renderer.Texture.GetBitmap | ( |  | ) | `[pure virtual]`

Creates System.Drawin.Bitmap from actual version of the texture and returns it User must dispose it correctly by himself.

Returns:
  Bitmap containg image in the current texture

Implemented in VisimRenderGL.GLTexture.

System.Xml.Schema.XmlSchema VisimBox.Renderer.Texture.GetSchema | ( |  | ) |

Reqired by IXMLserializable.

Returns:
  Null

virtual void VisimBox.Renderer.Texture.ReadXml | ( | System.Xml.XmlReader | reader | ) | `[virtual]`

Deserializes object from XML.

Parameters:

  reader | XML reader

virtual void VisimBox.Renderer.Texture.RemoveReference | ( | IResourceConsumer | consumer | ) | `[virtual]`

Removes reference to this resource.

Parameters:

  consumer | Consumer of resource

Implements VisimBox.Resources.IResource.

virtual bool VisimBox.Renderer.Texture.ReplaceReferences | ( | IResource | newresource | ) | `[virtual]`

Manager wants to replace this resource by another - resource should inform all of it's consumers that it's being replaced and update references based on their response It should also check if new resource is of compatible type.

Parameters:

  newresource | New resource

Returns:
  True if resource is compatible type and all consumers accepted resource changing, false otherwise

Implements VisimBox.Resources.IResource.

virtual void VisimBox.Renderer.Texture.WriteXml | ( | System.Xml.XmlWriter | writer | ) | `[virtual]`

Serializes object to XML.

Parameters:

  writer | XML writer to save values

## Member Data Documentation

string VisimBox.Renderer.Texture._filename`[protected]`

TextureFormat VisimBox.Renderer.Texture._format`[protected]`

string VisimBox.Renderer.Texture._name`[protected]`

int VisimBox.Renderer.Texture._originalwidth`[protected]`

int VisimBox.Renderer.Texture._width`[protected]`

int VisimBox.Renderer.Texture.bytesSize`[protected]`

List<IResourceConsumer> VisimBox.Renderer.Texture.Consumers = new List<IResourceConsumer>()`[protected]`

ResourceUsage VisimBox.Renderer.Texture.usage`[protected]`

## Property Documentation

virtual bool VisimBox.Renderer.Texture.AlwaysStay`[get, set]`

If true, resource will stay in memory even if it's not referenced.

Implements VisimBox.Resources.IResource.

int VisimBox.Renderer.Texture.CenterX`[get, set]`

Center of the texture in X.

int VisimBox.Renderer.Texture.CenterY`[get, set]`

Center of the texture in Y.

string VisimBox.Renderer.Texture.FileName`[get, set]`

File name of the texture.

Implements VisimBox.Resources.IResource.

TextureFormat VisimBox.Renderer.Texture.Format`[get]`

Texture format (RGB/RGBA)

virtual bool VisimBox.Renderer.Texture.HasAlpha`[get]`

True if texture contains alpha value.

int VisimBox.Renderer.Texture.Height`[get]`

Actual height of the texture (textures with incorrect sizes will be resized to width/height of power of two)

virtual int VisimBox.Renderer.Texture.InternalID`[get]`

Returns internal ID for direct (and faster) access to renderer. Not all renderers may support this. If InternalID = -1, texture doesn't have internal id or is not valid.

Reimplemented in VisimRenderGL.GLTexture.

string VisimBox.Renderer.Texture.Name`[get]`

Internal name of the texture.

int VisimBox.Renderer.Texture.NullReferences`[get]`

Returns number of null generic references.

Implements VisimBox.Resources.IResource.

int VisimBox.Renderer.Texture.OriginalHeight`[get]`

Original height of the texture (as was in the file / source data)

int VisimBox.Renderer.Texture.OriginalWidth`[get]`

Original width of the texture (as was in the file / source data)

int VisimBox.Renderer.Texture.References`[get]`

Number of current references.

Implements VisimBox.Resources.IResource.

ResourceType VisimBox.Renderer.Texture.ResourceType`[get]`

Generic type of the resource.

Implements VisimBox.Resources.IResource.

virtual int VisimBox.Renderer.Texture.SizeInBytes`[get]`

Size of the texture in bytes.

ResourceUsage VisimBox.Renderer.Texture.Usage`[get]`

Type of the resource usage (static/dynamic)

Implements VisimBox.Resources.IResource.

int VisimBox.Renderer.Texture.Width`[get]`

Actual width of the texture (textures with incorrect sizes will be resized to width/height of power of two)

virtual bool VisimBox.Renderer.Texture.Wrappable`[get, set]`

Is texture wrappable?

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

- Texture.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events