Nachdem in diesem Thread von der Spiele-, bzw. Grafikprogrammierung die Rede war, und dabei auch Andorra genannt wurde, dachte ich mir, ich geb der Lib ne Chance. Also, Quellen geholt und erst mal versucht, selber die DLL zu kompilieren. Das hat nach einigen anfänglichen Problemen nun auch funktioniert und ich bin stolzer "Besitzer" einer "AndorraLazOGL.dll". Wer meine Lazarusquellen (mit den passenden Projekteinstellungen), oder die DLL haben möchte, soll mich doch bitte kontaktieren.
So, nun aber wieder zu meiner Frage. So wie es aussieht, habe ich alles, um die ersten Beispiele der Homepage zu probieren.
Also habe ich ein neues Projekt erstellt, der Code in Unit "main" sieht so aus:
Code: Alles auswählen
unit main;
{$MODE DELPHI}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs,
AdDraws, AdClasses, AdTypes;
type
{ TForm1 }
TForm1 = class(TForm)
procedure FormDestroy(Sender: TObject);
procedure FormCreate();
procedure Idle(Sender: TObject; var Done:boolean);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
procedure TForm1.FormCreate(Sender: TObject);
begin
AdDraw := TAdDraw.Create(self);
AdDraw.DllName := 'AndorraLazOGL.dll';
Application.OnIdle := @Idle;
AdDraw.Initialize;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
AdDraw.Free;
end;
procedure TForm1.Idle(Sender: TObject; var Done:boolean);
begin
AdDraw.ClearSurface(0);
AdDraw.BeginScene;
with AdDraw.Canvas do
begin
Font := AdDraw.Fonts.GenerateFont('Arial', 24, []);
TextOut(0,0,'Andorra 2D...');
Font := AdDraw.Fonts.GenerateFont('Arial', 10, []);
TextOut(0,30,'...works with Lazarus too');
end;
AdDraw.EndScene;
AdDraw.Flip;
end;
initialization
{$I main.lrs}
end.
Wenn ich das ganze jetzt kompilieren möchte, erhalte ich allerdings folgende Fehlermeldung:
Im Prinzip ist mir sehr wohl klar, was der Compiler von mir will, ich weiß nur nicht wie ich es ihm geben kann.Hint: Start of reading config file c:\lazarus\fpc\2.2.0\bin\i386-win32\fpc.cfg
Hint: End of reading config file c:\lazarus\fpc\2.2.0\bin\i386-win32\fpc.cfg
Warning: You are using the obsolete switch -OG
Free Pascal Compiler version 2.2.0 [2007/11/14] for i386
Copyright (c) 1993-2007 by Florian Klaempfl
Target OS: Win32 for i386
Compiling adtest.lpr
Compiling main.pas
Compiling D:\_CODING\_FPC\_SETUP\Andorra\ad2d_30_STABLE_all\src\AdDraws.pas
Compiling D:\_CODING\_FPC\_SETUP\Andorra\ad2d_30_STABLE_all\src\AdCanvas.pas
Compiling D:\_CODING\_FPC\_SETUP\Andorra\ad2d_30_STABLE_all\src\AdFont.pas
D:\_CODING\_FPC\_SETUP\Andorra\ad2d_30_STABLE_all\src\AdFont.pas(389,64) Error: Incompatible type for arg no. 3: Got "Double", expected "LongInt"
D:\_CODING\_FPC\_SETUP\Andorra\ad2d_30_STABLE_all\src\AdTypes.pas(198,10) Hint: Found declaration: AdRect(LongInt, LongInt, LongInt, LongInt):
D:\_CODING\_FPC\_SETUP\Andorra\ad2d_30_STABLE_all\src\AdFont.pas(393,47) Error: Incompatible type for arg no. 3: Got "Double", expected "LongInt"
D:\_CODING\_FPC\_SETUP\Andorra\ad2d_30_STABLE_all\src\AdTypes.pas(198,10) Hint: Found declaration: AdRect(LongInt, LongInt, LongInt, LongInt):
D:\_CODING\_FPC\_SETUP\Andorra\ad2d_30_STABLE_all\src\AdFont.pas(397,60) Error: Incompatible type for arg no. 3: Got "Double", expected "LongInt"
D:\_CODING\_FPC\_SETUP\Andorra\ad2d_30_STABLE_all\src\AdTypes.pas(198,10) Hint: Found declaration: AdRect(LongInt, LongInt, LongInt, LongInt):
D:\_CODING\_FPC\_SETUP\Andorra\ad2d_30_STABLE_all\src\AdFont.pas(418,36) Hint: use DIV instead to get an integer result
D:\_CODING\_FPC\_SETUP\Andorra\ad2d_30_STABLE_all\src\AdFont.pas(425,37) Hint: use DIV instead to get an integer result
D:\_CODING\_FPC\_SETUP\Andorra\ad2d_30_STABLE_all\src\AdFont.pas(433,35) Hint: use DIV instead to get an integer result
D:\_CODING\_FPC\_SETUP\Andorra\ad2d_30_STABLE_all\src\AdFont.pas(440,38) Hint: use DIV instead to get an integer result
D:\_CODING\_FPC\_SETUP\Andorra\ad2d_30_STABLE_all\src\AdFont.pas(553,59) Hint: use DIV instead to get an integer result
D:\_CODING\_FPC\_SETUP\Andorra\ad2d_30_STABLE_all\src\AdFont.pas(553,81) Hint: use DIV instead to get an integer result
D:\_CODING\_FPC\_SETUP\Andorra\ad2d_30_STABLE_all\src\AdFont.pas(554,60) Hint: use DIV instead to get an integer result
D:\_CODING\_FPC\_SETUP\Andorra\ad2d_30_STABLE_all\src\AdFont.pas(554,82) Hint: use DIV instead to get an integer result
D:\_CODING\_FPC\_SETUP\Andorra\ad2d_30_STABLE_all\src\AdFont.pas(555,59) Hint: use DIV instead to get an integer result
D:\_CODING\_FPC\_SETUP\Andorra\ad2d_30_STABLE_all\src\AdFont.pas(555,84) Hint: use DIV instead to get an integer result
D:\_CODING\_FPC\_SETUP\Andorra\ad2d_30_STABLE_all\src\AdFont.pas(556,60) Hint: use DIV instead to get an integer result
D:\_CODING\_FPC\_SETUP\Andorra\ad2d_30_STABLE_all\src\AdFont.pas(556,85) Hint: use DIV instead to get an integer result
D:\_CODING\_FPC\_SETUP\Andorra\ad2d_30_STABLE_all\src\AdFont.pas(659,51) Hint: Local variable "ATextSet" does not seem to be initialized
D:\_CODING\_FPC\_SETUP\Andorra\ad2d_30_STABLE_all\src\AdFont.pas(685) Fatal: There were 3 errors compiling module, stopping
Ausserdem verstehe ich nicht ganz, wie bei einem Demo-Code so was sein kann. Immerhin tritt der Fehler ja nicht in meinem Code auf, sondern in AdFont.pas, einer Unit aus der Andorra-Lib.
Ich wäre sehr dankbar, wenn mir jemand auf die Sprünge helfen könnte. Danke.