Hi,
I have problems with the package for this library and the library itself as well.
I managed to compile and compile a few of the examples with the latest FPC SVN and Lazarus versions (under Windows Vista 64).
For that I redid the package from scratch, making all the units filenames lowercase. After that I tried to use the GR32 library inside a control using the same technique that customdraw controls use. And I can only get a black square with a simple button.
So I decided to split the library on smaller units getting rid of the HUGE GR32.pas. And I started getting circular unit errors between GRBitmap32 (one of my smaller units, split from GR32.pas) and GR32_Layers.pas. I managed to solve it reviewing all the uses clauses by trial and error.
And a snippet of the code:
//--------------------------------------------------------------------------------------------
unit GR32CustomBitmap32;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Graphics,
GR32CustomMap,
GR32BitmapTypes,
GR32BitmapFunct,
GR32_Lowlevel,
GR32Color,
GR32Rectangles,
GR32FixedTypes,
GR32CustomSampler,
GR32ThreadPersistent,
GR32_Blend;
interface
type
// TCustomMap is on it's own unit
TCustomBitmap32 = class(TCustomMap)
private
// Field declarations....
procedure BackendChangedHandler (Sender: TObject); virtual;
procedure BackendChangingHandler(Sender: TObject); virtual;
// more code...
end;
implementation
procedure TCustomBitmap32.BackendChangingHandler(Sender: TObject);
begin
// descendants can override this method.
end;
procedure TCustomBitmap32.BackendChangedHandler(Sender: TObject);
begin
FBits := FBackend.Bits;
ResetClipRect;
end;
end.
--------------------------------------------------------------------------------------------
unit GR32Bitmap32;
{$mode objfpc}{$H+}
interface
uses
LCLType, Types, Classes, SysUtils, Graphics,
GR32CustomBitmap32,
GR32Color;
type
TBitmap32 = class(TCustomBitmap32)
private
FOnHandleChanged: TNotifyEvent;
procedure BackendChangedHandler (Sender: TObject); override;
procedure BackendChangingHandler(Sender: TObject); override;
end;
implementation
uses
GR32_Backends;
procedure TBitmap32.BackendChangedHandler(Sender: TObject);
begin
inherited;
HandleChanged;
end;
procedure TBitmap32.FontChanged(Sender: TObject);
begin
// TODO: still required?
end;
end.
Now I'm getting this strange error:
C:\lazarus\components\graphics32Laz\source\gr32bitmap32.pas(66,15) Error: There is no method in an ancestor class to be overridden: "TBitmap32.BackendChangedHandler(TObject);"
Note that I'm using the objfpc mode and I tried to erase as much of the Delphi compatibility (defines even) for Delphi.
A friend of mine has even implemented a reviewed version of some of the SSE2 routines, but he submitted one to the original project and has been completely ignored.
We are thinking on fork this monster and make it 100% Lazarus compatible, completely avoiding the Delphi mode of the FPC compiler. I even have a second package mixing up GR32 and VPR in one package (Aliased support on GR32 + VPR for tex is the state of the art), but this mix-up is on hold due to the problems that I found on GR32 alone.
Is a pity, because this library made 100% Lazarus compatible and cross platform could be the base to substitute the non aliased and slow drawing methods of the LCL.
So any help will be appreciated fixing that error with the two virtual methods?
Thanks in advance
David