The Fenix VDI (document v1.00beta, 971111)


Goals

Design

All accesses to the VDI are made in the current process' context. This means that the VDI must be fully reentrant and that semaphore type locking must be used for shared resources.
Applications as well as internal routines should be able to send a bunch of drawing commands as one block. The main benefit appears when accelerated hardware which buffers commands are used. Internally this would for example be used when blitting text.
Any VDI function, at any level, should be exchangeable for a direct one in a specific device driver.
The VDI is used to emulate LineA calls.
Input/output as well as synchronization between different VDI workstations is handled by a separate server that is common for both the VDI and the AES.

Calling

The standard C bindings for VDI calls make much more sense than the way those actually take place (filling an array with the parameters and a function number to use). Non-Fenix-aware programs will, however, use the old method which must therefore still be supported.
For calls where it can provide a noticeable performance increase, the library should have native support for both methods, but otherwise it will suffice to convert to the new format.
If the new format is used, multiple commands can be sent at once by providing pointers to properly setup 'stack frames', kept on a linked list. The suggested new calling convention is described in the 'implementation thoughts' section below.

Device drivers

The VDI is built up of a number of layers which can, but are not required to, rely on lower level ones. There are also some things that stand completely outside they layered structure, such as set/query, workstation control, printer/meta-file control, input and vector redirection.
For new hardware its enough to write the 'primitive' routines below.
All more complex routines can be built from these.
The 'acceleration' layer should always have a native implementation.
Without this layer things will be very slow, but they'll still work.
The operations here are often accelerated by graphics hardware.

Development schedule

Step one

The things here are needed before anything useful at all can be done. For some software, this might actually be enough for normal operation. Unless otherwise noted (due to existing code), this step is monochrome only. That includes plane-skipping mono, though.
Given that quite a bit of code already exists, it should be possible to finish this during November.

Step two

When this step is completed, it should be possible to use graphics cards to some degree.

Implement the things from step one for 16 bit true colour modes.
Quite a bit o code should exist here already as well.

Step three

This is supposed to make the VDI really useful for most purposes.
Most of this is relatively straightforward, but since it's not as 'interesting' as step one, I don't think we can count on it being finished before the end of January.

Implement the rest of the workstation stuff, including off screen bitmaps.
Make everything work in all graphics modes (bitplane, and chunky 8/24/32).
Implement remaining (non-complex) query/set.
Make all drawing modes operational. [done-]
Implement standard<->device format transformation.
Implement the most important text effects.
Implement box outline and hollow fill.
Add support for markers.
Add the screen escape stuff.
Add the vector redirection stuff.

Step four

When this step is completed, all standard VDI screen output should work!
I won't hazard a guess as to when that might happen, though.

Add patterns for fills and lines. [done-]
Implement the remaining text effects.
Implement line width and styles.
Implement the remaining graphics primitives (circles etc).
Implement polygon fill.
Implement the remaining input stuff.
Implement the printer and meta file stuff.

Step five

Perhaps this can be done in parallel. I have no idea about how long it might take, though.

Add outline font support.
Add whatever else is new in NVDI.

New ideas

These are not given in any specific order.

Implementation thoughts

Just a collection of random thoughts.