Programming with the VDI

Graphics is a major part of many modern programs, and as all Falcon users will be aware, compatibility with the multitude of resolutions is a must for the modern application. This compatibility is provided by the Virtual Device Interface ( or VDI).

This documents some of the functions that the VDI offers, and enables the programmer to use graphics without loosing compatibility. I am by no means an expert at GEM/VDI programming, so don't take this document as gospel - its only what I have been able to find out from various tutorials etc. If something is wrong - email me.

I have used the syntax from C to give examples of code, but it is equally applicable to any language that supports GEM...

Getting Started...

The first thing that you must do is register with both the AES and the VDI, so that they can allocate you handles etc. To do this, use:

appl_init();
handle=graf_handle(&dummy,&dummy,&dummy,&dummy);
for (i = 0; i < 10; i++) work_in[i] = 1;
work_in[7] = 0;
work_in[10] = 2;
v_opnvwk(work_in, &handle, work_out);

This will initialise GEM, ready for use, and then get the VDI handle. A virtual workstation is then opened, so that you can use VDI functions on the screen. handle is the handle of your virtual workstation, which will be needed in all other functions.

Graphics functions...

There are numerous functions which draw various graphical primatives. These are :

Text functions...

As well as the graphical functions, there are also many text functions. These include the ability to draw text, and allow the use of (Speedo) GDOS.

Attributes...

The effects of many of the functions detailed above can be changed. This is done by changing various attributes, as detailed below:

Finishing off...

Thats almost it... just before you exit the program, however, you must call:

v_clsvwk();
appl_exit();


Back to the programmers page

Back to the Atari Pages...

Anthony Jacques : jacquesa@zetnet.co.uk