type TOpenGL = class(TObject)
Name | Description |
---|---|
ColorBits | Desired colour depth. Copied from Rendering_Info. |
FrameCount | Count of all frames rendered since init. Used to calculatea frame-rate later. |
fWidth | Width & height of window/control which is rendered to. (GlFloat) |
h_DC | The appropiate device context. |
h_RC | OpenGL rendering context. |
h_WND | Handle of window/control which will be rendered into. Copied from Rendering_Info. |
LastTickCount | tick-count of last rendered frame |
Rendering_Info | Storage for TOpenGL_Info record, which is passed with the create procedure. |
TexSize | Specifies the maximum allowed size for the textures. Copied from Rendering_Info. |
TextureIndex | Contains the references to all textures used by the renderer. References are generated in one of the three CreateTexturesFrom* procedures. |
Width | Width & height of window/control which is rendered to. (Integer) |
constructor Create( const OGL_Info : TOpenGL_Info ); |
Constructor
destructor Destroy; override; |
Destructor
procedure CreateRenderingContext; |
Initialise the OpenGL rendering context.
procedure CreateTextureFrom256Bitmap( Bitmap : TBitmap; RGBAQuads : array of TRGBAQuad; Index : Gluint ); |
Create a texture from a 256 color, palettized TBitmap. Palette must be passed as an array of TRGBAQuad
procedure CreateTextureFromFile( Filename : string; Index : GLuint ); |
Create a texture from a bitmap file. Bitmap is loaded and passed to CreateTextureFromTBitmap as a parameter.
procedure CreateTextureFromTBitmap( Bitmap : TBitmap; Index : GLuint ); |
Create a texture from a TBitmap (any color depth). Procedure is currently very slow due to the use of TCanvas.Pixels.
procedure Free; |
Standard .Free procedure.
procedure InitGL; |
Set up a few parameters for OpenGL, including viewport frustrum and dimensions.
procedure KillGL; |
Destroy and free rendering context.
procedure Render( DeltaTime : longint ); virtual; abstract; |
Abstract procedure to render the scene data. Must be overwritten by every decendant of TOpenGL.
procedure RePaint; |
RePaint is called to update DeltaTime (in ms) and calls Render to render the scene.
procedure ResizeGL( NWidth, NHeight : integer ); |
Handles resizing of viewport.
None.