Texture
Declaration
public abstract class Strawberry.Graphics.Texture
Represents a texture.
Inherits: Strawberry.DisposableReferenceObject
Properties
Width abstract
Gets the width of the texture.
int Width { get }
Height abstract
Gets the height of the texture.
int Height { get }
ActualWidth abstract
Gets the actual width of the texture (In Android (GLES2) the texture dimensions should be a power of 2 so the width and actual width may be different)
int ActualWidth { get }
ActualHeight abstract
int ActualHeight { get }
UVFactor abstract
Vector2 UVFactor { get }
GraphicsContext abstract
Gets the graphics context by which the resource is created
IGraphicsContext GraphicsContext { get }
TextureSettings abstract
Gets the settings of the texture
TextureSettings TextureSettings { get }
Methods
Activate abstract
Activates the texture to be used by the given shader
void Activate(Shader shader, string name)
Parameters:
| Name | Type | Description |
|---|---|---|
shader |
Strawberry.Graphics.Shader |
Shader by which the texture will be used |
name |
System.String |
The name of the parameter in the shader code |
SetFilter abstract
Sets the filtering of the texture
void SetFilter(TextureFiltering minFilter, TextureFiltering magFilter)
Parameters:
| Name | Type | Description |
|---|---|---|
minFilter |
Strawberry.Graphics.TextureFiltering |
Min filtering |
magFilter |
Strawberry.Graphics.TextureFiltering |
Mag filtering |
CopyToByteArray abstract
Copies the texture data to an array of bytes
byte[] CopyToByteArray()
Returns: Texture data
Update abstract
Updates the texture using the given data.
void Update(byte[] data)
Parameters:
| Name | Type | Description |
|---|---|---|
data |
System.Byte[] |
The rgba data to update the texture using with |