FMX.Types3D.TContext3D.BeginScene
Delphi
function BeginScene: Boolean;
C++
bool __fastcall BeginScene();
Properties
| Type | Visibility | Source | Unit | Parent |
|---|---|---|---|---|
| function | public | FMX.Types3D.pas FMX.Types3D.hpp |
FMX.Types3D | TContext3D |
Description
Notifies the TContext3D object that the drawing can begin.
Call BeginScene before drawing on the TContext3D.
To end the drawing session, call EndScene.
If an application has called BeginScene and BeginScene returns True, then the application must call EndScene. That is, the recommended call pattern should look like this:
if Context3D.BeginScene then
try
Context3D.xxx //drawing image operations
...
finally
Context3D.EndScene;
end;
Each time the TContext3D object calls BeginScene and BeginScene returns True, the value of the BeginSceneCount property is increased by one. Each time the TContext3D object calls EndScene, the value of the BeginSceneCount property is decreased by one. BeginScene uses BeginSceneCount to guarantee that the TContext3D object has no more than one initialized drawing at any moment.
- Note:
TCanvasand all subclasses have support for multi-threaded environments, but does not support simultaneous execution of Canvas instances. This means that when a Canvas callsBeginScene, the execution of the code inside thisBeginScene...EndScenesection blocks any other thread that attempts to process drawing, including drawing on other canvases. WriteBeginScene...EndSceneblocks as short as possible to avoid blocking other threads.