Class TBGLFrameBuffer
Unit
Declaration
type TBGLFrameBuffer = class(TBGLCustomFrameBuffer)
Description
Frame buffer in OpenGL.
A frame buffer is a texture that can be used as a drawing surface in OpenGL.
Example of drawing on a framebuffer and then drawing it on the OpenGL control:
uses ..., BGRABitmapTypes, BGRAOpenGL; procedure TForm1.OpenGLControlPaint(Sender: TObject); var mousePos: TPoint; buf: TBGLFrameBuffer; begin // Draw Background BGLViewPort(OpenGLControl.Width, OpenGLControl.Height, BGRAWhite); // Create framebuffer buf := TBGLFrameBuffer.Create(256,256); // Use it BGLCanvas.ActiveFrameBuffer := buf; BGLCanvas.Fill(CSSYellow); BGLCanvas.Line(0,0,128,128, BGRABlack); mousePos := ScreenToClient(Mouse.CursorPos); BGLCanvas.FillRect(mousePos.x - 50, mousePos.y - 50, mousePos.x + 50, mousePos.y + 50, CSSRed, False); // Render framebuffer on the control BGLCanvas.ActiveFrameBuffer := nil; BGLCanvas.PutImage(0,0, buf.Texture); // Free framebuffer buf.Free; // Update OpenGLControl.SwapBuffers; end;
Hierarchy
- TObject
- TBGLCustomFrameBuffer
- TBGLFrameBuffer
Overview
Fields
![]() |
FFrameBufferId: GLuint; |
![]() |
FHeight: integer; |
![]() |
FMatrix: TAffineMatrix; |
![]() |
FProjectionMatrix: TMatrix4D; |
![]() |
FRenderBufferId: GLuint; |
![]() |
FSettingMatrices: boolean; |
![]() |
FTexture: IBGLTexture; |
![]() |
FWidth: integer; |
Methods
![]() |
constructor Create(AWidth,AHeight: integer); |
![]() |
destructor Destroy; override; |
![]() |
function MakeTextureAndFree: IBGLTexture; override; |
![]() |
function GetHandle: pointer; override; |
![]() |
function GetHeight: integer; override; |
![]() |
function GetMatrix: TAffineMatrix; override; |
![]() |
function GetProjectionMatrix: TMatrix4D; override; |
![]() |
function GetTexture: IBGLTexture; override; |
![]() |
function GetWidth: integer; override; |
![]() |
procedure SetMatrix(AValue: TAffineMatrix); override; |
![]() |
procedure SetProjectionMatrix(AValue: TMatrix4D); override; |
Description
Fields
![]() |
FFrameBufferId: GLuint; |
This item has no description. |
![]() |
FHeight: integer; |
This item has no description. |
![]() |
FMatrix: TAffineMatrix; |
This item has no description. |
![]() |
FProjectionMatrix: TMatrix4D; |
This item has no description. |
![]() |
FRenderBufferId: GLuint; |
This item has no description. |
![]() |
FSettingMatrices: boolean; |
This item has no description. |
![]() |
FTexture: IBGLTexture; |
This item has no description. |
![]() |
FWidth: integer; |
This item has no description. |
Methods
![]() |
constructor Create(AWidth,AHeight: integer); |
This item has no description. |
![]() |
destructor Destroy; override; |
This item has no description. |
![]() |
function MakeTextureAndFree: IBGLTexture; override; |
This item has no description. |
![]() |
function GetHandle: pointer; override; |
This item has no description. |
![]() |
function GetHeight: integer; override; |
This item has no description. |
![]() |
function GetMatrix: TAffineMatrix; override; |
This item has no description. |
![]() |
function GetProjectionMatrix: TMatrix4D; override; |
This item has no description. |
![]() |
function GetTexture: IBGLTexture; override; |
This item has no description. |
![]() |
function GetWidth: integer; override; |
This item has no description. |
![]() |
procedure SetMatrix(AValue: TAffineMatrix); override; |
This item has no description. |
![]() |
procedure SetProjectionMatrix(AValue: TMatrix4D); override; |
This item has no description. |