Unit CastleControl

Description

Component with OpenGL context suitable for 2D and 3D rendering of "Castle Game Engine".

Uses

Overview

Classes, Interfaces, Objects and Records

Name Description
Class TCastleControlCustom OpenGL control with extensions for "Castle Game Engine", including Controls list for TUIControl instances.
Class TControlGameSceneManager Same as TGameSceneManager, redefined only to work as a sub-component of TCastleControl, otherwise Lazarus fails to update the uses clause correctly and you cannot edit the events of CastleControl1.SceneManager subcomponent.
Class TCastleControl Render 3D world and GUI controls.
Class TControl2DSceneManager Same as T2DSceneManager, redefined only to work as a sub-component of TCastleControl, otherwise Lazarus fails to update the uses clause correctly and you cannot edit the events of CastleControl1.SceneManager subcomponent.
Class TCastle2DControl Render 2D game world and GUI.

Functions and Procedures

procedure Register;

Types

TControlInputPressReleaseEvent = procedure (Sender: TObject; const Event: TInputPressRelease) of object;
TControlInputMotionEvent = procedure (Sender: TObject; const Event: TInputMotion) of object;

Constants

DefaultLimitFPS = 100.0;

Variables

LimitFPS: Single = DefaultLimitFPS;

Description

Functions and Procedures

procedure Register;
 

Types

TControlInputPressReleaseEvent = procedure (Sender: TObject; const Event: TInputPressRelease) of object;
 
TControlInputMotionEvent = procedure (Sender: TObject; const Event: TInputMotion) of object;
 

Constants

DefaultLimitFPS = 100.0;

Define this for new Lazarus that has Options (with ocoRenderAtDesignTime) (see issue https://bugs.freepascal.org/view.php?id=32026 ).

Variables

LimitFPS: Single = DefaultLimitFPS;

Limit the number of (real) frames per second inside TCastleControl rendering, to not hog the CPU. Set to zero to not limit.

See TCastleWindow.ProcessMessage documentation about WaitToLimitFPS parameter, and see TCastleApplication.LimitFPS documentation.

The mechanism does mean sleeping in your process, so it's a global thing, not just a property of TCastleControl. However, the mechanism is activated only when some TCastleControl component is used, and only when LCL idle is fired (so we have no pending events, as LCL idle is "lazy" and fires only when process is really idle), and not at Lazarus design time.

When we may be clogged with events (like when using mouse look) this has an additional meaning: it is then used to force TCastleControl.DoUpdate and (if needed) repaint at least this often. So it is not only a limit, it's more like "the desired number of FPS". Although it's capped by MaxDesiredFPS (100), which is applied when LimitFPS > MaxDesiredFPS or when LimitFPS = 0 (which means "infinity").


Generated by PasDoc 0.15.0.