| Home
| Previous
| Next
| Up

### Enumerating Installed Devices and Loading a Driver

Before you can use the SciTech SNAP Graphics Architecture library, you must first enumerate all the devices in the system and load a device driver for the selected device that you wish to control. Enumerating the devices in the system is done using the GA_enumerateDevices function. This function returns a count of the number of display devices installed in the system. Then you call GA_loadDriver to load and initialize a valid device driver for the device you wish to control. The primary display device is always device index 0, and the first secondary controller is device index 1, the next is device index 2 and so on. When you are finished you must then call GA_unloadDriver to unload the device driver from memory. If you only need to support the primary display controller, you can skip the call to GA_enumerateDevices and simply call GA_loadDriver with a device index of 0. For example:

void main(void)
{
GA_devCtx *dc;
if ((dc = GA_loadDriver(0)) == NULL)
PM_fatalError(“Unable to load graphics driver!”);
... do some stuff with the driver
GA_unloadDriver(dc);
}

Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com