- unit Unit1;
- {$mode Delphi}{$H+}
- interface
- uses
- Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
- LCLType, LCLIntf, dglOpenGL;
- type
- { TForm1 }
- TForm1 = class(TForm)
- procedure FormCreate(Sender: TObject);
- private
- { private declarations }
- public
- { public declarations }
- end;
- var
- Form1: TForm1;
- DC: HDC;
- RC: HDC;
- implementation
- { TForm1 }
- procedure TForm1.FormCreate(Sender: TObject);
- begin
- DC := GetDC(Handle);
- if not InitOpenGL then Application.Terminate;
- RC := CreateRenderingContext(DC,[opDoubleBuffered],32,24,0,0,0,0);
- ActivateRenderingContext(DC, RC);
- end;
- initialization
- {$I unit1.lrs}
- end.