DirectX WorkBench Design-Time Editor

DirectX WorkBench takes a completely revolutionary and innovative approach. It adds a rich, structured, DirectX development tool called a WorkBench into the Delphi IDE. This takes the form of an Explorer-style editor window, shown on the left. Instead of using plain old non-visual components, a WorkBench uses no-icon components and a hierarchical tree view to place and manage your application. You can select individual components into the component editor by selecting them in the tree view or list view, which enables multiple selections.

DirectX components placed under other components in the tree view are automatically parented by them and thus linked up. For example, in the graphic on the left you can see that the DirectDraw object at the root of the tree parents all the components under it. The first child is PrimarySurface1. It parents an implicit back buffer, ImplicitBuffer1. The relationship between the back buffer and the primary surface is thus displayed visually at design-time. This is a radical new approach to building complex Delphi networks of connected and inter-related components!

You may also note that the WorkBench contains folders. These are essentially just like the folders you have in Windows Explorer. They are containers used to keep your design neat and tidy. As you can see, the demo app uses several countdown timers and these have been put inside the CountDown Timers folder. You can create any number of folders, and you can have folders within folders to an arbitrary depth.

Creating a new WorkBench object is easy: just select the parent object in the tree view and right click. You then get a context-sensitive menu that allows you to add a new component. The WorkBench knows which components can be added to which, so right clicking on the primary surface and selecting the New sub-menu will give you the option of adding a back buffer. Right-clicking on a bitmap will give you the option to add a new grid object, which is used to subdivide a bitmap image up into animation cells.

The DirectX WorkBench Editor is intimately connected to the Delphi IDE. When you select a component in the tree view, it is selected into the Object Inspector for editing. All you have on the form is a single TDirectDraw component. All the other components you see in the image above are contained inside the TDirectDraw component, just as TField objects are contained inside a TTable or TQuery, and TMenuItems are contained inside a TMenu. The only difference is that DirectX WorkBench is fully hierarchical, whereas the dataset and menu components can only be nested to a single level.

Thus DirectX WorkBench keeps everything together and under control, managing the complex relationships between the components for you. You can easily copy the single TDirectDraw component to the clipboard and paste it into another project

If you're using Delphi 3, you can create a component template that also brings any event handlers you've assigned, ready to be added to a new DirectX project with a single click.