Unit AdTypes

DescriptionusesClasses, Interfaces, Objects and RecordsFunctions and ProceduresTypesConstantsVariables

Description

Contains some standard types used everywhere in Andorra 2D.

Overview

Classes, Interfaces, Objects and Records

Name Description
packed record TAndorraColor Andorra 2Ds standard color type.
packed record TRGBRec A standard color type without alpha channel.
packed record TAdVector2 A vector type which has two components.
packed record TAdVector3 A vector type which has three components.
packed record TAdVector4 A vector type containing four components.
record TAdVertex Andorras vertex format
packed record TAdPoint A replacement for TPoint.
packed record TAdPointEx A point which contains its coordinates as float values
packed record TAdRect A replacement for TRect.
packed record TAdRectEx A TAdRect with float values.
record TAdTextSetChar Record used for type setting.
record TAdDisplayProperties Defines the properties of the window
Class TAdRenderingObject Objects derived from this class provide a set of render events.

Functions and Procedures

function AdBounds(X,Y,Width,Height:LongInt):TAdRect;
function AdBoundsEx(X,Y,Width,Height:double):TAdRectEx;
procedure AdOffsetRect(var Rect:TAdRect; X, Y:LongInt);
function AdRect(X1,Y1,X2,Y2:LongInt):TAdRect; overload; inline;
function AdRect(X1,Y1,X2,Y2:double):TAdRect; overload; inline;
function AdRectEx(X1,Y1,X2,Y2:double):TAdRectEx; inline;
function AdPoint(X,Y:LongInt):TAdPoint; overload; inline;
function AdPoint(X,Y:double):TAdPoint; overload; inline;
function CompareRects(const Rect1,Rect2:TAdRect):boolean;
function OverlapRect(const Rect1, Rect2: TAdRect): boolean;
function InRect(const X, Y: integer; const Rect: TAdRect): boolean;
function CalcOverlapRect(out AO: TAdRect; const AR1, AR2: TAdRect): boolean;
function AdVector3(AX,AY,AZ:double):TAdVector3; overload;
function AdVector3(AVec: TAdVector2; AZ: double): TAdVector3; overload;
function AdVector4(AX, AY, AZ, AW:double):TAdVector4; overload;
function AdVector4(AVec: TAdVector3; AW: double): TAdVector4; overload;
function AdVector2(AX,AY:double):TAdVector2;
function Ad_ARGB(a,r,g,b:byte):TAndorraColor;
function Ad_RGB(r,g,b:byte):TAndorraColor;
function AdSetAlpha(AAlpha: byte; ACol: Longint):TAndorraColor; overload;
function AdSetAlpha(AAlpha: byte; ACol: TAndorraColor):TAndorraColor; overload;
function AdColorToString(AColor:TAndorraColor): AnsiString;
function StringToAdColor(AString: AnsiString):TAndorraColor;
function AdColorToColor(AAdColor:TAndorraColor):Longint;
function ColorToAdColor(AColor:LongInt):TAndorraColor;
function RGB(r,g,b:byte):Longint;
function GetRValue(AColor:LongInt):byte;
function GetGValue(AColor:LongInt):byte;
function GetBValue(AColor:LongInt):byte;
function CompareColors(col1,col2:TAndorraColor):boolean;
function FloatsEqual(v1, v2, e:double):boolean; overload;
function FloatsEqual(v1, v2, e:single):boolean; overload;
function Cut(AValue:integer):byte;

Types

PAndorraColor = ˆTAndorraColor;
TRGBARec = TAndorraColor;
PRGBARec = ˆTRGBARec;
TRGBAArray = array[0..0] of TRGBARec;
PRGBAArray = ˆTRGBAArray;
PRGBRec = ˆTRGBRec;
TRGBArray = array[0..0] of TRGBRec;
PRGBArray = ˆTRGBArray;
TAdBitDepth = (...);
PAdVector2 = ˆTAdVector2;
PAdVector3 = ˆTAdVector3;
PAdVector4 = ˆTAdVector4;
TAdMatrix = array[0..3] of array[0..3] of single;
PAdVertex = ˆTAdVertex;
TAdVertexArray = array of TAdVertex;
TAdIndexArray = array of Word;
TAdFloatArray = array of Single;
PAdPoint = ˆTAdPoint;
PAdPointEx = ˆTAdPointEx;
PAdRect = ˆTAdRect;
PAdRectEx = ˆTAdRectEx;
TAdFontStyle = (...);
TAdFontStyles = set of TAdFontStyle;
TAdCharPatterns = array[0..255] of TAdRect;
TAdCharSizes = array[0..255] of TAdPoint;
TAdTextSet = array of TAdTextSetChar;
TAdVeryShortString = string[4];
TAdPolygon = array of TAdPoint;
TAdTriangle = array[0..2] of TAdPoint;
TAdTriangles = array of TAdTriangle;
TAdWindowDisplayMode = (...);
TAd2dShaderSourceType = (...);
TAd2dShaderType = (...);
TAdNotifyEvent = procedure(Sender: TObject) of object;
TAdBeginRenderEvent = procedure(Sender: TObject; AModelViewProjection: TAdMatrix) of object;

Constants

aclNone = $1FFFFFFF;
AdMatrix_Clear : TAdMatrix = ((0,0,0,0),(0,0,0,0),(0,0,0,0),(0,0,0,0));
AdMatrix_Identity : TAdMatrix = ((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,0,1));

Variables

AdTextureOffset: single = 0;

Description

Functions and Procedures

function AdBounds(X,Y,Width,Height:LongInt):TAdRect;

Creates a rectangle of the type "TAdRect" with specific x/y coordinates and a specific width/height

function AdBoundsEx(X,Y,Width,Height:double):TAdRectEx;

Creates a rectangle of the type "TAdRectEx" with specific x/y coordinates and a specific width/height

procedure AdOffsetRect(var Rect:TAdRect; X, Y:LongInt);

Moves an existing rectangle by X,Y.

function AdRect(X1,Y1,X2,Y2:LongInt):TAdRect; overload; inline;

Returns a TAdRect.

function AdRect(X1,Y1,X2,Y2:double):TAdRect; overload; inline;

Returns a TAdRect by rounding the coordinates given

function AdRectEx(X1,Y1,X2,Y2:double):TAdRectEx; inline;

Returns a TAdRectEx

function AdPoint(X,Y:LongInt):TAdPoint; overload; inline;

Returns a TAdPoint

function AdPoint(X,Y:double):TAdPoint; overload; inline;

Returns a TAdPoint by rounding the coordinates given

function CompareRects(const Rect1,Rect2:TAdRect):boolean;

Returns true when the two rects have the same coordinates.

function OverlapRect(const Rect1, Rect2: TAdRect): boolean;

Returns true, when the two rects overlap themselves.

function InRect(const X, Y: integer; const Rect: TAdRect): boolean;

Returns true, if the point lies within the rect

function CalcOverlapRect(out AO: TAdRect; const AR1, AR2: TAdRect): boolean;

AO contains the intersection rectangle of the two rectangles. The function returns false if the two rectangles do not overlapp.

function AdVector3(AX,AY,AZ:double):TAdVector3; overload;

Returns a vector with three components.

function AdVector3(AVec: TAdVector2; AZ: double): TAdVector3; overload;

Returns a vector with three components.

function AdVector4(AX, AY, AZ, AW:double):TAdVector4; overload;

Returns a vector with four components.

function AdVector4(AVec: TAdVector3; AW: double): TAdVector4; overload;

Returns a vector with four components.

function AdVector2(AX,AY:double):TAdVector2;

Returns a vector with two components.

function Ad_ARGB(a,r,g,b:byte):TAndorraColor;

Creates an andorra color with the given components.

function Ad_RGB(r,g,b:byte):TAndorraColor;

Creates an andorra color with the given components and alpha is set to 255

function AdSetAlpha(AAlpha: byte; ACol: Longint):TAndorraColor; overload;

Allows to change the alpha component of the given color.

function AdSetAlpha(AAlpha: byte; ACol: TAndorraColor):TAndorraColor; overload;

Allows to change the alpha component of the given color.

function AdColorToString(AColor:TAndorraColor): AnsiString;

Converts a color to a string

function StringToAdColor(AString: AnsiString):TAndorraColor;

Converts a string to a color

function AdColorToColor(AAdColor:TAndorraColor):Longint;

Converts an Andorra color into a TColor.

function ColorToAdColor(AColor:LongInt):TAndorraColor;

Converts a TColor value into an andorra color and sets alpha to 255.

function RGB(r,g,b:byte):Longint;

Returns a TColor with the given components.

function GetRValue(AColor:LongInt):byte;

Extracts the Red-Value from a TColor value.

function GetGValue(AColor:LongInt):byte;

Extracts the Green-Value from a TColor value.

function GetBValue(AColor:LongInt):byte;

Extracts the Blue-Value from a TColor value.

function CompareColors(col1,col2:TAndorraColor):boolean;

Returns true if the given Andorra Colors are equal.

function FloatsEqual(v1, v2, e:double):boolean; overload;

Returns true, when the two floats given lie within the area specified by epsilon.

function FloatsEqual(v1, v2, e:single):boolean; overload;

Returns true, when the two floats given lie within the area specified by epsilon.

function Cut(AValue:integer):byte;

Converts an integer value into a byte value and prevents overflow.

Types

PAndorraColor = ˆTAndorraColor;

Pointer type of TAndorraColor

TRGBARec = TAndorraColor;

Another name for TAndorraColor.

See also
TAndorraColor
Andorra 2Ds standard color type.
PRGBARec = ˆTRGBARec;

Pointer type of TRGBARec.

TRGBAArray = array[0..0] of TRGBARec;

Array used to acces a whole scanline pixel by pixel.

PRGBAArray = ˆTRGBAArray;

Pointer type of TRGBAArray.

PRGBRec = ˆTRGBRec;

Pointer type of TRGBRec.

TRGBArray = array[0..0] of TRGBRec;

Array used to acces a whole scanline pixel by pixel.

PRGBArray = ˆTRGBArray;

Pointer type of TRGBArray.

TAdBitDepth = (...);

Used to specifies the bit depth of a bitmap. Because bitmaps in Andorra 2D are allways RGBA, only 16 and 32 bits are supported. The ordinal values of TAdBitDepth are equivalent to their logic value.

Values
  • ad16Bit = 16: The bit depth is 16 Bit
  • ad32Bit = 32: The bit depth is 32 Bit
PAdVector2 = ˆTAdVector2;

Pointer on TAdVector2

PAdVector3 = ˆTAdVector3;

Pointer on TAdVector3

PAdVector4 = ˆTAdVector4;

Pointer on TAdVector4

TAdMatrix = array[0..3] of array[0..3] of single;

A standard 3x3 matrix.

PAdVertex = ˆTAdVertex;

Pointer on TAdVertex

TAdVertexArray = array of TAdVertex;

An array of the vertex

TAdIndexArray = array of Word;

Represtents an index buffer

TAdFloatArray = array of Single;

Represents an array of floats

PAdPoint = ˆTAdPoint;

Pointer type of TAdPoint.

PAdPointEx = ˆTAdPointEx;

Pointer type of TAdPointEx

PAdRect = ˆTAdRect;

Pointer type of TAdRect.

PAdRectEx = ˆTAdRectEx;

Pointer type of TAdRectEx

TAdFontStyle = (...);

Represents a single style a font may be rendered in.

Values
  • afItalic: The font is rendered italic
  • afBold: The font is rendererd bold
  • afUnderline: The font is rendered underlined
TAdFontStyles = set of TAdFontStyle;

Set of all three font styles.

TAdCharPatterns = array[0..255] of TAdRect;

Array which contains the position of every char of a bitmap font in the texture.

TAdCharSizes = array[0..255] of TAdPoint;

Array which stores the size of a char.

TAdTextSet = array of TAdTextSetChar;

Array returned by the type setter which returns the texture coordinates and the position/size of each char.

TAdVeryShortString = string[4];

A string with the length of five bytes.

TAdPolygon = array of TAdPoint;

A type which represents a polygon

TAdTriangle = array[0..2] of TAdPoint;

A type which contains three points

TAdTriangles = array of TAdTriangle;

A type which represents a set of triangles

TAdWindowDisplayMode = (...);

Defines how the window is displayed.

Values
  • dmDefault: The size of the parent control isn't changed. If the window framwork doesn't use a parent control (e.g. because it creates its own window), dmDefault is equivalent to dmWindowed.
  • dmWindowed: The window is displayed in the window mode.
  • dmScreenRes: The window is resized to the current screen resolution.
  • dmFullscreen: The screen resolution will be changed and the window is displayed int the fullscreen mode.
TAd2dShaderSourceType = (...);

Specifies the type of the shader sourcecode

Values
  • assSource: You have passed the shader sourcecode to the system
  • assCompiled: The shader is already precompiled
TAd2dShaderType = (...);

Specifies the type of the shader program

Values
  • astVertex: This program is a vertex program
  • astFragment: This program is a fragment (pixel) program
TAdNotifyEvent = procedure(Sender: TObject) of object;

Standard event type. Moved here from AdEvents.

TAdBeginRenderEvent = procedure(Sender: TObject; AModelViewProjection: TAdMatrix) of object;

Event type used by TAdRenderingObject.

Parameters
AModelViewProjection
specifies the matrix, that results when multiplying the model, the view and the projection matrix
See also
TAdRenderingObject
Objects derived from this class provide a set of render events.

Constants

aclNone = $1FFFFFFF;
 
AdMatrix_Clear : TAdMatrix = ((0,0,0,0),(0,0,0,0),(0,0,0,0),(0,0,0,0));

A matrix which only contains zero values

AdMatrix_Identity : TAdMatrix = ((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,0,1));

A identity matrix.

Variables

AdTextureOffset: single = 0;

For preventing the graphics board from plotting the from pxiels when the atPoint filter is used, AdTextureOffset/(Width in Pixels) should be added to every texture coordinate. This value is automaticaly set, when a TAdDraw is initialized

SourceForge.net Logo


Generated by PasDoc 0.11.0 on 2008-12-31 14:32:00