CryEngine.Resources.Texture

Wrapper for CryEngine ITexture. Holds, creates and updates an ITexture instance. More...

Public Member Functions

Texture (int width, int height, byte[] data, bool isRendertarget=false, bool clamp=false, string name="MF")
Creates a texture with image data and sets some default properties. More...
void UpdateData (int width, int height, byte[] data)
Pushes new image data into video memory for the allocated texture object. May reinstantiate the texture object, e.g. if size changed. More...
void SetClamped (bool isClamped)
Enable clamping the Texture at the edges instead of wrapping. More...
void Clear ()
Clears the texture and sets all pixels to the default clear color. More...
void Clear (Color clearColor)
Clears the texture and sets all pixels to the clearColor More...
void Destroy ()
Destroy this texture instance. More...
override bool Equals (object obj)
bool Equals (Texture wrapper)
override int GetHashCode ()

Static Public Member Functions

static Texture GetByName (string name)
Get a texture by name. More...
static Texture GetById (int Id)
Get a texture by ID. More...
static void CopyTextureRegion (Texture sourceTexture, Region sourceRegion, Texture destinationTexture, Region destinationRegion, Color color)
Copy part of sourceTexture to destinationTexture , overwriting all pixels in the region. The regions to copy from and to are specified with sourceRegion and destinationRegion . To copy and blend transparency use BlendTextureRegion instead. More...
static void BlendTextureRegion (Texture sourceTexture, Region sourceRegion, Texture destinationTexture, Region destinationRegion, Color color)
Copy part of sourceTexture to destinationTexture and blend the transparency while copying. The regions to copy from and to are specified with sourceRegion and destinationRegion . To copy without blending transparency use CopyTextureRegion instead. More...
static bool operator== (Texture wrapperA, Texture wrapperB)
static bool operator!= (Texture wrapperA, Texture wrapperB)

Static Protected Member Functions

static bool IsNull (Texture wrapper)

Properties

int Width [get]
Texture Width. More...
int Height [get]
Texture Height. More...
string Name [get]
Describing name for the texture. Automatically set to the filename if loaded from file. More...
int ID [get]
ID retrieved from CryEngine on texture creation. More...

Detailed Description

Wrapper for CryEngine ITexture. Holds, creates and updates an ITexture instance.

Constructor & Destructor Documentation

◆ Texture()

CryEngine.Resources.Texture.Texture ( int width,
int height,
byte [] data,
bool isRendertarget = false,
bool clamp = false,
string name = "MF"
)
inline

Creates a texture with image data and sets some default properties.

Parameters
widthIntended Texture Width.
heightIntended Texture Height.
dataImage source data.
isRendertargetIf set to true Texture can be rendered to.
clampIf set to true the Texture will be clamped at the edges.
nameThe name the texture will receive internally. If the name is not unique a number will be appended to it.

Member Function Documentation

◆ BlendTextureRegion()

static void CryEngine.Resources.Texture.BlendTextureRegion ( Texture sourceTexture,
Region sourceRegion,
Texture destinationTexture,
Region destinationRegion,
Color color
)
inline
static

Copy part of sourceTexture to destinationTexture and blend the transparency while copying. The regions to copy from and to are specified with sourceRegion and destinationRegion . To copy without blending transparency use CopyTextureRegion instead.

Parameters
sourceTextureSource texture.
sourceRegionSource region.
destinationTextureDestination texture.
destinationRegionDestination region.
colorTint color.

◆ Clear() [1/2]

void CryEngine.Resources.Texture.Clear ( )
inline

Clears the texture and sets all pixels to the default clear color.

◆ Clear() [2/2]

void CryEngine.Resources.Texture.Clear ( Color clearColor)
inline

Clears the texture and sets all pixels to the clearColor

Parameters
clearColorThe color the texture will be set to.

◆ CopyTextureRegion()

static void CryEngine.Resources.Texture.CopyTextureRegion ( Texture sourceTexture,
Region sourceRegion,
Texture destinationTexture,
Region destinationRegion,
Color color
)
inline
static

Copy part of sourceTexture to destinationTexture , overwriting all pixels in the region. The regions to copy from and to are specified with sourceRegion and destinationRegion . To copy and blend transparency use BlendTextureRegion instead.

Parameters
sourceTextureSource texture.
sourceRegionSource region.
destinationTextureDestination texture.
destinationRegionDestination region.
colorTint color.

◆ Destroy()

void CryEngine.Resources.Texture.Destroy ( )
inline

Destroy this texture instance.

◆ Equals() [1/2]

override bool CryEngine.Resources.Texture.Equals ( object obj)
inline

◆ Equals() [2/2]

bool CryEngine.Resources.Texture.Equals ( Texture wrapper)
inline

◆ GetById()

static Texture CryEngine.Resources.Texture.GetById ( int Id)
inline
static

Get a texture by ID.

Returns
The by identifier.
Parameters
IdIdentifier.

◆ GetByName()

static Texture CryEngine.Resources.Texture.GetByName ( string name)
inline
static

Get a texture by name.

Returns
The by name.
Parameters
nameName.

◆ GetHashCode()

override int CryEngine.Resources.Texture.GetHashCode ( )
inline

◆ IsNull()

static bool CryEngine.Resources.Texture.IsNull ( Texture wrapper)
inline
static
protected

◆ operator!=()

static bool CryEngine.Resources.Texture.operator!= ( Texture wrapperA,
Texture wrapperB
)
inline
static

◆ operator==()

static bool CryEngine.Resources.Texture.operator== ( Texture wrapperA,
Texture wrapperB
)
inline
static

◆ SetClamped()

void CryEngine.Resources.Texture.SetClamped ( bool isClamped)
inline

Enable clamping the Texture at the edges instead of wrapping.

Parameters
isClampedIf set to true is clamped.

◆ UpdateData()

void CryEngine.Resources.Texture.UpdateData ( int width,
int height,
byte [] data
)
inline

Pushes new image data into video memory for the allocated texture object. May reinstantiate the texture object, e.g. if size changed.

Parameters
widthTarget Width.
heightTarget Height.
dataImage data for the texture to be filled with.

Property Documentation

◆ Height

int CryEngine.Resources.Texture.Height
get

Texture Height.

The height.

◆ ID

int CryEngine.Resources.Texture.ID
get

ID retrieved from CryEngine on texture creation.

The identifier.

◆ Name

string CryEngine.Resources.Texture.Name
get

Describing name for the texture. Automatically set to the filename if loaded from file.

The name.

◆ Width

int CryEngine.Resources.Texture.Width
get

Texture Width.

The width.