In the Delphix, what can be seen is generally painted in Tdxdraw.
Tdxdraw default Two drawing surfaces: Tdxdraw.surface and tdxdraw.primary;
Generally first in the background (Surface) drawing, and then use the tdxdraw.flip command switch before and after the table, so as to see the rendering effect.
Tdxdraw.flip will replace Surface and Primary two objects, so we can only draw on the Surface;
Because of the working mechanism of DirectX, let this switch speed unusually fast (just switch a pointer), thus can complete the very fluent animation, the game.
The Canvas object can also be obtained from the drawing surface of the Tdxdraw, so gdi/gdi+ drawing commands can also be used in Tdxdraw;
But using gdi/gdi+ with DirectX should make DirectX's performance shrink, but this is always good, at least better than using gdi/gdi+ alone.
The DXDraw1.Surface.Canvas object is used in the following example;
After the use of DXDraw1.Surface.Canvas, must be released (DXDraw1.Surface.Canvas.Release);
In addition, often before drawing to fill the surface with the specified color, such as: DXDraw1.Surface.Fill (color value);
The color format here is different from that of Delphi, and the order of color values used in HTML is the same, for example: $FF 0000 indicates red.
This example effect chart: