Changeset 471


Ignore:
Timestamp:
Apr 9, 2015, 8:55:27 PM (9 years ago)
Author:
chronos
Message:
  • Modified: Initialization of array of draw method classes done in run.
Location:
GraphicTest
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • GraphicTest/GraphicTest.lpr

    r470 r471  
    1010  Forms, lazopenglcontext, UMainForm, UPlatform, UDrawMethod, UFastBitmap,
    1111  UDrawForm, bgrabitmappack,
    12   {$IFDEF WINDOWS}GR32_L,{$ENDIF}
     12  {$IFDEF GRAPHICS32}GR32_L,{$ENDIF}
    1313  UCanvasPixels, UCanvasPixelsUpdateLock,
    1414  ULazIntfImageColorsCopy, ULazIntfImageColorsNoCopy, UBGRABitmapPaintBox,
  • GraphicTest/Methods/UGraphics32Method.pas

    r470 r471  
    77uses
    88  Classes, SysUtils, UFastBitmap, UDrawMethod,
    9   {$IFDEF WINDOWS}GR32, GR32_Image,{$ENDIF}
     9  {$IFDEF GRAPHICS32}GR32, GR32_Image,{$ENDIF}
    1010  Controls, Graphics;
    1111
    12 {$IFDEF WINDOWS}
     12{$IFDEF GRAPHICS32}
    1313type
    1414  { TGraphics32Method }
     
    2626implementation
    2727
    28 {$IFDEF WINDOWS}
     28{$IFDEF GRAPHICS32}
    2929{ TGraphics32Method }
    3030
  • GraphicTest/Methods/UOpenGLMethod.pas

    r459 r471  
    77uses
    88  Classes, SysUtils, UDrawMethod, UFastBitmap
    9   {$IFDEF opengl}, GL, GLExt, OpenGLContext{$ENDIF};
     9  {$IFDEF OPENGL}, GL, GLExt, OpenGLContext{$ENDIF};
    1010
    11 {$IFDEF opengl}
     11{$IFDEF OPENGL}
    1212type
    1313  { TOpenGLMethod }
     
    2323implementation
    2424
    25 {$IFDEF opengl}
     25{$IFDEF OPENGL}
    2626{ TOpenGLMethod }
    2727
  • GraphicTest/Methods/UOpenGLPBOMethod.pas

    r459 r471  
    77uses
    88  Classes, SysUtils, UDrawMethod, UFastBitmap, Controls, Graphics
    9   {$IFDEF opengl}, GL, GLExt, OpenGLContext{$ENDIF};
     9  {$IFDEF OPENGL}, GL, GLExt, OpenGLContext{$ENDIF};
    1010
    11 {$IFDEF opengl}
     11{$IFDEF OPENGL}
    1212type
    1313  { TOpenGLPBOMethod }
     
    2626implementation
    2727
    28 {$IFDEF opengl}
     28{$IFDEF OPENGL}
    2929{ TOpenGLPBOMethod }
    3030
  • GraphicTest/UDrawMethod.pas

    r459 r471  
    88  Classes, SysUtils, ExtCtrls, UPlatform, UFastBitmap, Graphics, Controls,
    99  LCLType, IntfGraphics, fpImage, GraphType, DateUtils,
    10   LclIntf{$IFDEF opengl}, GL, GLExt, OpenGLContext{$ENDIF};
     10  {$IFDEF OPENGL}GL, GLExt, OpenGLContext,{$ENDIF}
     11  LclIntf;
    1112
    1213type
     
    6061  end;
    6162
    62   {$IFDEF opengl}
     63  {$IFDEF OPENGL}
    6364
    6465  { TDrawMethodOpenGL }
     
    123124
    124125
    125 {$IFDEF opengl}
     126{$IFDEF OPENGL}
    126127
    127128{ TDrawMethodOpenGL }
  • GraphicTest/UMainForm.pas

    r470 r471  
    9191    TestTerminated: Boolean;
    9292    TestTimeout: Real;
     93    DrawMethodClasses: array of TDrawMethodClass;
    9394    procedure GenerateSceneFrames;
    9495    procedure TestMethod(Method: TDrawMethod);
     
    9697    procedure UpdateInterface;
    9798    procedure UpdateFrameSize;
     99    procedure RegisterDrawMethods;
     100    procedure RegisterDrawMethod(MethodClass: TDrawMethodClass);
    98101  public
    99102    FrameSize: TPoint;
     
    117120  UOpenGLPBOMethod, UGraphics32Method;
    118121
    119 const
    120   DrawMethodClasses: array[0..8{$IFDEF opengl}+2{$ENDIF}{$IFDEF gr32}+1{$ENDIF}] of TDrawMethodClass = (
    121     TCanvasPixels, TCanvasPixelsUpdateLock, TLazIntfImageColorsCopy,
    122     TLazIntfImageColorsNoCopy, TBitmapRawImageData, TBitmapRawImageDataPaintBox,
    123     TBitmapRawImageDataMove, TBGRABitmapPaintBox
    124     {$IFDEF gr32}, TGraphics32Method{$ENDIF}
    125     {$IFDEF opengl}, TOpenGLMethod, TOpenGLPBOMethod{$ENDIF}
    126     ,TDummyMethod);
    127 
    128 
    129 
    130122{ TMainForm }
    131123
     
    141133  Randomize;
    142134
     135  RegisterDrawMethods;
    143136  DrawMethods := TObjectList.Create;
    144137  for I := 0 to High(DrawMethodClasses) do begin
     
    400393end;
    401394
     395procedure TMainForm.RegisterDrawMethods;
     396begin
     397  RegisterDrawMethod(TCanvasPixels);
     398  RegisterDrawMethod(TCanvasPixelsUpdateLock);
     399  RegisterDrawMethod(TLazIntfImageColorsCopy);
     400  RegisterDrawMethod(TLazIntfImageColorsNoCopy);
     401  RegisterDrawMethod(TBitmapRawImageData);
     402  RegisterDrawMethod(TBitmapRawImageDataPaintBox);
     403  RegisterDrawMethod(TBitmapRawImageDataMove);
     404  RegisterDrawMethod(TBGRABitmapPaintBox);
     405  {$IFDEF GRAPHICS32}
     406  RegisterDrawMethod(TGraphics32Method);
     407  {$ENDIF}
     408  {$IFDEF OPENGL}
     409  RegisterDrawMethod(TOpenGLMethod);
     410  RegisterDrawMethod(TOpenGLPBOMethod);
     411  {$ENDIF}
     412  RegisterDrawMethod(TDummyMethod);
     413end;
     414
     415procedure TMainForm.RegisterDrawMethod(MethodClass: TDrawMethodClass);
     416begin
     417  SetLength(DrawMethodClasses, Length(DrawMethodClasses) + 1);
     418  DrawMethodClasses[High(DrawMethodClasses)] := MethodClass;
     419end;
     420
    402421end.
    403422
Note: See TracChangeset for help on using the changeset viewer.