unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls,
BGLVirtualScreen, BGRAOpenGL, BGRABitmap, BGRABitmapTypes;
type
{ TForm1 }
TForm1 = class(TForm)
BGLVirtualScreen1: TBGLVirtualScreen;
Timer1: TTimer;
procedure BGLVirtualScreen1Redraw(Sender: TObject; BGLContext: TBGLContext);
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure reset;
private
GLFont: IBGLFont;
public
end;
var
Form1: TForm1;
x,y,i,j,g_timer,idx : integer; // general demo timer
tx: Array[0..12] Of String;
dest_y :Array[0..12] Of integer;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
begin
x:=20; y:=0; i :=0; j :=0;
tx[0] := '+*************************+';
tx[1] := '* GIGATRON *';
tx[2] := '* *';
tx[3] := '* PRESENTS TEXT FX#2 *';
tx[4] := '* *';
tx[5] := '* BGRA COMPONENT GL *';
tx[6] := '* *';
tx[7] := '* @@ LAZARUS FPC RULEZ @@ *';
tx[8] := '* *';
tx[9] := '****** ********* ******';
tx[10]:= '* AMIGA DIGITAL FONT *';
tx[11]:= '* BY DOUGHNUT *';
tx[12]:= '+*************************+';
for i:=0 to 12 do
begin
dest_y[i] := 800 ;
end;
end;
procedure TForm1.FormShow(Sender: TObject);
begin
GLFont := BGLFont('AmigaDigital8',40);
GLFont.SetStepX(-12);
end;
procedure TForm1.BGLVirtualScreen1Redraw(Sender: TObject;BGLContext: TBGLContext);
begin
for i:=0 to 1 do
begin
GLFont.TextOut(x, dest_y[0]+6 , tx[0],BGRA(68,85,102));
GLFont.TextOut(x, dest_y[0] , tx[0],BGRA(255,255,255));
dest_y[0] := dest_y[0] - 8 ;
if (dest_y[0]<0) then dest_y[0]:=0;
end;
if(g_timer>30) then
begin
for i:=0 to 1 do
begin
GLFont.TextOut(x, dest_y[1]+6 , tx[1],BGRA(68,85,102));
GLFont.TextOut(x, dest_y[1] , tx[1],BGRA(255,255,255));
dest_y[1] := dest_y[1] - 8 ;
if (dest_y[1]<32) then dest_y[1]:=32;
end;
end;
if(g_timer>60) then
begin
for i:=0 to 1 do
begin
GLFont.TextOut(x, dest_y[2]+6 , tx[2],BGRA(68,85,102));
GLFont.TextOut(x, dest_y[2] , tx[2],BGRA(255,255,255));
dest_y[2] := dest_y[2] - 8 ;
if (dest_y[2]<64) then dest_y[2]:=64;
end;
end;
if(g_timer>90) then
begin
for i:=0 to 1 do
begin
GLFont.TextOut(x, dest_y[3]+6 , tx[3],BGRA(68,85,102));
GLFont.TextOut(x, dest_y[3] , tx[3],BGRA(255,255,255));
dest_y[3] := dest_y[3] - 8 ;
if (dest_y[3]<96) then dest_y[3]:=96;
end;
end;
if(g_timer>120) then
begin
for i:=0 to 1 do
begin
GLFont.TextOut(x, dest_y[4]+6 , tx[4],BGRA(68,85,102));
GLFont.TextOut(x, dest_y[4] , tx[4],BGRA(255,255,255));
dest_y[4] := dest_y[4] - 8 ;
if (dest_y[4]<128) then dest_y[4]:=128;
end;
end;
if(g_timer>150) then
begin
for i:=0 to 1 do
begin
GLFont.TextOut(x, dest_y[5]+6 , tx[5],BGRA(68,85,102));
GLFont.TextOut(x, dest_y[5] , tx[5],BGRA(255,255,255));
dest_y[5] := dest_y[5] - 8 ;
if (dest_y[5]<160) then dest_y[5]:=160;
end;
end;
if(g_timer>180) then
begin
for i:=0 to 1 do
begin
GLFont.TextOut(x, dest_y[6]+6 , tx[6],BGRA(68,85,102));
GLFont.TextOut(x, dest_y[6] , tx[6],BGRA(255,255,255));
dest_y[6] := dest_y[6] - 8 ;
if (dest_y[6]<192) then dest_y[6]:=192;
end;
end;
if(g_timer>210) then
begin
for i:=0 to 1 do
begin
GLFont.TextOut(x, dest_y[7]+6 , tx[7],BGRA(68,85,102));
GLFont.TextOut(x, dest_y[7] , tx[7],BGRA(255,255,255));
dest_y[7] := dest_y[7] - 8 ;
if (dest_y[7]<224) then dest_y[7]:=224;
end;
end;
if(g_timer>240) then
begin
for i:=0 to 1 do
begin
GLFont.TextOut(x, dest_y[8]+6 , tx[8],BGRA(68,85,102));
GLFont.TextOut(x, dest_y[8] , tx[8],BGRA(255,255,255));
dest_y[8] := dest_y[8] - 8 ;
if (dest_y[8]<256) then dest_y[8]:=256;
end;
end;
if(g_timer>270) then
begin
for i:=0 to 1 do
begin
GLFont.TextOut(x, dest_y[9]+6 , tx[9],BGRA(68,85,102));
GLFont.TextOut(x, dest_y[9] , tx[9],BGRA(255,255,255));
dest_y[9] := dest_y[9] - 8 ;
if (dest_y[9]<288) then dest_y[9]:=288;
end;
end;
if(g_timer>300) then
begin
for i:=0 to 1 do
begin
GLFont.TextOut(x, dest_y[10]+6 , tx[10],BGRA(68,85,102));
GLFont.TextOut(x, dest_y[10] , tx[10],BGRA(255,255,255));
dest_y[10] := dest_y[10] - 8 ;
if (dest_y[10]<320) then dest_y[10]:=320;
end;
end;
if(g_timer>330) then
begin
for i:=0 to 1 do
begin
GLFont.TextOut(x, dest_y[11]+6 , tx[11],BGRA(68,85,102));
GLFont.TextOut(x, dest_y[11] , tx[11],BGRA(255,255,255));
dest_y[11] := dest_y[11] - 8 ;
if (dest_y[11]<352) then dest_y[11]:=352;
end;
end;
if(g_timer>360) then
begin
for i:=0 to 1 do
begin
GLFont.TextOut(x, dest_y[12]+6 , tx[12],BGRA(68,85,102));
GLFont.TextOut(x, dest_y[12] , tx[12],BGRA(255,255,255));
dest_y[12] := dest_y[12] - 8 ;
if (dest_y[12]<384) then dest_y[12]:=384;
end;
end;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
BGLVirtualScreen1.Repaint;
inc(g_timer,1);
if(g_timer>600) then
begin
g_timer :=0;
BGLVirtualScreen1.Invalidate;
reset;
end;
end;
procedure TForm1.reset();
var
i :integer;
begin
i:=0;
for i:=0 to 12 do
begin
dest_y[i] := 800 ;
end;
end;
end.