mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-31 08:00:24 +02:00
TAChart: Fix missing initialization of glut library in opengl demo.
git-svn-id: trunk@52347 -
This commit is contained in:
parent
cc9413a516
commit
86d8a267aa
@ -6,6 +6,7 @@ object Form1: TForm1
|
||||
Caption = 'Form1'
|
||||
ClientHeight = 319
|
||||
ClientWidth = 688
|
||||
OnCreate = FormCreate
|
||||
LCLVersion = '1.7'
|
||||
object OpenGLControl1: TOpenGLControl
|
||||
Left = 344
|
||||
|
@ -20,6 +20,7 @@ type
|
||||
OpenGLControl1: TOpenGLControl;
|
||||
RandomChartSource1: TRandomChartSource;
|
||||
procedure Chart1AfterPaint(ASender: TChart);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure OpenGLControl1Paint(Sender: TObject);
|
||||
end;
|
||||
|
||||
@ -31,13 +32,27 @@ implementation
|
||||
{$R *.lfm}
|
||||
|
||||
uses
|
||||
TADrawUtils, TADrawerOpenGL, TADrawerCanvas;
|
||||
glut, TADrawUtils, TADrawerOpenGL in '../../tadraweropengl.pas', TADrawerCanvas;
|
||||
|
||||
procedure TForm1.Chart1AfterPaint(ASender: TChart);
|
||||
begin
|
||||
OpenGLControl1.Invalidate;
|
||||
end;
|
||||
|
||||
{ Initialization of glut library, needed for text output }
|
||||
procedure TForm1.FormCreate(Sender: TObject);
|
||||
var
|
||||
CmdCount : Integer;
|
||||
Cmd : Array of Pchar;
|
||||
I: Integer;
|
||||
begin
|
||||
CmdCount := Paramcount+1;
|
||||
SetLength(Cmd,CmdCount);
|
||||
for I := 0 to CmdCount - 1 do
|
||||
Cmd[I] := PChar(ParamStr(I));
|
||||
glutInit (@CmdCount,@Cmd);
|
||||
end;
|
||||
|
||||
procedure TForm1.OpenGLControl1Paint(Sender: TObject);
|
||||
var
|
||||
d: IChartDrawer;
|
||||
|
Loading…
Reference in New Issue
Block a user