Libraries.Game.Graphics.FileTextureData Documentation

The FileTextureData class holds texture information for PixelMaps retrieved from most supported image file types. This is used internally by the game engine, and most users will never interact directly with this class.

Inherits from: Libraries.Language.Object, Libraries.Game.Graphics.TextureData

Actions Documentation

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

Parameters

Return

integer: The Compare result, Smaller, Equal, or Larger.

Example

Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)

ConsumePixelMap()

This action returns the PixelMap stored in this FileTextureData, then removes the reference to it in the FileTextureData.

Return

Libraries.Game.Graphics.PixelMap:

CopyImagesToPowerOfTwo(boolean bool)

This action sets whether or not images should be copied to a power of two.

Parameters

  • boolean bool

DisposePixelMap()

Returns whether or not the PixelMap should be disposed when done. Defaults to true.

Return

boolean:

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Parameters

Return

boolean: True if the hash codes are equal and false if they are not equal.

Example

use Libraries.Language.Object
use Libraries.Language.Types.Text
Object o
Text t
boolean result = o:Equals(t)

GetFile()

Returns the file used to load this FileTextureData.

Return

Libraries.System.File:

GetFormat()

Returns the Format of the PixelMap stored by this FileTextureData.

Return

Libraries.Game.Graphics.Format:

GetHashCode()

This action gets the hash code for an object.

Return

integer: The integer hash code of the object.

Example

Object o
integer hash = o:GetHashCode()

GetHeight()

Returns the height of the PixelMap stored by this FileTextureData.

Return

integer:

GetWidth()

Returns the width of the PixelMap stored by this FileTextureData.

Return

integer:

InitializeFileTextureData(Libraries.System.File newFile, Libraries.Game.Graphics.PixelMap preloadedPixelMap, Libraries.Game.Graphics.Format newFormat, boolean newMipMaps)

This action initializes the FileTextureData so that it may be used. It takes a file to read information from, a PixelMap if one has already been loaded from a file, the Format that should be used for the PixelMap, and a boolean indicating whether this TextureData should be used to create mip maps.

Parameters

IsCustomData()

Returns whether or not this is a custom defined user type of TextureData. Always returns false.

Return

boolean:

IsManaged()

Returns whether or not the information stored by this FileTextureData can automatically handle a loss of OpenGL context. Always returns true.

Return

boolean:

IsPrepared()

This action returns true if the FileTextureData has already had a call to Prepare(), and returns false otherwise.

Return

boolean:

Prepare()

This action prepares the FileTextureData for use, ensuring that the PixelMap is loaded.

SetDisposalState(boolean state)

Sets whether or not the PixelMap in the FileTextureData should be disposed of after use.

Parameters

  • boolean state

TestForCopyToPowerOfTwo()

This action is used to determine if it is necessary for all images to be a power of two in each dimension.

Return

boolean:

UseMipMaps()

Returns whether the data stored in this FileTextureData should be used to generate mip maps for the texture.

Return

boolean: