  Platform eXtended Library (PXL)Units Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers |
Class TCustomCanvas
Unit
PXL.Canvas
Declaration
type TCustomCanvas = class abstract(TObject)
Description
Abstract canvas definition that provides few basic functions that need to be implemented by derived classes and many different rendering functions that internally use basic functions to do the rendering.
Hierarchy
Overview
Fields
Methods
 |
constructor Create(const ADevice: TCustomDevice); |
 |
function BeginScene: Boolean; |
 |
function Initialize: Boolean; |
 |
function SetEffect(const AEffect: TCustomCanvasEffect): Boolean; virtual; |
 |
function SetPalette(const Palette: TIntColorPalette): Boolean; virtual; |
 |
function BeginDraw: Boolean; virtual; |
 |
function DeviceRestore: Boolean; virtual; |
 |
function GetClipRect: TIntRect; virtual; abstract; |
 |
function InitCanvas: Boolean; virtual; |
 |
function NeedsInitialization: Boolean; virtual; |
 |
procedure Circle(const Origin: TPoint2f; const Radius: VectorFloat; const Steps: Integer; const Color: TIntColor; const UseWuLines: Boolean = False); |
 |
procedure DrawIndexedTriangles(const Vertices: PPoint2f; const Colors: PIntColor; const Indices: PLongInt; const VertexCount, TriangleCount: Integer; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); virtual; abstract; |
 |
procedure DrawTexturedTriangles(const Texture: TCustomBaseTexture; const Vertices, TexCoords: PPoint2f; const Colors: PIntColor; const Indices: PLongInt; const VertexCount, TriangleCount: Integer; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); virtual; abstract; |
 |
procedure Ellipse(const Origin, Radius: TPoint2f; const Steps: Integer; const Color: TIntColor; const UseWuLines: Boolean = False); |
 |
procedure EndScene; |
 |
procedure FillArc(const X, Y, Radius, InitAngle, EndAngle: VectorFloat; const Steps: Integer; const Colors: TColorRect; const BlendingEffect: TBlendingEffect); overload; |
 |
procedure FillArc(const Origin, Radius: TPoint2f; const InitAngle, EndAngle: VectorFloat; const Steps: Integer; const Colors: TColorRect; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); overload; |
 |
procedure FillCircle(X, Y, Radius: VectorFloat; Steps: Integer; const Colors: TColorRect; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); |
 |
procedure FillEllipse(const Origin, Radius: TPoint2f; Steps: Integer; const Colors: TColorRect; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); |
 |
procedure FillHexagon(const Matrix: TMatrix3f; const Color1, Color2, Color3, Color4, Color5, Color6: TIntColor; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); |
 |
procedure FillQuad(const Points: TQuad; const Colors: TColorRect; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); |
 |
procedure FillRect(const Left, Top, Width, Height: VectorFloat; const Color: TIntColor; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); overload; |
 |
procedure FillRect(const Rect: TFloatRect; const Color: TIntColor; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); overload; |
 |
procedure FillRect(const Rect: TFloatRect; const Colors: TColorRect; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); overload; |
 |
procedure FillRibbon(const Origin, InsideRadius, OutsideRadius: TPoint2f; const InitAngle, EndAngle: VectorFloat; const Steps: Integer; const Colors: TColorRect; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); overload; |
 |
procedure FillRibbon(const Origin, InsideRadius, OutsideRadius: TPoint2f; const InitAngle, EndAngle: VectorFloat; const Steps: Integer; const InsideColor1, InsideColor2, InsideColor3, OutsideColor1, OutsideColor2, OutsideColor3: TIntColor; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); overload; |
 |
procedure FillTri(const Point1, Point2f, Point3: TPoint2f; const Color1, Color2, Color3: TIntColor; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); |
 |
procedure Finalize; |
 |
procedure Flush; virtual; abstract; |
 |
procedure FrameRect(const Points: TQuad; const Colors: TColorRect; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); overload; |
 |
procedure FrameRect(const Rect: TFloatRect; const Colors: TColorRect; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); overload; |
 |
procedure HorizLine(const Left, Top, Width: VectorFloat; const Colors: TColorPair; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); overload; |
 |
procedure HorizLine(const Left, Top, Width: VectorFloat; const Color: TIntColor; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); overload; |
 |
procedure Line(const SrcPoint, DestPoint: TPoint2f; const Color: TColorPair); overload; virtual; abstract; |
 |
procedure Line(const SrcPoint, DestPoint: TPoint2f; const Color: TIntColor); overload; |
 |
procedure Line(const X1, Y1, X2, Y2: VectorFloat; const Color: TIntColor); overload; |
 |
procedure Line(const X1, Y1, X2, Y2: VectorFloat; const Color: TColorPair); overload; |
 |
procedure LineArray(const Points: PPoint2f; const ElementCount: Integer; const Color: TIntColor); virtual; |
 |
procedure PutPixel(const Point: TPoint2f; const Color: TIntColor); overload; virtual; abstract; |
 |
procedure PutPixel(const X, Y: VectorFloat; const Color: TIntColor); overload; |
 |
procedure QuadHole(const AreaTopLeft, AreaSize, HoleOrigin, HoleRadius: TPoint2f; const OutsideColor, InsideColor: TIntColor; const Steps: Integer; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); |
 |
procedure Reset; virtual; |
 |
procedure ResetPalette; virtual; |
 |
procedure TexQuad(const Points: TQuad; const Colors: TColorRect; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); |
 |
procedure UseImage(const Image: TCustomCanvasImage; const Mapping: TQuad; const TextureIndex: Integer = 0); overload; |
 |
procedure UseImage(const Image: TCustomCanvasImage); overload; |
 |
procedure UseImagePx(const Image: TCustomCanvasImage; const Mapping: TQuad; const TextureIndex: Integer = 0); |
 |
procedure UseImageRegion(const Image: TCustomCanvasImage; const Region: Integer; const Mirror, Flip: Boolean); overload; |
 |
procedure UseImageRegion(const Image: TCustomCanvasImage; const Region: Integer; const SrcRect: TIntRect; const Mirror: Boolean = False; const Flip: Boolean = False); overload; |
 |
procedure UseImageRegion(const Image: TCustomCanvasImage; const Region: Integer = 0); overload; |
 |
procedure UseTexture(const Texture: TCustomBaseTexture; const Mapping: TQuad); |
 |
procedure UseTexturePx(const Texture: TCustomBaseTexture; const Mapping: TQuad); |
 |
procedure VertLine(const Left, Top, Height: VectorFloat; const Color: TIntColor; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); overload; |
 |
procedure VertLine(const Left, Top, Height: VectorFloat; const Colors: TColorPair; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); overload; |
 |
procedure WireHexagon(const Matrix: TMatrix3f; const Color1, Color2, Color3, Color4, Color5, Color6: TIntColor; const UseWuLines: Boolean = False); |
 |
procedure WireQuad(const Points: TQuad; const Colors: TColorRect; const UseWuLines: Boolean = False); |
 |
procedure WuLine(const Point1, Point2f: TPoint2f; const Color: TColorPair); |
 |
procedure DeviceRelease; virtual; |
 |
procedure DoneCanvas; virtual; |
 |
procedure EndDraw; virtual; |
 |
procedure NextDrawCall; virtual; |
 |
procedure SetClipRect(const Value: TIntRect); virtual; abstract; |
 |
procedure UpdateAttributes; virtual; |
Properties
Description
Fields
 |
FCurrentPremultipliedAlpha: Boolean; |
|
Currently set rendering mode in relation to premultiplied or non-premultiplied alpha.
|
 |
FCurrentTextureMapping: TQuad; |
|
Currently defined coordinates within the texture set in FCurrentTexture.
|
Methods
 |
constructor Create(const ADevice: TCustomDevice); |
|
Creates new instance of canvas bound to the specific device.
|
 |
function BeginScene: Boolean; |
|
Prepares the canvas to start the rendering. Any rendering calls can be made after this method succeeds. Returns True when successful and False otherwise.
|
 |
function Initialize: Boolean; |
|
Initializes the canvas so it can be used for rendering. Note that for actual rendering to take place, BeginScene needs to be called first, assuming that initialization succeeded. This results True when successful and False otherwise.
|
 |
function SetEffect(const AEffect: TCustomCanvasEffect): Boolean; virtual; |
|
Sets custom shader effect to be used for rendering. This functionality may be provider and platform dependent. Also, for this to work, TCanvasAttribute.CustomEffect should be set in Attributes.
|
 |
function SetPalette(const Palette: TIntColorPalette): Boolean; virtual; |
|
Sets the palette to be used for rendering 8-bit indexed images. Support for such images varies depending on provider and platform. This returns True when successful and False otherwise.
|
 |
function BeginDraw: Boolean; virtual; |
|
Prepares the canvas for rendering, after which any number of rendering calls can be made. Returns True when successful and False otherwise.
|
 |
function DeviceRestore: Boolean; virtual; |
|
Restores the canvas after its resources have been lost (that is, after DeviceRelease call). This may be implemented by derived classes to handle "device lost" scenario.
|
 |
function GetClipRect: TIntRect; virtual; abstract; |
|
Returns the currently set clipping rectangle.
|
 |
function InitCanvas: Boolean; virtual; |
|
Creates any implementation specific resources for rendering, including hardware and/or GPU resources. Returns True when successful and False otherwise.
|
 |
function NeedsInitialization: Boolean; virtual; |
|
Depending on actual implementation, this indicates whether the canvas requires initialization or not. When this method returns False, then the canvas becomes initialized at the creation and cannot be "finalized".
|
 |
procedure Circle(const Origin: TPoint2f; const Radius: VectorFloat; const Steps: Integer; const Color: TIntColor; const UseWuLines: Boolean = False); |
|
Draws circle with given origin, radius and color. This function uses Line primitive. Steps parameter indicates number of divisions in the ellipse. UseWuLines determines whether to use WuLine primitive instead.
|
 |
procedure DrawIndexedTriangles(const Vertices: PPoint2f; const Colors: PIntColor; const Indices: PLongInt; const VertexCount, TriangleCount: Integer; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); virtual; abstract; |
|
Draws one or more triangles filled with color gradient, specified by vertex, color and index buffers. This method is considered basic functionality and should always be implemented by derived classes.
|
 |
procedure DrawTexturedTriangles(const Texture: TCustomBaseTexture; const Vertices, TexCoords: PPoint2f; const Colors: PIntColor; const Indices: PLongInt; const VertexCount, TriangleCount: Integer; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); virtual; abstract; |
|
Draws one or more triangles filled with texture and color gradient, specified by vertex, texture coordinates, color and index buffers.This method is considered basic functionality and should always be implemented by derived classes.
|
 |
procedure Ellipse(const Origin, Radius: TPoint2f; const Steps: Integer; const Color: TIntColor; const UseWuLines: Boolean = False); |
|
Draws ellipse with given origin, radiuses and color. This function uses Line primitive. Steps parameter indicates number of divisions in the ellipse. UseWuLines indicates whether to use WuLine primitive instead.
|
 |
procedure EndScene; |
|
Finishes rendering phase in the canvas.
|
 |
procedure FillArc(const X, Y, Radius, InitAngle, EndAngle: VectorFloat; const Steps: Integer; const Colors: TColorRect; const BlendingEffect: TBlendingEffect); overload; |
|
Draws filled arc at the given coordinates and radius. The arc begins at InitAngle and ends at EndAngle (in radians), subdivided into a number of triangles specified in Steps. The arc's shape is filled with four color gradient.
|
 |
procedure FillArc(const Origin, Radius: TPoint2f; const InitAngle, EndAngle: VectorFloat; const Steps: Integer; const Colors: TColorRect; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); overload; |
|
Draws filled arc at the given position and radius. The arc begins at InitAngle and ends at EndAngle (in radians), subdivided into a number of triangles specified in Steps. The arc's shape is filled with four color gradient.
|
 |
procedure FillCircle(X, Y, Radius: VectorFloat; Steps: Integer; const Colors: TColorRect; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); |
|
Draws filled circle at the given position and radius. The circle is subdivided into a number of triangles specified in Steps. The shape of circle is filled with four color gradient.
|
 |
procedure FillEllipse(const Origin, Radius: TPoint2f; Steps: Integer; const Colors: TColorRect; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); |
|
Draws filled ellipse at the given position and radius. The ellipse is subdivided into a number of triangles specified in Steps. The shape of ellipse is filled with four color gradient.
|
 |
procedure FillHexagon(const Matrix: TMatrix3f; const Color1, Color2, Color3, Color4, Color5, Color6: TIntColor; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); |
|
Draws hexagon where vertices are spaced 0.5 pixels apart from its center (so diameter is 1) in all directions, multiplied by the given matrix and filled with gradient of six colors at the corresponding vertices. The size, position and rotation of hexagon can be given using one or a combination of several 3x3 matrices multiplied together.
|
 |
procedure FillQuad(const Points: TQuad; const Colors: TColorRect; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); |
|
Draws quadrilateral with color gradient specified by given vertices and colors.
|
 |
procedure FillRect(const Left, Top, Width, Height: VectorFloat; const Color: TIntColor; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); overload; |
|
Draws rectangle filled with single color and specified by given coordinates, and colors.
|
 |
procedure FillRect(const Rect: TFloatRect; const Color: TIntColor; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); overload; |
|
Draws rectangle filled with single color and specified by given margins, and colors.
|
 |
procedure FillRect(const Rect: TFloatRect; const Colors: TColorRect; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); overload; |
|
Draws rectangle with color gradient specified by given margins and colors.
|
 |
procedure FillRibbon(const Origin, InsideRadius, OutsideRadius: TPoint2f; const InitAngle, EndAngle: VectorFloat; const Steps: Integer; const Colors: TColorRect; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); overload; |
|
Draws filled ribbon at the given position between inner and outer radiuses. The ribbon begins at InitAngle and ends at EndAngle (in radians), subdivided into a number of triangles specified in Steps. The ribbon's shape is filled with four color gradient.
|
 |
procedure FillRibbon(const Origin, InsideRadius, OutsideRadius: TPoint2f; const InitAngle, EndAngle: VectorFloat; const Steps: Integer; const InsideColor1, InsideColor2, InsideColor3, OutsideColor1, OutsideColor2, OutsideColor3: TIntColor; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); overload; |
|
Draws filled ribbon at the given position between inner and outer radiuses. The ribbon begins at InitAngle and ends at EndAngle (in radians), subdivided into a number of triangles specified in Steps. The ribbon's shape is filled with continuous gradient set by three pairs of inner and outer colors.
|
 |
procedure FillTri(const Point1, Point2f, Point3: TPoint2f; const Color1, Color2, Color3: TIntColor; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); |
|
Draws triangle filled with color gradient specified by given positions and colors.
|
 |
procedure Finalize; |
|
Finalizes the canvas and releases any resources that were previously allocated during initialization.
|
 |
procedure Flush; virtual; abstract; |
|
Flushes the canvas cache and presents the pending primitives on the destination surface. This can be useful to make sure that nothing remains in canvas cache before starting to render, for instance, a 3D scene.
|
 |
procedure FrameRect(const Points: TQuad; const Colors: TColorRect; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); overload; |
|
Draws rectangle with line width of one pixel specified by given vertices and colors. Although this may receive coordinates for shapes other than rectangle (for example, quadrilateral), the result may be unpredictable. This method unlike other line drawing methods uses filled shapes and assumes that four vertices are aligned to form rectangle. The produced result respects last pixel rule and can be used for drawing UI elements (whereas methods like WireQuad may produce incorrectly sized rectangles depending on implementation).
|
 |
procedure FrameRect(const Rect: TFloatRect; const Colors: TColorRect; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); overload; |
|
Draws rectangle with line width of one pixel specified by given margins and colors. This works in similar fashion as other overloaded FrameRect method by drawing filled shapes instead of lines, and is meant for rendering UI elements.
|
 |
procedure HorizLine(const Left, Top, Width: VectorFloat; const Colors: TColorPair; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); overload; |
|
Draws horizontal line with specified coordinates and color gradient. This method uses filled shapes instead of actual lines to produce accurate results and is meant for rendering UI elements.
|
 |
procedure HorizLine(const Left, Top, Width: VectorFloat; const Color: TIntColor; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); overload; |
|
Draws horizontal line with specified coordinates and single color. This method uses filled shapes instead of actual lines to produce accurate results and is meant for rendering UI elements.
|
 |
procedure Line(const SrcPoint, DestPoint: TPoint2f; const Color: TColorPair); overload; virtual; abstract; |
|
Draws line between two specified positions and filled with color gradient. This method is considered basic functionality and should always be implemented by derived classes.
|
 |
procedure Line(const SrcPoint, DestPoint: TPoint2f; const Color: TIntColor); overload; |
|
Draws line between two specified positions and filled with single color.
|
 |
procedure Line(const X1, Y1, X2, Y2: VectorFloat; const Color: TIntColor); overload; |
|
Draws line between specified coordinate pairs and filled with single color.
|
 |
procedure Line(const X1, Y1, X2, Y2: VectorFloat; const Color: TColorPair); overload; |
|
Draws line between specified coordinate pairs and filled with color gradient.
|
 |
procedure LineArray(const Points: PPoint2f; const ElementCount: Integer; const Color: TIntColor); virtual; |
|
Draws series of lines between specified vertices using solid color.
|
 |
procedure PutPixel(const Point: TPoint2f; const Color: TIntColor); overload; virtual; abstract; |
|
Draws a single pixel on the destination surface with the specified position and color (alpha-blended). This method is considered basic functionality and should always be implemented by derived classes.
|
 |
procedure PutPixel(const X, Y: VectorFloat; const Color: TIntColor); overload; |
|
Draws a single pixel on the destination surface with the specified coordinates and color (alpha-blended).
|
 |
procedure QuadHole(const AreaTopLeft, AreaSize, HoleOrigin, HoleRadius: TPoint2f; const OutsideColor, InsideColor: TIntColor; const Steps: Integer; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); |
|
Draws a filled rectangle at the given position and size with a hole (in form of ellipse) inside at the given center and radius. The quality of the hole is defined by the value of Steps in number of subdivisions. This entire shape is filled with gradient starting from outer color at the edges of rectangle and inner color ending at the edge of hole. This shape can be particularly useful for highlighting items on the screen by darkening the entire area except the one inside the hole.
|
 |
procedure Reset; virtual; |
|
Resets all the states necessary for canvas operation. This can be useful when custom state changes have been made (for instance, in a 3D scene) so to restore the canvas to its working condition this method should be called.
|
 |
procedure ResetPalette; virtual; |
|
Resets the palette to be used for rendering 8-bit indexed images that was previously set by SetPalette.
|
 |
procedure TexQuad(const Points: TQuad; const Colors: TColorRect; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); |
|
Draws textured rectangle at given vertices and multiplied by the specified four color gradient. The texture must be set prior to this call by one of UseTexture[...] or UseImage[...] calls. For every call of TexQuad there must be a preceding UseTexture[...] or UseImage[...] call to specify the image or texture. All pixels of the rendered texture are multiplied by the gradient color before applying alpha-blending. If the texture has no alpha-channel present, alpha value of the gradient will be used instead.
|
 |
procedure UseImage(const Image: TCustomCanvasImage; const Mapping: TQuad; const TextureIndex: Integer = 0); overload; |
|
Defines the specified image with one of its textures to be used in next call to TexQuad. The coordinates inside the texture are defined in logical units in range of [0..1].
|
 |
procedure UseImage(const Image: TCustomCanvasImage); overload; |
|
Defines the specified image to be used in next call to TexQuad. If the image has multiple textures, then the first one will be used.
|
 |
procedure UseImagePx(const Image: TCustomCanvasImage; const Mapping: TQuad; const TextureIndex: Integer = 0); |
|
Defines the specified image with one of its textures to be used in next call to TexQuad. The coordinates inside the texture are defined in pixels using floating-point coordinates.
|
 |
procedure UseImageRegion(const Image: TCustomCanvasImage; const Region: Integer; const Mirror, Flip: Boolean); overload; |
|
Defines the specified region of the image to be used in next call to TexQuad. That region can also be mirrored horizontally and/or flipped vertically, if needed. If the image has no or just one pattern, the value of Region should be set to zero; in this case, the entire texture is used instead.
|
 |
procedure UseImageRegion(const Image: TCustomCanvasImage; const Region: Integer; const SrcRect: TIntRect; const Mirror: Boolean = False; const Flip: Boolean = False); overload; |
|
Defines the specified region of the image to be used in next call to TexQuad. Only a certain portion of that region is used for rendering defined by the given coordinates; these coordinates can also be mirrored horizontally and/or flipped vertically, if needed. If the image has no or just one pattern, the value of Region should be set to zero; in this case, the entire texture is used instead.
|
 |
procedure UseImageRegion(const Image: TCustomCanvasImage; const Region: Integer = 0); overload; |
|
Defines the specified region of the image to be used in next call to TexQuad. If the image has none or just one region defined, the value of Region should be set to zero; in this case, the entire texture is used instead.
|
 |
