Class TPHXTexture

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TPHXTexture = class(TObject)

Description

Container for a 2D bitmap texture

Hierarchy

  • TObject
  • TPHXTexture

Overview

Methods

Public constructor Create; virtual;
Public destructor Destroy; override;
Public procedure Clear;
Public procedure Build; virtual;
Public procedure Unload; virtual;
Public procedure LoadTexture(const FileName: String); overload;
Public procedure LoadTexture(const FileName: String; Stream: TStream); overload;
Public procedure SaveTexture(const FileName: String); overload;
Public procedure SaveTexture(const FileName: String; Stream: TStream); overload;
Public procedure LoadFromFile(const FileName: String);
Public procedure LoadFromStream(Stream: TStream);
Public procedure SaveToFile(const FileName: String);
Public procedure SaveToStream(const Stream: TStream);
Public procedure Resize(const AWidth, AHeight: Integer; const AFormat: TPHXPixelFormat);
Public procedure Import(const AWidth, AHeight: Integer; const AFormat: TPHXPixelFormat; Data: Pointer); overload;
Public procedure Import(const Graphic: TPHXGraphic ); overload;
Public procedure Import(const Texture: TPHXTexture ); overload;
Public function ScanLine(Line: Integer): PByte;

Properties

Public property Name: String read FName write FName;
Public property Width: Integer read FWidth write SetWidth;
Public property Height: Integer read FHeight write SetHeight;
Public property Format: TPHXPixelFormat read FFormat write SetFormat;
Public property Settings: TPHXTextureSettings read FSettings;
Public property Size: Integer read FSize;
Public property Pixels: PByteArray read FPixels;
Public property Graphic: TPHXGraphic read GetGraphic;
Public property Empty: Boolean read GetEmpty;
Public property Pixel[constX,Y:Integer]: TPHXPixel read GetPixel write SetPixel;

Description

Methods

Public constructor Create; virtual;

Creates a new, empty texture

Public destructor Destroy; override;

Destroy the texture

Public procedure Clear;

Clear the texture

Public procedure Build; virtual;

Upload the texture to the video memory

Public procedure Unload; virtual;

Unload the texture from the video memory

Public procedure LoadTexture(const FileName: String); overload;

Load a texture from a file using a registered texture format

Public procedure LoadTexture(const FileName: String; Stream: TStream); overload;

Load a texture from a stream using a registered texture format

Public procedure SaveTexture(const FileName: String); overload;

Load a texture from a file using a registered texture format

Public procedure SaveTexture(const FileName: String; Stream: TStream); overload;

Load a texture from a stream using a registered texture format

Public procedure LoadFromFile(const FileName: String);

Load the texture from a phoenix texture file

Public procedure LoadFromStream(Stream: TStream);

Load the texture from a phoenix texture stream

Public procedure SaveToFile(const FileName: String);

Save the texture to a phoenix texture file

Public procedure SaveToStream(const Stream: TStream);

Saves the texture to a phoenix texture stream

Public procedure Resize(const AWidth, AHeight: Integer; const AFormat: TPHXPixelFormat);

Resizes the texture buffer, does not affect the texture in video memory

Public procedure Import(const AWidth, AHeight: Integer; const AFormat: TPHXPixelFormat; Data: Pointer); overload;

Import the pixel data

Public procedure Import(const Graphic: TPHXGraphic ); overload;

Import the pixel data from a graphic

Public procedure Import(const Texture: TPHXTexture ); overload;

Import the pixel data from another texture

Public function ScanLine(Line: Integer): PByte;

Provides indexed access to each line of pixels.

Properties

Public property Name: String read FName write FName;

Name of the texture

Public property Width: Integer read FWidth write SetWidth;

Width of the texture

Public property Height: Integer read FHeight write SetHeight;

Height of the texture

Public property Format: TPHXPixelFormat read FFormat write SetFormat;

Format of each pixel in the texture

Public property Settings: TPHXTextureSettings read FSettings;

The texture settings

Public property Size: Integer read FSize;

Return theize of the texture in bytes

Public property Pixels: PByteArray read FPixels;

Return a pointer to the internal texture data

Public property Graphic: TPHXGraphic read GetGraphic;

Return the grapic struct for this texture

Public property Empty: Boolean read GetEmpty;

Returns if the texture is empty (width or height is zero)

Public property Pixel[constX,Y:Integer]: TPHXPixel read GetPixel write SetPixel;

Get the grapic object for this texture


Generated by PasDoc 0.13.0 on 2013-08-26 11:02:43