Gorilla.Context.GLES
Unit Gorilla.Context.GLES.pasClasses
- TContext3DHack = class ( TInterfacedPersistent )
- TCustomContextOpenGL = class ( TContext3D )
TContext3DHack
The TContext3DHack is a helper class for accessing private fields needed for overwriting FMX core functionality.
Ancestors
Members
Fields
- public FContextCount :
Integer
- public FSaveStates :
TList<Gorilla.Context.GLES.TContext3DHack.TContextStates>
- public FGlobalBeginSceneCount :
Integer
- public FChangeStateCount :
Integer
- public FChangeShaderCount :
Integer
- public FFPS :
Double
- public FRenderTime :
Double
- public FBeginTime :
Double
- public FEndTime :
Double
- public FTimerService :
IFMXTimerService
- public FFrameCount :
Integer
- public FCurrentContext :
TContext3D
- public FCurrentStates :
TContext3DHack.TStatesArray
- public FCurrentVertexShader :
TContextShader
- public FCurrentPixelShader :
TContextShader
- public FCurrentOpacity :
Single
- public FCurrentMaterial :
TMaterial
- public FCurrentMaterialClass :
TMaterialClass
- public FCurrentFormat :
TVertexFormats
- public FCurrentScissorRect :
TRect
- public FBeginSceneCount :
Integer
- public FRecalcScreenMatrix :
Boolean
- public FRecalcProjectionMatrix :
Boolean
- public FScreenMatrix :
TMatrix3D
- public FProjectionMatrix :
TMatrix3D
- public FInvScreenMatrix :
TMatrix3D
- public FInvProjectionMatrix :
TMatrix3D
- public FCenterOffset :
TPosition
- public FParent :
TWindowHandle
- public FWidth :
Integer
- public FHeight :
Integer
- public FScale :
Single
- public FTexture :
TTexture
- public FLights :
TLightDescriptionList
- public FMultisample :
TMultisample
- public FDepthStencil :
Boolean
- public FCurrentMatrix :
TMatrix3D
- public FCurrentCameraMatrix :
TMatrix3D
- public FCurrentCameraInvMatrix :
TMatrix3D
- public FCurrentAngleOfView :
Single
- public FDefaultMaterial :
TMaterial
- public FRenderToMatrix :
TMatrix3D
Methods
TCustomContextOpenGL
Ancestors
Members
Fields
- private FExtensions :
TExtensions
- private FIndexBufferSupport :
TContext3D.TIndexBufferSupport
- protected FPrograms :
TList<Gorilla.Context.Shader.TShaderProgram>
- protected FCurrentProgram :
TShaderProgram
- protected FDefaultFrameBuf :
TFrameBufferObject
- protected FDefaultMSFrameBuf :
TFrameBufferObject
- protected FSupportMS :
Boolean
- protected FTranslucentBuf :
TFrameBufferObject
- protected FTranslucentRendering :
Boolean
- protected FBlendingBuffers :
- protected FSmoothTargets :
TSmoothTargets
- protected FOldViewport :
- protected FOriginalCameraMatrix :
TMatrix3D
- protected FBoundary :
TBoundingBox
- protected FFrustumBox :
TBoundingBox
- protected FFrustum :
TGorillaFrustum
- protected FFog :
TGorillaFogSettings
- protected FActivity :
Boolean
- protected FPasses :
TRenderPasses
- protected FCurrentPass :
TRenderPass
- protected FIntermediatePasses :
TRenderPassList
- protected FRenderPassStack :
TStack<Gorilla.Context.Rendering.TRenderPass>
- protected FFBOStack :
TStack<Gorilla.Context.Buffers.TFrameBufferObject>
- protected FCurrentCache :
TMeshBufferObject
- protected FCurrentLayeredMaterial :
TObject
- protected FClippingPlanes :
- public RaiseShaderCompileException :
Boolean
- public InDesignTime :
Boolean
Methods
- protected constructor CreateFromTexture ( const ATexture : TTexture; const AMultisample : TMultisample; const ADepthStencil : Boolean ) ;
- public destructor Destroy ( ) ;
- protected procedure DoOnShaderProgramNotify ( ASender : TObject; const AItem : TShaderProgram; AAction : TCollectionNotification ) ; class;
- protected function GetExtensions ( ) : TExtensions ; static;
- protected procedure OutputInfo ( const APrefix : string; const AProgram : TShaderProgram; const ATexture : TTexture; const ATexIdx : Integer = $FFFFFFFF ) ; class;
- protected function BuildShader ( AType : Integer; const ACode : TContextShaderCode ) : Integer ; class;
- protected function FindProgram ( const VS : TContextShader; const PS : TContextShader ) : TShaderProgram ; class;
- protected procedure UseProgram ( const VS : TContextShader; const PS : TContextShader ) ; class;
- protected function GetTextureIndexByName ( const AName : string ) : Integer ; class;
- protected procedure DestroyPrograms ( ) ; class;
- protected procedure CreateSharedContext ( ) ; class abstract virtual;
- protected procedure DestroySharedContext ( ) ; class abstract virtual;
- protected procedure DoResize ( ) ; override;
- protected procedure DoFreeBuffer ( ) ; override;
- protected procedure DoCopyToBitmap ( const Dest : TBitmap; const ARect : TRect ) ; override;
- protected procedure DoCopyToBits ( const ABits : Pointer; const APitch : Integer; const ARect : TRect ) ; override;
- protected function DoPassProcessing ( const AType : TRenderPassType; const ARenderContext : PRenderContext ) : Boolean ;
- protected function DoBeginScene ( ) : Boolean ; override;
- protected procedure DoEndScene ( ) ; override;
- protected procedure DoDrawPrimitivesBatch ( const AKind : TPrimitivesKind; const Vertices : Pointer; const Indices : Pointer; const VertexDeclaration : TVertexDeclaration; const VertexSize : Integer; const VertexCount : Integer; const IndexSize : Integer; const IndexCount : Integer ) ; override;
- protected procedure DoDrawPrimitives ( const AKind : TPrimitivesKind; const Vertices : Pointer; const Indices : Pointer; const VertexDeclaration : TVertexDeclaration; const VertexSize : Integer; const VertexCount : Integer; const IndexSize : Integer; const IndexCount : Integer ) ; override;
- protected procedure ApplyShaderMaterial ( const Material : TMaterial ) ;
- protected procedure ResetShaderMaterial ( const Material : TMaterial ) ;
- protected procedure DoClear ( const ATarget : TClearTargets; const AColor : TAlphaColor; const ADepth : Single; const AStencil : Cardinal ) ; override;
- protected procedure DoClearEx ( const ATarget : TRenderTargets; const AColor : TAlphaColor; const ADepth : Single; const AStencil : Cardinal ) ; virtual;
- protected procedure DoSetBlendFunc ( SFactor : TBlendFactor; DFactor : TBlendFactor ) ; virtual;
- protected procedure DoSetBlendEquation ( AFunc : TBlendEquationFunc ) ; virtual;
- protected function GetBlending ( ) : TBlendSetting ; virtual;
- protected procedure SetBlending ( const AValue : TBlendSetting ) ; virtual;
- protected procedure DoSetBlendFuncByIndex ( AIndex : Cardinal; SFactor : TBlendFactor; DFactor : TBlendFactor ) ; virtual;
- protected procedure DoSetBlendEquationByIndex ( AIndex : Cardinal; AFunc : TBlendEquationFunc ) ; virtual;
- protected function GetBlendingByIndex ( AIndex : Cardinal ) : TBlendSetting ; virtual;
- protected procedure SetBlendingByIndex ( AIndex : Cardinal; const AValue : TBlendSetting ) ; virtual;
- protected procedure DoSetTwoSidedRendering ( AFrontFaceFail : TStencilOpEx; AFrontFaceZFail : TStencilOpEx; AFrontFaceZPass : TStencilOpEx; ABackFaceFail : TStencilOpEx; ABackFaceZFail : TStencilOpEx; ABackFaceZPass : TStencilOpEx; AFrontStencilMask : Cardinal = $FF ; ABackStencilMask : Cardinal = $FF ) ; virtual;
- protected procedure DoSetPolygonOffsetFill ( const AMode : TPolygonOffsetFill; AFactor : Single = 0 ; AUnits : Single = 100 ) ; virtual;
- protected procedure DoSetSmoothMode ( const ASetting : TSmoothSetting ) ; virtual;
- protected procedure DoSetContextState ( AState : TContextState ) ; override;
- protected procedure DoSetStencilOp ( const Fail : TStencilOp; const ZFail : TStencilOp; const ZPass : TStencilOp ) ; override;
- protected procedure DoSetStencilFunc ( const Func : TStencilFunc; Ref : Cardinal; Mask : Cardinal ) ; override;
- protected procedure DoInitializeTexture ( const ATexture : TTexture ) ; class override;
- protected procedure DoFinalizeTexture ( const ATexture : TTexture ) ; class override;
- protected procedure DoUpdateTexture ( const ATexture : TTexture; const ABits : Pointer; const APitch : Integer ) ; class override;
- protected function DoBitmapToTexture ( const Bitmap : TBitmap ) : TTexture ; class override;
- protected procedure DoInitializeShader ( const Shader : TContextShader ) ; class override;
- protected procedure DoFinalizeShader ( const Shader : TContextShader ) ; class override;
- protected procedure DoSetShaders ( const VertexShader : TContextShader; const PixelShader : TContextShader ) ; override;
- protected procedure DoSetShaderVariable ( const Name : string; const Data : array of TVector3D ) ; overload override;
- protected procedure DoSetShaderVariable ( const Name : string; const ATexture : TTexture ) ; overload override;
- protected procedure DoSetShaderVariable ( const Name : string; const Matrix : TMatrix3D ) ; overload override;
- protected procedure DoSetShaderVariableMatrix ( const AName : string; const AMatrix : TMatrix3D ) ; overload;
- protected procedure DoSetShaderVariableInt ( const AName : string; const AData : array of Integer ) ;
- protected procedure DoSetShaderVariableArrayOfStruct ( const AName : string; const AType : PTypeInfo; const ACount : Integer; var AData : Pointer ) ;
- protected function GetIndexBufferSupport ( ) : TContext3D.TIndexBufferSupport ; override;
- protected function IsDesignTime ( ) : Boolean ; class;
- public function IsContextAvailable ( ) : Boolean ; class abstract virtual;
- public function GetVendorName
(
)
: string
;
class;
Request OpenGL vendor information string.
- public function GetRendererName
(
)
: string
;
class;
Request OpenGL renderer information string.
- public function GetVersion
(
)
: string
;
class;
Request OpenGL version string.
- public function GetExtensionString
(
)
: string
;
class;
Request OpenGL extensions string.
- public function GLHasAnyErrors
(
)
: Boolean
;
class;
Checks if any error occurred in OpenGL.
- public function GetShaderArch ( ) : TContextShaderArch ; class abstract virtual;
- public function GetCurrentProgram ( ) : TShaderProgram ; class;
- public function GetProgram ( const VS : TContextShader; const PS : TContextShader ) : TShaderProgram ;
- public procedure RemoveProgram ( const AShaderProgram : TShaderProgram ) ; overload;
- public procedure RemoveProgram ( const VS : TContextShader; const PS : TContextShader ) ; overload;
- public function PixelFormat ( ) : TPixelFormat ; class override;
- public function MaxTextureSize ( ) : Integer ; class override;
- public function TextureUnitCount ( ) : Integer ; class override;
- public function BeginSceneRendering
(
)
: Boolean
;
virtual;
The method initializes the context for rendering and sets up the viewport size. Besides that the canvas will be locked.
- public procedure EndSceneRendering
(
)
;
virtual;
Unlocks canvas and finishes rendering process.
- public procedure BeginMainRenderPass
(
ACamera :
TMatrix3D; AAngleOfView :
Single; AFill :
TAlphaColor; ADepth :
Single
)
;
Begin main pass rendering in pipeline
- public procedure EndMainRenderPass
(
)
;
End of main pass rendering reached.
- public procedure BindDefaultBuffer ( ) ;
- public procedure UnbindDefaultBuffer ( ) ;
- public function BeginOpaqueRendering
(
)
: Boolean
;
Begin first stage of rendering, where all opaque elements going to be rendered.
- public procedure EndOpaqueRendering
(
)
;
Finish first stage of opaque objects rendering.
- public procedure AttachTextureToDefaultBuffer
(
ATexture :
TTexture; ATarget :
TRenderTarget
)
;
virtual;
Attach a specific texture to default FBO for a specific render target.
- public procedure AttachTextureToTranslucentBuffer
(
ATexture :
TTexture; ATarget :
TRenderTarget
)
;
virtual;
Attach a specific texture to the translucent rendering FBO.
- public procedure LinkDepthBufferToTranslucentBuffer
(
)
;
virtual;
Link depth render buffer to translucent rendering FBO.
- public function BeginTranslucentRendering
(
)
: Boolean
;
Begin second rendering stage where all translucent object are going to be rendered.
- public procedure EndTranslucentRendering
(
)
;
Finish second rendering stage of all translucent objects.
- public procedure PushFBO
(
const
AFBO :
TFrameBufferObject
)
;
Push a framebuffer object to stack for correct order of enabling/disabling.
- public function PopFBO
(
)
: TFrameBufferObject
;
Pop latest framebuffer object from stack and return previous FBO as current FBO.
- public function IsTranslucentRendering
(
)
: Boolean
;
Returns if translucent rendering is active.
- public procedure ClearEx ( const ATarget : TRenderTargets; const AColor : TAlphaColor; const ADepth : Single; const AStencil : Cardinal ) ;
- public procedure ClearBufferFloat ( ABuf : Integer; APtr : PSingle ) ;
- public procedure SetMemoryBarrierBit ( ) ;
- public procedure FetchMemoryBarrierBit ( ) ;
- public procedure SetShaderVariable ( const AName : string; const AMatrix : TMatrix3D; const AAsMat4 : Boolean ) ;
- public procedure SetShaderVariableInt ( const AName : string; const AValue : array of Integer ) ;
- public procedure SetShaderVariableArrayOfStruct ( const AName : string; const AType : PTypeInfo; const ACount : Integer; const AData : Pointer ) ;
- public procedure DrawScreenRectangle ( const AColor : TAlphaColorF ) ; overload;
- public procedure DrawScreenRectangle ( const AColor : TAlphaColor ) ; overload;
- public procedure BeginOrtho ( const ALeft : Single; const ATop : Single; const ARight : Single; const ABottom : Single; const ANear : Single; const AFar : Single ) ; overload;
- public procedure BeginOrtho ( const AData : TOrthographicData ) ; overload;
- public procedure EndOrtho ( ) ;
- public function GetCurrentTexture
(
)
: TTexture
;
Returns the currently active Color_0 texture from currently active framebuffer object.
- public function GetDefaultTexture
(
)
: TTexture
;
Returns the currently active Color_0 texture from default framebuffer object.
- public function GetOpenGLTextureByTextureIndex ( const ATextureIndex : Integer ) : Integer ; class;
- public function PreProcessing ( const ARenderContext : PRenderContext ) : Boolean ; virtual;
- public function PostProcessing ( const ARenderContext : PRenderContext ) : Boolean ; virtual;
- public procedure BeginRenderPass
(
const
APass :
TRenderPass
)
;
Sets the supplied render pass as active and returns the previously active render pass.
- public procedure EndRenderPass
(
)
;
Sets the supplied render pass as active.
- public procedure ResetRenderPasses ( ) ;
- public function GetCurrentRenderPass ( ) : TRenderPass ;
- public procedure AddIntermediatePass ( const APass : TRenderPass ) ;
- public procedure ExecuteRenderPass ( const APass : TRenderPass; const ARenderContext : PRenderContext ) ;
- public procedure SetBlendFunc ( SFactor : TBlendFactor; DFactor : TBlendFactor ) ;
- public procedure SetBlendEquation ( AFunc : TBlendEquationFunc ) ;
- public procedure SetBlendFuncByIndex ( ABuf : Cardinal; SFactor : TBlendFactor; DFactor : TBlendFactor ) ;
- public procedure SetBlendEquationByIndex ( ABuf : Cardinal; AFunc : TBlendEquationFunc ) ;
- public procedure DisableBlendingBuffers ( ) ;
- public procedure SetTwoSidedRendering ( AFrontFaceFail : TStencilOpEx; AFrontFaceZFail : TStencilOpEx; AFrontFaceZPass : TStencilOpEx; ABackFaceFail : TStencilOpEx; ABackFaceZFail : TStencilOpEx; ABackFaceZPass : TStencilOpEx; AFrontStencilMask : Cardinal = $FF ; ABackStencilMask : Cardinal = $FF ) ;
- public procedure SetPolygonOffsetFill ( const AMode : TPolygonOffsetFill; AFactor : Single = 0 ; AUnits : Single = 100 ) ;
- public procedure SetSmoothMode ( const ASetting : TSmoothSetting ) ;
- public procedure SetPointSprites ( const AEnabled : Boolean ) ;
- public procedure SetPointSpriteTextureMode ( ) ;
- public procedure DirectDrawPrimitives
(
const
AKind :
TPrimitivesKind; const
Vertices :
Pointer; const
Indices :
Pointer; const
VertexDeclaration :
TVertexDeclaration; const
VertexSize :
Integer; const
VertexCount :
Integer; const
IndexSize :
Integer; const
IndexCount :
Integer
)
;
For renderpasses a direct draw method is needed with having a default material detection.
- public function GetSceneBoundary
(
)
: TBoundingBox
;
Get the latest context 3D scene boundary.
- public procedure SetSceneBoundary
(
const
ABounds :
TBoundingBox
)
;
Set the latest context 3D scene boundary.
- public function GetFrustum
(
)
: TGorillaFrustum
;
Returns the latest camera frustum.
- public procedure SetFrustum
(
const
AFrustum :
TGorillaFrustum
)
;
Set the latest context 3D camera frustum.
- public function GetFrustumBoundary
(
)
: TBoundingBox
;
Get the latest context 3D camera frustum boundary box.
- public procedure ActivateClipPlane
(
AIndex :
Integer; const
APlane :
TPlaneF
)
;
Activate a specific clipping plane.
- public procedure DeactivateClipPlane
(
AIndex :
Integer
)
;
Deactivate a specific clipping plane.
- public function GetClippingPlane
(
AIndex :
Integer
)
: PClipPlaneF
;
Get the clipping plane struct for a specific entry (0..7)
- public function IsClippingPlaneActive
(
AIndex :
Integer
)
: Boolean
;
Checks if a specific clipping plane is activated.
- public function ScreenToWorld
(
const
AScreenPos :
TPointF; const
AProjection :
TProjection
)
: TPoint3D
;
Converts 2D screen coordinates into 3D world coordinates. This method is always an approximate on consideration of near/far plane.
- class private procedure Create@ ( ) ; class constructor noself;
- class private procedure Destroy@ ( ) ; class destructor noself;
- public procedure FillCube ( const Center : TPoint3D; const Size : TPoint3D; const Opacity : Single; const Color : TAlphaColor ) ;
- public procedure DrawLine ( const StartPoint : TPoint3D; const EndPoint : TPoint3D; const Opacity : Single; const Color : TAlphaColor ) ;
- public procedure DrawRect ( const TopLeft : TPoint3D; const BottomRight : TPoint3D; const Opacity : Single; const Color : TAlphaColor ) ;
- public procedure DrawCube ( const Center : TPoint3D; const Size : TPoint3D; const Opacity : Single; const Color : TAlphaColor ) ;
- public procedure FillPolygon ( const Center : TPoint3D; const Size : TPoint3D; const Rect : TRectF; const Points : TPolygon; const Material : TMaterial; const Opacity : Single; Front : Boolean = True ; Back : Boolean = True ; Left : Boolean = True ) ;
Properties
- public Blending : TBlendSetting
- public BlendingBuffer[AIndex] : TBlendSetting
- public SmoothTargets : TSmoothTargetsread FSmoothTargets
- public OriginalCameraMatrix : TMatrix3D
- public Fog : TGorillaFogSettings
- public RenderPasses : TRenderPassesread FPasses
- public IntermediatePasses : TObjectList<Gorilla.Context.Rendering.TRenderPass>read FIntermediatePasses
- public CurrentPass : TRenderPassread FCurrentPass
- public CurrentCache : TMeshBufferObject
- public CurrentLayeredMaterial : TObject
- public Extensions : TExtensionsread GetExtensions