Description | Hierarchy | Fields | Methods | Properties |
type TAdDraw = class(TAdRenderingSurface)
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.
constructor Create(AParent: Pointer); reintroduce; |
|
destructor Destroy; override; |
|
function CanDraw:boolean; override; |
|
function Initialize: boolean; |
|
procedure Finalize; |
|
procedure Restore; |
|
procedure Flip; |
|
procedure BeginScene; |
|
procedure EndScene; |
|
procedure RegisterNotifyEvent(AProc:TAdSurfaceEvent); |
|
procedure UnRegisterNotifyEvent(AProc:TAdSurfaceEvent); |
|
procedure Run; |
|
function GetLastError: string; |
property DllName : string read FDllName write SetDllName; |
|
property DllLoader: TAdDllLoader read FDllLoader; |
|
property Initialized : boolean read FInitialized; |
|
property Fonts: TAdFontFactory read FFonts; |
|
property Window: TAdWindowFramework read FWnd; |
|
property ActiveSurface: TAdSurface read FActiveSurface write SetActiveSurface; |
|
property Parent: Pointer read FParent; |
|
property AdAppl: TAd2dApplication read FAdAppl; |
|
property Properties: TAdPluginPropertyList read FProperties; |
|
property Log: TAdLog read FLog; |
|
property Display: TAdDisplay read FDisplay; |
|
property SurfaceRect: TAdRect read GetSurfaceRect; |
|
property OnFinalize : TNotifyEvent read FFinalize write FFinalize; |
|
property OnInitialize : TNotifyEvent read FInitialize write FInitialize; |
function CanDraw:boolean; override; |
|
Returns true if the context is initialized and you can draw on it. |
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
|
procedure Finalize; |
|
Finalizes the surface. The "seFinalize" surface event is called. |
procedure Restore; |
|
Restores the surface (e.g. after a window resize). |
procedure Flip; |
|
Exchanges the front- and the backbuffer. |
procedure BeginScene; |
|
All graphic operations (except for ClearSurface) should stand between the "BeginScene" and "EndScene" command. |
procedure RegisterNotifyEvent(AProc:TAdSurfaceEvent); |
|
Registeres a new SurfaceEvent function. See also
|
procedure UnRegisterNotifyEvent(AProc:TAdSurfaceEvent); |
|
Unregisters a registered SurfaceEvent function. |
procedure Run; |
|
If TAdDraw created its own window, call the Run function to make the application actually run. |
property DllName : string read FDllName write SetDllName; |
|
The filename of the graphic plugin that should be loaded. |
property DllLoader: TAdDllLoader read FDllLoader; |
|
Reference to the DllLoader class. This reference can be used to call some of the dll functions directly. |
property Initialized : boolean read FInitialized; |
|
Returns whether the surface is initialized. |
property Fonts: TAdFontFactory read FFonts; |
|
TAdDraw contains its own font factory that may be used to display fonts on the surface. |
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. |
property ActiveSurface: TAdSurface read FActiveSurface write SetActiveSurface; |
|
Reference on the currently active surface. |
property Parent: Pointer read FParent; |
|
Reference on the partent parameter you've passed in the constructor. |
property AdAppl: TAd2dApplication read FAdAppl; |
|
Reference on the Andorra 2D graphic system abstraction layer. |
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. |
property Log: TAdLog read FLog; |
|
Reference on the log file wrapper. |
property Display: TAdDisplay read FDisplay; |
|
The display settings. |
property SurfaceRect: TAdRect read GetSurfaceRect; |
|
Returns the size of the surface. |
property OnFinalize : TNotifyEvent read FFinalize write FFinalize; |
|
Called when TAdDraw is finalized. |
property OnInitialize : TNotifyEvent read FInitialize write FInitialize; |
|
Called when TAdDraw is initialized. |