Class TAdDraw

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TAdDraw = class(TAdRenderingSurface)

Description

This is the main class for using Andorra 2D. It represents the main surface. Remember that there can only be one instance of TAdDraw at one time. TAdDraw is not a singleton, but the underlying graphic plugin may only support one graphic context per application. If you want to have more than one surface in your application, you may render your content to a TAdTextureSurface and finally render this to TAdDraw.

Hierarchy

Overview

Methods

Public constructor Create(AParent: Pointer); reintroduce;
Public destructor Destroy; override;
Public function CanDraw:boolean; override;
Public function Initialize: boolean;
Public procedure Finalize;
Public procedure Restore;
Public procedure Flip;
Public procedure BeginScene;
Public procedure EndScene;
Public procedure RegisterNotifyEvent(AProc:TAdSurfaceEvent);
Public procedure UnRegisterNotifyEvent(AProc:TAdSurfaceEvent);
Public procedure Run;
Public function GetLastError: string;

Properties

Public property DllName : string read FDllName write SetDllName;
Public property DllLoader: TAdDllLoader read FDllLoader;
Public property Initialized : boolean read FInitialized;
Public property Fonts: TAdFontFactory read FFonts;
Public property Window: TAdWindowFramework read FWnd;
Public property ActiveSurface: TAdSurface read FActiveSurface write SetActiveSurface;
Public property Parent: Pointer read FParent;
Public property AdAppl: TAd2dApplication read FAdAppl;
Public property Properties: TAdPluginPropertyList read FProperties;
Public property Log: TAdLog read FLog;
Public property Display: TAdDisplay read FDisplay;
Public property SurfaceRect: TAdRect read GetSurfaceRect;
Public property OnFinalize : TNotifyEvent read FFinalize write FFinalize;
Public property OnInitialize : TNotifyEvent read FInitialize write FInitialize;

Description

Methods

Public constructor Create(AParent: Pointer); reintroduce;

Creates a new instance of TAdDraw.

Parameters
AParent
specifies the underlying window control. If you want TAdDraw to create its own window, this parameter may be nil. If the window control type you've chosen not available, TAdDraw does not initialize correctly.
Public destructor Destroy; override;

Destroys the instance of TAdDraw. Destroy cause in finalizing the active graphic surface. TAdDraw should be the first thing you create and the last thing you free in your Andorra 2D application.

Public function CanDraw:boolean; override;

Returns true if the context is initialized and you can draw on it.

Public function Initialize: boolean;

Initializes the graphic context. If the result is true, inizialization was successfull. Remember to setup the display mode and the plugin dll before initializing TAdDraw. These steps can automatically be done by TAdSetup. Initialize will call the "seInitialize" surface event and after that the "seInitialized" event. It an error occured, the result is false. The error message can be obtained via the "GetLastError" method.

See also
TAdSetup
A cross plattform (and compiler) setup dialog, that enables the possibility of choosing a plugin and setting the resolution.
TAdDllExplorer
A class, which lets you search for all Andorra 2D Plugin libraries within a specific directory.
TAdDisplay
TAdDisplay represents the video display settings.
RegisterNotifyEvent
Registeres a new SurfaceEvent function.
UnRegisterNotifyEvent
Unregisters a registered SurfaceEvent function.
Public procedure Finalize;

Finalizes the surface. The "seFinalize" surface event is called.

Public procedure Restore;

Restores the surface (e.g. after a window resize).

Public procedure Flip;

Exchanges the front- and the backbuffer.

Public procedure BeginScene;

All graphic operations (except for ClearSurface) should stand between the "BeginScene" and "EndScene" command.

Public procedure EndScene;

All graphic operations (except for ClearSurface) should stand between the "BeginScene" and "EndScene" command. End scene automatically causes all registered canvases to call their "release" function.

Public procedure RegisterNotifyEvent(AProc:TAdSurfaceEvent);

Registeres a new SurfaceEvent function.

See also
TAdSurfaceEvent
The declaration of the surface event handler callback procedure.
Public procedure UnRegisterNotifyEvent(AProc:TAdSurfaceEvent);

Unregisters a registered SurfaceEvent function.

Public procedure Run;

If TAdDraw created its own window, call the Run function to make the application actually run.

Public function GetLastError: string;

If an critical operation (e.g. initializing TAdDraw) failed (returned "false"), the "GetLastError" returns the last error message, that may be shown to the user. It such a critical error occurs, it is always logged in the log file too.

Properties

Public property DllName : string read FDllName write SetDllName;

The filename of the graphic plugin that should be loaded.

Public property DllLoader: TAdDllLoader read FDllLoader;

Reference to the DllLoader class. This reference can be used to call some of the dll functions directly.

Public property Initialized : boolean read FInitialized;

Returns whether the surface is initialized.

Public property Fonts: TAdFontFactory read FFonts;

TAdDraw contains its own font factory that may be used to display fonts on the surface.

Public property Window: TAdWindowFramework read FWnd;

The underlying window framework. Use this property to change properites of the window framework like the window caption or to connect surface events.

Public property ActiveSurface: TAdSurface read FActiveSurface write SetActiveSurface;

Reference on the currently active surface.

Public property Parent: Pointer read FParent;

Reference on the partent parameter you've passed in the constructor.

Public property AdAppl: TAd2dApplication read FAdAppl;

Reference on the Andorra 2D graphic system abstraction layer.

Public property Properties: TAdPluginPropertyList read FProperties;

Provides access on the plugin properties. Those properties can be used to pass graphic system specific parameters to the graphic plugin.

Public property Log: TAdLog read FLog;

Reference on the log file wrapper.

Public property Display: TAdDisplay read FDisplay;

The display settings.

Public property SurfaceRect: TAdRect read GetSurfaceRect;

Returns the size of the surface.

Public property OnFinalize : TNotifyEvent read FFinalize write FFinalize;

Called when TAdDraw is finalized.

Public property OnInitialize : TNotifyEvent read FInitialize write FInitialize;

Called when TAdDraw is initialized.

SourceForge.net Logo


Generated by PasDoc 0.11.0 on 2008-12-31 14:31:59