Class TDisplay

Unit

Declaration

type TDisplay = class(TObject)

Description

Default display.

This is a quite simple display configured for OpenGL.

See also
TA3DGEApplication.Display
Access to display.

Hierarchy

  • TObject
  • TDisplay

Overview

Methods

Protected function GetDisplayFlags: AL_INT;
Protected procedure GetDisplaySize (out aWidth, aHeight: Integer);
Protected procedure GetWindowSize (out aWidth, aHeight: Integer);
Protected procedure Close;
Public constructor Create;
Public destructor Destroy; override;
Public procedure Open;
Public function IsOpen: Boolean;
Public procedure SetOrthographicProjection;
Public procedure SetAsTarget;
Public procedure FlipDisplay;
Public procedure ScreenShot;

Properties

Public property Title: String read fTitle write SetTitle;
Public property CenterX: Integer read fCenterX;
Public property CenterY: Integer read fCenterY;
Public property Width: Integer read fWidth;
Public property Height: Integer read fHeight;
Public property Windowed: Boolean read fWindowed write SetWindowed;
Public property OnOpen: TNotifyEvent read fOnOpen;
Public property OnClose: TNotifyEvent read fOnClose;

Description

Methods

Protected function GetDisplayFlags: AL_INT;

Return flags to be applied to the display.

Note that Open will use only flags that are compatible with the display configuration.

See also
TDisplay.Open
Open the display.
TDisplay.GetWindowSize
Get default window size for windowed mode.
Protected procedure GetDisplaySize (out aWidth, aHeight: Integer);

Get default display size for full screen mode.

See also
TDisplay.GetWindowSize
Get default window size for windowed mode.
TDisplay.Open
Open the display.
TDisplay.GetDisplayFlags
Return flags to be applied to the display.
Protected procedure GetWindowSize (out aWidth, aHeight: Integer);

Get default window size for windowed mode.

Right now it returns a window that fits in the current desktop with 16:9 proportion.

See also
TDisplay.GetDisplaySize
Get default display size for full screen mode.
TDisplay.Open
Open the display.
TDisplay.GetDisplayFlags
Return flags to be applied to the display.
Protected procedure Close;

Close and release all used resources.

Note that this will destroy the Allegro display (if exists) so if it is used as source of events it will not be used anymore, and video bitmaps will be invalidated. Read Allegro documentation for details.

See also
TDisplay.Open
Open the display.
TDisplay.OnClose
Notifies when display is going to close.
Public constructor Create;

Constructor.

Public destructor Destroy; override;

Destructor.

Public procedure Open;

Open the display.

It will close the previous display if exists.

You're unlikely to use this method as it will be called by the initialization method of the application object.

See also
TDisplay.IsOpen
Check if display is open.
TDisplay.Windowed
To select windowed or full screen mode.
TDisplay.Title
Window title.
TDisplay.FlipDisplay
Do the apropiate operation so that what has been drawn previously on the display become visible on screen.
TDisplay.GetDisplayFlags
Return flags to be applied to the display.
TDisplay.GetDisplaySize
Get default display size for full screen mode.
TDisplay.GetWindowSize
Get default window size for windowed mode.
TDisplay.SetOrthographicProjection
Set orthogonal projection for full display.
TDisplay.OnOpen
Notifies when display opens.
TDisplay.OnClose
Notifies when display is going to close.
TA3DGEApplication.Initialize
Initialize the application.
Public function IsOpen: Boolean;

Check if display is open.

See also
TDisplay.Open
Open the display.
TDisplay.Close
Close and release all used resources.
TDisplay.OnOpen
Notifies when display opens.
TDisplay.OnClose
Notifies when display is going to close.
Public procedure SetOrthographicProjection;

Set orthogonal projection for full display.

Note this method will also change the viewport to the whole display.

For OpenGL, screen coordinates are -1 to 1 in both height and width. For Allegro, it is pixel coordinates.

See also
TDisplay.Width
Display width.
TDisplay.Height
Display height.
TDisplay.Open
Open the display.
TCamera.SetOrthographicProjection
Change the camera projection matrix for orthographic (paralel) projection.
Public procedure SetAsTarget;

Set display as target for rendering.

See also
TDisplay.FlipDisplay
Do the apropiate operation so that what has been drawn previously on the display become visible on screen.
TDisplay.Open
Open the display.
Public procedure FlipDisplay;

Do the apropiate operation so that what has been drawn previously on the display become visible on screen.

See also
TDisplay.Open
Open the display.
TDisplay.SetAsTarget
Set display as target for rendering.
Public procedure ScreenShot;

Take a screenshot.

Properties

Public property Title: String read fTitle write SetTitle;

Window title.

You can set it before or after opening the display.

Public property CenterX: Integer read fCenterX;

Display center X.

Public property CenterY: Integer read fCenterY;

Display center Y.

Public property Width: Integer read fWidth;

Display width.

Public property Height: Integer read fHeight;

Display height.

Public property Windowed: Boolean read fWindowed write SetWindowed;

To select windowed or full screen mode.

If the display is opened, it will be closed and then reopened. That will trigger the OnClose and OnOpen events in order.

If DEBUGMODE is defined default is True, else default is False.

See also
TDisplay.Open
Open the display.
Public property OnOpen: TNotifyEvent read fOnOpen;

Notifies when display opens.

See also
TDisplay.Open
Open the display.
TDisplay.IsOpen
Check if display is open.
TDisplay.OnClose
Notifies when display is going to close.
Public property OnClose: TNotifyEvent read fOnClose;

Notifies when display is going to close.

This will be notified before the display is closed.

See also
TDisplay.Close
Close and release all used resources.
TDisplay.IsOpen
Check if display is open.
TDisplay.OnOpen
Notifies when display opens.

Generated by PasDoc 0.15.0. Generated on 2025-07-31 11:41:01.