Changeset 472 for GraphicTest/UDrawMethod.pas
- Timestamp:
- Apr 9, 2015, 9:58:36 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GraphicTest/UDrawMethod.pas
r471 r472 21 21 FControl: TControl; 22 22 FFPS: Real; 23 FParent: TWinControl; 23 24 public 24 25 Caption: string; … … 39 40 procedure DrawFrame(FastBitmap: TFastBitmap); virtual; 40 41 procedure DrawFrameTiming(FastBitmap: TFastBitmap); 42 procedure UpdateSettings; virtual; 41 43 property Control: TControl read FControl; 42 44 end; … … 48 50 TDrawMethodImage = class(TDrawMethod) 49 51 Image: TImage; 52 procedure UpdateSettings; override; 50 53 procedure Init(Parent: TWinControl; Size: TPoint; PixelFormat: TPixelFormat); override; 51 54 procedure Done; override; … … 57 60 PaintBox: TPaintBox; 58 61 procedure Paint(Sender: TObject); virtual; 62 procedure UpdateSettings; override; 59 63 procedure Init(Parent: TWinControl; Size: TPoint; PixelFormat: TPixelFormat); override; 60 64 procedure Done; override; … … 69 73 TextureId: GLuint; 70 74 OpenGLBitmap: Pointer; 75 procedure UpdateSettings; override; 71 76 procedure InitGL; 72 77 procedure OpenGLControlResize(Sender: TObject); … … 86 91 begin 87 92 93 end; 94 95 procedure TDrawMethodPaintBox.UpdateSettings; 96 begin 97 inherited UpdateSettings; 98 PaintBox.ControlStyle := FParent.ControlStyle; 88 99 end; 89 100 … … 96 107 PaintBox.OnPaint := Paint; 97 108 PaintBox.Show; 109 UpdateSettings; 98 110 end; 99 111 … … 105 117 106 118 { TDrawMethodImage } 119 120 procedure TDrawMethodImage.UpdateSettings; 121 begin 122 inherited; 123 Image.ControlStyle := FParent.ControlStyle; 124 end; 107 125 108 126 procedure TDrawMethodImage.Init(Parent: TWinControl; Size: TPoint; PixelFormat: TPixelFormat); … … 115 133 Image.Picture.Bitmap.SetSize(Size.X, Size.Y); 116 134 Image.Show; 135 UpdateSettings; 117 136 end; 118 137 … … 141 160 end; 142 161 GetMem(OpenGLBitmap, OpenGLControl.Width * OpenGLControl.Height * SizeOf(Integer)); 162 UpdateSettings; 143 163 end; 144 164 … … 153 173 begin 154 174 glViewport(0, 0, OpenGLControl.Width, OpenGLControl.Height); 175 end; 176 177 procedure TDrawMethodOpenGL.UpdateSettings; 178 begin 179 inherited UpdateSettings; 180 OpenGLControl.ControlStyle := FParent.ControlStyle; 155 181 end; 156 182 … … 195 221 procedure TDrawMethod.Init(Parent: TWinControl; Size: TPoint; PixelFormat: TPixelFormat); 196 222 begin 223 FParent := Parent; 197 224 end; 198 225 … … 227 254 end; 228 255 256 procedure TDrawMethod.UpdateSettings; 257 begin 258 end; 259 229 260 end. 230 261
Note:
See TracChangeset
for help on using the changeset viewer.