opengl: revert accidental changes to the example

git-svn-id: trunk@61061 -
This commit is contained in:
dmitry 2019-04-26 13:28:43 +00:00
parent e653d0cc68
commit dc8600b0f2
3 changed files with 10 additions and 52 deletions

View File

@ -1,22 +1,10 @@
object Form1: TForm1 object Form1: TForm1
Left = 302 Left = 419
Height = 300 Height = 300
Top = 181 Top = 287
Width = 400 Width = 400
HorzScrollBar.Page = 399 HorzScrollBar.Page = 399
VertScrollBar.Page = 299 VertScrollBar.Page = 299
Caption = 'Form1' Caption = 'Form1'
ClientHeight = 300
ClientWidth = 400
OnCreate = FormCreate OnCreate = FormCreate
LCLVersion = '2.1.0.0'
object Panel1: TPanel
Left = 97
Height = 50
Top = 49
Width = 170
Caption = 'Panel1'
TabOrder = 0
OnMouseMove = Panel1MouseMove
end
end end

View File

@ -15,32 +15,25 @@ interface
uses uses
Classes, SysUtils, LCLProc, LResources, Forms, Controls, Graphics, Dialogs, Classes, SysUtils, LCLProc, LResources, Forms, Controls, Graphics, Dialogs,
ExtCtrls, OpenGLContext, GL, GLU, CocoaInt OpenGLContext, GL, GLU;
,CocoaWSCommon, CocoaPrivate;
type type
{ TForm1 } { TForm1 }
TForm1 = class(TForm) TForm1 = class(TForm)
Panel1: TPanel;
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure OpenGLControl1Paint(Sender: TObject); procedure OpenGLControl1Paint(Sender: TObject);
procedure OpenGLControl1Resize(Sender: TObject); procedure OpenGLControl1Resize(Sender: TObject);
procedure OnAppIdle(Sender: TObject; var Done: Boolean); procedure OnAppIdle(Sender: TObject; var Done: Boolean);
procedure Panel1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer
);
private private
public public
cube_rotationx: GLFloat; cube_rotationx: GLFloat;
cube_rotationy: GLFloat; cube_rotationy: GLFloat;
cube_rotationz: GLFloat; cube_rotationz: GLFloat;
OpenGLControl1: TOpenGLControl; OpenGLControl1: TOpenGLControl;
procedure OpenGLMouseMove(Sender: TObject; Shift: TShiftState;
X, Y: Integer);
end; end;
var var
Form1: TForm1; Form1: TForm1;
@ -59,24 +52,16 @@ begin
Parent:=Self; Parent:=Self;
OnPaint:=@OpenGLControl1Paint; OnPaint:=@OpenGLControl1Paint;
OnResize:=@OpenGLControl1Resize; OnResize:=@OpenGLControl1Resize;
OnMouseMove:=@OpenGLMouseMove;
AutoResizeViewport:=true; AutoResizeViewport:=true;
end; end;
Application.AddOnIdleHandler(@OnAppIdle); Application.AddOnIdleHandler(@OnAppIdle);
end; end;
procedure TForm1.OpenGLMouseMove(Sender: TObject; Shift: TShiftState;
X, Y: Integer);
begin
Caption:=Format('%d %d',[x,y]);
end;
procedure TForm1.OpenGLControl1Paint(Sender: TObject); procedure TForm1.OpenGLControl1Paint(Sender: TObject);
var var
Speed: Double; Speed: Double;
begin begin
writeln('paint');
glClearColor(1.0, 1.0, 1.0, 1.0); glClearColor(1.0, 1.0, 1.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);
glEnable(GL_DEPTH_TEST); glEnable(GL_DEPTH_TEST);
@ -154,15 +139,8 @@ procedure TForm1.OnAppIdle(Sender: TObject; var Done: Boolean);
begin begin
Done:=false; Done:=false;
//DebugLn(['TForm1.OnAppIdle ']); //DebugLn(['TForm1.OnAppIdle ']);
//OpenGLControl1.Paint;
OpenGLControl1.Invalidate; OpenGLControl1.Invalidate;
end; end;
procedure TForm1.Panel1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
Caption:=Format('panel: %d %d',[x,y]);
end;
end. end.

View File

@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<CONFIG> <CONFIG>
<ProjectOptions> <ProjectOptions>
<Version Value="12"/> <Version Value="9"/>
<PathDelim Value="\"/> <PathDelim Value="\"/>
<General> <General>
<Flags> <Flags>
<LRSInOutputDirectory Value="False"/> <LRSInOutputDirectory Value="False"/>
<CompatibilityMode Value="True"/>
</Flags> </Flags>
<SessionStorage Value="InProjectDir"/> <SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<ResourceType Value="res"/> <ResourceType Value="res"/>
</General> </General>
<BuildModes Count="1"> <BuildModes Count="1">
@ -16,19 +16,15 @@
</BuildModes> </BuildModes>
<PublishOptions> <PublishOptions>
<Version Value="2"/> <Version Value="2"/>
<IgnoreBinaries Value="False"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions> </PublishOptions>
<RunParams> <RunParams>
<local> <local>
<LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T &apos;Lazarus Run Output&apos; -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/> <FormatVersion Value="1"/>
<LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
</local> </local>
<FormatVersion Value="2"/>
<Modes Count="1">
<Mode0 Name="default">
<local>
<LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T &apos;Lazarus Run Output&apos; -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
</local>
</Mode0>
</Modes>
</RunParams> </RunParams>
<RequiredPackages Count="2"> <RequiredPackages Count="2">
<Item1> <Item1>
@ -48,7 +44,6 @@
<Filename Value="mainunit.pas"/> <Filename Value="mainunit.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<ComponentName Value="Form1"/> <ComponentName Value="Form1"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<UnitName Value="MainUnit"/> <UnitName Value="MainUnit"/>
</Unit1> </Unit1>
@ -62,9 +57,6 @@
</SyntaxOptions> </SyntaxOptions>
</Parsing> </Parsing>
<Linking> <Linking>
<Debugging>
<DebugInfoType Value="dsDwarf2"/>
</Debugging>
<Options> <Options>
<Win32> <Win32>
<GraphicApplication Value="True"/> <GraphicApplication Value="True"/>