Changeset 17 for trunk/Platform/Base


Ignore:
Timestamp:
Jan 21, 2018, 10:01:14 PM (7 years ago)
Author:
chronos
Message:
  • Added: Resize virtual screen according form size.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Platform/Base/UPlatformBase.pas

    r14 r17  
    6464    FOnRedraw: TNotifyEvent;
    6565    procedure DoRedraw;
     66  protected
     67    procedure SetVideoMode(Mode: TVideoMode); override;
    6668  public
    6769    VideoMemory: PByte;
    68     VideoMemorySize: TPoint;
    6970    DPI: Integer;
    7071    Canvas: TCanvas;
    71     VideoMode: TVideoMode;
    72     procedure SetMode(Mode: TVideoMode); override;
    7372    procedure GetSupportedModes(Modes: TObjectList); override;
    7473    function GetVideoMemory: PByte; override;
     
    8988end;
    9089
    91 procedure TDeviceVideoBase.SetMode(Mode: TVideoMode);
     90procedure TDeviceVideoBase.SetVideoMode(Mode: TVideoMode);
    9291begin
    9392  if (VideoMode.Size.X <> Mode.Size.X) or
     
    9695      VideoMode.Size := Mode.Size;
    9796      VideoMode.ColorFormat := Mode.ColorFormat;
     97      ReAllocMem(VideoMemory, VideoMode.GetBytesPerImage);
     98      FillDWord(VideoMemory^, VideoMode.GetBytesPerImage div 4, $ffffff);
    9899      if Assigned(FOnModeChanged) then
    99100        FOnModeChanged(Self);
     
    135136function TDeviceVideoBase.GetVideoMemory: PByte;
    136137begin
    137   VideoMemory := GetMem(VideoMode.GetBytesPerImage);
    138   FillDWord(VideoMemory^, VideoMode.GetBytesPerImage div 4, $ffffff);
    139138  Result := VideoMemory;
    140139end;
     
    148147begin
    149148  inherited Create;
    150   VideoMode := TVideoMode.Create;
    151149end;
    152150
Note: See TracChangeset for help on using the changeset viewer.