mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-07 12:44:00 +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'
|
Caption = 'Form1'
|
||||||
ClientHeight = 319
|
ClientHeight = 319
|
||||||
ClientWidth = 688
|
ClientWidth = 688
|
||||||
|
OnCreate = FormCreate
|
||||||
LCLVersion = '1.7'
|
LCLVersion = '1.7'
|
||||||
object OpenGLControl1: TOpenGLControl
|
object OpenGLControl1: TOpenGLControl
|
||||||
Left = 344
|
Left = 344
|
||||||
|
@ -20,6 +20,7 @@ type
|
|||||||
OpenGLControl1: TOpenGLControl;
|
OpenGLControl1: TOpenGLControl;
|
||||||
RandomChartSource1: TRandomChartSource;
|
RandomChartSource1: TRandomChartSource;
|
||||||
procedure Chart1AfterPaint(ASender: TChart);
|
procedure Chart1AfterPaint(ASender: TChart);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure OpenGLControl1Paint(Sender: TObject);
|
procedure OpenGLControl1Paint(Sender: TObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -31,13 +32,27 @@ implementation
|
|||||||
{$R *.lfm}
|
{$R *.lfm}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
TADrawUtils, TADrawerOpenGL, TADrawerCanvas;
|
glut, TADrawUtils, TADrawerOpenGL in '../../tadraweropengl.pas', TADrawerCanvas;
|
||||||
|
|
||||||
procedure TForm1.Chart1AfterPaint(ASender: TChart);
|
procedure TForm1.Chart1AfterPaint(ASender: TChart);
|
||||||
begin
|
begin
|
||||||
OpenGLControl1.Invalidate;
|
OpenGLControl1.Invalidate;
|
||||||
end;
|
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);
|
procedure TForm1.OpenGLControl1Paint(Sender: TObject);
|
||||||
var
|
var
|
||||||
d: IChartDrawer;
|
d: IChartDrawer;
|
||||||
|
Loading…
Reference in New Issue
Block a user