Changeset 17 for trunk/Packages
- Timestamp:
- Jan 21, 2018, 10:01:14 PM (7 years ago)
- Location:
- trunk/Packages/Kernel
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Kernel/UDevice.pas
r13 r17 24 24 function GetBytesPerLine: Integer; 25 25 function GetBytesPerImage: Integer; 26 procedure Assign(Source: TVideoMode); 26 27 end; 27 28 … … 29 30 30 31 TDeviceVideo = class(TDevice) 32 private 33 FVideoMode: TVideoMode; 34 protected 35 procedure SetVideoMode(Mode: TVideoMode); virtual; 36 function GetVideoMemory: PByte; virtual; 37 public 31 38 constructor Create; override; 32 procedure SetMode(Mode: TVideoMode); virtual;33 39 procedure GetSupportedModes(Modes: TObjectList); virtual; 34 function GetVideoMemory: PByte; virtual;35 40 procedure VideoMemoryChange; virtual; 41 property VideoMode: TVideoMode read FVideoMode write SetVideoMode; 42 property VideoMemory: PByte read GetVideoMemory; 36 43 end; 37 44 … … 64 71 end; 65 72 73 procedure TVideoMode.Assign(Source: TVideoMode); 74 begin 75 Size := Source.Size; 76 ColorFormat := ColorFormat; 77 end; 78 66 79 { TDeviceSerial } 67 80 … … 90 103 inherited Create; 91 104 ClassName := 'Video device'; 105 FVideoMode := TVideoMode.Create; 92 106 end; 93 107 94 procedure TDeviceVideo.Set Mode(Mode: TVideoMode);108 procedure TDeviceVideo.SetVideoMode(Mode: TVideoMode); 95 109 begin 96 110 end; -
trunk/Packages/Kernel/UKernel.pas
r15 r17 74 74 if Assigned(VideoDevice) then begin 75 75 NewScreen := TScreen.Create; 76 NewScreen.VideoMemory := nil;77 76 Modes := TObjectList.Create; 78 77 VideoDevice.GetSupportedModes(Modes); 79 78 if Modes.Count > 0 then begin 80 79 VideoMode := TVideoMode(Modes.Last); 81 VideoDevice. SetMode(VideoMode);80 VideoDevice.VideoMode := VideoMode; 82 81 NewScreen.Size := VideoMode.Size; 83 82 NewScreen.ColorFormat := VideoMode.ColorFormat; 84 NewScreen.VideoMemory := VideoDevice.GetVideoMemory;85 NewScreen.BytesPerPixel := VideoMode.GetBytesPerPixel;86 NewScreen.BytesPerLine := VideoMode.GetBytesPerLine;87 83 NewScreen.Device := VideoDevice; 88 84 NewScreen.Canvas := TScreenCanvas.Create; -
trunk/Packages/Kernel/UScreen.pas
r16 r17 25 25 26 26 TScreen = class 27 private 28 function GetBytesPerLine: Integer; 29 function GetBytesPerPixel: Integer; 30 function GetVideoMemory: PByte; 31 public 27 32 Device: TObject; // TDeviceVideo; 28 33 Size: TPoint; 29 34 DPI: Integer; 30 35 ColorFormat: TColorFormat; 31 BytesPerPixel: Integer;32 BytesPerLine: Integer;33 VideoMemory: PByte;34 36 Canvas: TCanvas; 35 37 procedure VideoMemoryUpdated; 38 property BytesPerPixel: Integer read GetBytesPerPixel; 39 property BytesPerLine: Integer read GetBytesPerLine; 40 property VideoMemory: PByte read GetVideoMemory; 36 41 end; 37 42 … … 99 104 { TScreen } 100 105 106 function TScreen.GetBytesPerLine: Integer; 107 begin 108 Result := TDeviceVideo(Device).VideoMode.GetBytesPerLine; 109 end; 110 111 function TScreen.GetBytesPerPixel: Integer; 112 begin 113 Result := TDeviceVideo(Device).VideoMode.GetBytesPerPixel; 114 end; 115 116 function TScreen.GetVideoMemory: PByte; 117 begin 118 Result := TDeviceVideo(Device).VideoMemory; 119 end; 120 101 121 procedure TScreen.VideoMemoryUpdated; 102 122 begin
Note:
See TracChangeset
for help on using the changeset viewer.