procedure UseTexture(const Texture: TCustomBaseTexture; const Mapping: TQuad); |
|
Defines the specified texture to be used in next call to TexQuad. The coordinates inside the texture are defined in logical units in range of [0..1].
|
 |
procedure UseTexturePx(const Texture: TCustomBaseTexture; const Mapping: TQuad); |
|
Defines the specified texture to be used in next call to TexQuad. The coordinates inside the texture are defined in pixels using floating-point coordinates.
|
 |
procedure VertLine(const Left, Top, Height: VectorFloat; const Color: TIntColor; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); overload; |
|
Draws vertical line with specified coordinates and single color. This method uses filled shapes instead of actual lines to produce accurate results and is meant for rendering UI elements.
|
 |
procedure VertLine(const Left, Top, Height: VectorFloat; const Colors: TColorPair; const BlendingEffect: TBlendingEffect = TBlendingEffect.Normal); overload; |
|
Draws vertical line with specified coordinates and color gradient. This method uses filled shapes instead of actual lines to produce accurate results and is meant for rendering UI elements.
|
 |
procedure WireHexagon(const Matrix: TMatrix3f; const Color1, Color2, Color3, Color4, Color5, Color6: TIntColor; const UseWuLines: Boolean = False); |
|
Draws lines between each vertex in hexagon. The vertices are spaced 0.5 pixels apart from its center (so diameter is 1) in all directions, multiplied by the given matrix and filled with gradient of six colors at the corresponding vertices. The size, position and rotation of hexagon can be given using one or a combination of several 3x3 matrices multiplied together. This method uses Line primitive. UseWuLines determines whether to use WuLine primitive instead.
|
 |
procedure WireQuad(const Points: TQuad; const Colors: TColorRect; const UseWuLines: Boolean = False); |
|
Draws lines between the specified vertices (making it a wireframe quadrilateral) and vertex colors. Note that this may not necessarily respect last pixel rendering rule). This method uses Line primitive. UseWuLines determines whether to use WuLine primitive instead.
|
 |
procedure WuLine(const Point1, Point2f: TPoint2f; const Color: TColorPair); |
|
Draws antialiased "wu-line" using PutPixel primitive between specified positions filled with single color.
|
 |
procedure DeviceRelease; virtual; |
|
Releases the resources of canvas when the device has been lost. This may be implemented by derived classes to handle "device lost" scenario.
|
 |
procedure DoneCanvas; virtual; |
|
Releases any implementation specific resources for rendering, including hardware and/or GPU resources.
|
 |
procedure EndDraw; virtual; |
|
Finishes rendering and depending on implementation may present results on destination surface.
|
 |
procedure NextDrawCall; virtual; |
|
This method can be called by specific implementations to indicate that canvas buffer is full and new rendering stage begins. Basically, this increments CacheStall by one, which by default is reset back to zero after call to BeginScene.
|
 |
procedure SetClipRect(const Value: TIntRect); virtual; abstract; |
|
Specifies new clipping rectangle for rendering.
|
 |
procedure UpdateAttributes; virtual; |
|
Makes the necessary arrangements so that newly set canvas attributes are taken into account for next rendering calls.
|
Properties
 |
property Attributes: TCanvasAttributes read FAttributes write SetAttributes; |
|
Defines one or more canvas attributes that affect the rendering behavior.
|
 |
property CacheStall: Integer read FCacheStall; |
|
Number of times that rendering cache was reset during last rendering frame. Each cache reset is typically a time-consuming operation so high number of such events could be detrimental to the application's rendering performance. If this parameter happens to be considerably high in the rendered scene, the rendering code should be revised for better grouping of images, shapes and blending types.
|
 |
property ClipRect: TIntRect read GetClipRect write SetClipRect; |
|
The clipping rectangle in which the rendering will be made. This can be useful for restricting the rendering to a certain portion of surface.
|
 |
property Device: TCustomDevice read FDevice; |
|
The device to which this canvas is bound to.
|
 |
property Initialized: Boolean read FInitialized; |
|
Indicates whether the canvas has been initialized by using Initialize function.
|
 |
property Parent: TCustomCanvasParent read FParent; |
|
Provides access to canvas parent if there is such.
|
Copyright © 2000 - 2017 Yuriy Kotsarenko. Help files generated by PasDoc.
|