Changeset 7 for trunk/Platform
- Timestamp:
- May 9, 2015, 12:00:33 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Platform/Base/UPlatformBase.pas
r6 r7 57 57 end; 58 58 59 { TBaseVideoDevice } 60 61 TBaseVideoDevice = class(TDevice) 62 private 63 FOnRedraw: TNotifyEvent; 64 public 65 VideoMemory: PByte; 66 VideoMemorySize: TPoint; 67 DPI: Integer; 68 constructor Create; override; 69 destructor Destroy; override; 70 procedure Service(Index: Integer; DataIn, DataOut: TMemory); override; 71 property OnRedraw: TNotifyEvent read FOnRedraw write FOnRedraw; 72 end; 73 59 74 implementation 75 76 { TBaseVideoDevice } 77 78 constructor TBaseVideoDevice.Create; 79 begin 80 inherited Create; 81 end; 82 83 destructor TBaseVideoDevice.Destroy; 84 begin 85 inherited Destroy; 86 end; 87 88 procedure TBaseVideoDevice.Service(Index: Integer; DataIn, DataOut: TMemory); 89 begin 90 if Index = 0 then begin 91 // Redraw to screen 92 if Assigned(FOnRedraw) then 93 FOnRedraw(Self); 94 end else 95 if Index = 1 then begin 96 // Get video memory 97 VideoMemory := GetMem(VideoMemorySize.X * VideoMemorySize.Y * 4); 98 // DataOut^ := VideoMemory; 99 // DataOut^ := VideoMemory; 100 end else inherited; 101 end; 60 102 61 103 { TBaseSerialDevice } … … 76 118 procedure TBaseSerialDevice.Service(Index: Integer; DataIn, DataOut: TMemory); 77 119 begin 78 inherited Service(Index, DataIn, DataOut);79 120 if Index = 0 then begin 80 121 Lock.Acquire; … … 82 123 FOnReceiveData(DataIn); 83 124 Lock.Release; 84 end else raise Exception.Create('Unsupported service ' + IntToStr(Index) + ' for driver ''' + Name + '''');125 end else inherited; 85 126 end; 86 127
Note:
See TracChangeset
for help on using the changeset viewer.