Class TCastleControlCustom

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TCastleControlCustom = class(TOpenGLControl)

Description

OpenGL control, with extensions for "Castle Game Engine", including Controls list for TUIControl instances. Use a descendant TCastleControl to have a ready TCastleControl.SceneManager for 3D world.

This extends TOpenGLControl, adding various features:

Hierarchy

  • TOpenGLControl
  • TCastleControlCustom

Overview

Methods

Protected procedure DestroyHandle; override;
Protected procedure DoExit; override;
Protected procedure Resize; override;
Protected procedure KeyDown(var Key: Word; Shift: TShiftState); override;
Protected procedure KeyUp(var Key: Word; Shift: TShiftState); override;
Protected procedure MouseDown(Button: Controls.TMouseButton; Shift:TShiftState; X,Y:Integer); override;
Protected procedure MouseUp(Button: Controls.TMouseButton; Shift:TShiftState; X,Y:Integer); override;
Protected procedure MouseMove(Shift: TShiftState; NewX, NewY: Integer); override;
Protected function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint): Boolean; override;
Protected procedure DoUpdate; virtual;
Public constructor Create(AOwner: TComponent); override;
Public destructor Destroy; override;
Public function Controls: TUIControlList;
Public function MakeCurrent(SaveOldToStack: boolean = false): boolean; override;
Public procedure Invalidate; override;
Public procedure Paint; override;
Public procedure ReleaseAllKeysAndMouse;
Public function SaveScreenBuffer: TColorBuffer;
Public function SaveScreen: TRGBImage;
Public function Rect: TRectangle;

Properties

Protected property GLInitialized: boolean read FGLInitialized;
Public property Pressed: TKeysPressed read FPressed;
Public property MousePressed: CastleKeysMouse.TMouseButtons read FMousePressed;
Public property MousePosition: TVector2Single read FMousePosition write SetMousePosition;
Public property Fps: TFramesPerSecond read FFps;
Public property OnOpen: TContainerEvent read GetOnOpen write SetOnOpen;
Public property OnBeforeRender: TContainerEvent read GetOnBeforeRender write SetOnBeforeRender;
Public property OnRender: TContainerEvent read GetOnRender write SetOnRender;
Public property OnResize: TContainerEvent read GetOnResize write SetOnResize;
Public property OnClose: TContainerEvent read GetOnClose write SetOnClose;
Public property OnPress: TInputPressReleaseEvent read GetOnPress write SetOnPress;
Public property OnRelease: TInputPressReleaseEvent read GetOnRelease write SetOnRelease;
Public property OnMotion: TInputMotionEvent read GetOnMotion write SetOnMotion;
Public property OnUpdate: TContainerEvent read GetOnUpdate write SetOnUpdate;
Published property TabOrder;
Published property TabStop default true;
Published property Container: TContainer read FContainer;

Description

Methods

Protected procedure DestroyHandle; override;
 
Protected procedure DoExit; override;
 
Protected procedure Resize; override;
 
Protected procedure KeyDown(var Key: Word; Shift: TShiftState); override;
 
Protected procedure KeyUp(var Key: Word; Shift: TShiftState); override;
 
Protected procedure MouseDown(Button: Controls.TMouseButton; Shift:TShiftState; X,Y:Integer); override;
 
Protected procedure MouseUp(Button: Controls.TMouseButton; Shift:TShiftState; X,Y:Integer); override;
 
Protected procedure MouseMove(Shift: TShiftState; NewX, NewY: Integer); override;
 
Protected function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint): Boolean; override;
 
Protected procedure DoUpdate; virtual;
 
Public constructor Create(AOwner: TComponent); override;
 
Public destructor Destroy; override;
 
Public function Controls: TUIControlList;
 
Public function MakeCurrent(SaveOldToStack: boolean = false): boolean; override;
 
Public procedure Invalidate; override;
 
Public procedure Paint; override;
 
Public procedure ReleaseAllKeysAndMouse;
 
Public function SaveScreenBuffer: TColorBuffer;

Color buffer where we draw, and from which it makes sense to grab pixels. Use with SaveScreen_NoFlush.

Public function SaveScreen: TRGBImage;

Capture the current control contents to an image. These functions take care of flushing any pending redraw operations and capturing the screen contents correctly.

Public function Rect: TRectangle;

Rectangle representing the inside of this container. Always (Left,Bottom) are zero, and (Width,Height) correspond to container sizes.

Properties

Protected property GLInitialized: boolean read FGLInitialized;
 
Public property Pressed: TKeysPressed read FPressed;
 
Public property MousePressed: CastleKeysMouse.TMouseButtons read FMousePressed;
 
Public property MousePosition: TVector2Single read FMousePosition write SetMousePosition;

Current mouse position. See TTouch.Position for a documentation how this is expressed.

Public property Fps: TFramesPerSecond read FFps;
 
Public property OnOpen: TContainerEvent read GetOnOpen write SetOnOpen;
 
Public property OnBeforeRender: TContainerEvent read GetOnBeforeRender write SetOnBeforeRender;
 
Public property OnRender: TContainerEvent read GetOnRender write SetOnRender;
 
Public property OnResize: TContainerEvent read GetOnResize write SetOnResize;
 
Public property OnClose: TContainerEvent read GetOnClose write SetOnClose;
 
Public property OnPress: TInputPressReleaseEvent read GetOnPress write SetOnPress;
 
Public property OnRelease: TInputPressReleaseEvent read GetOnRelease write SetOnRelease;
 
Public property OnMotion: TInputMotionEvent read GetOnMotion write SetOnMotion;
 
Public property OnUpdate: TContainerEvent read GetOnUpdate write SetOnUpdate;
 
Published property TabOrder;
 
Published property TabStop default true;
 
Published property Container: TContainer read FContainer;