Shutting Down
After an application has completed using Glide and the Voodoo Graphics subsystem, proper shutdown must be performed. This allows Glide to de-allocate system resources like memory, timers, address space, and file handles that were used during program execution.

The function grGlideShutdown() shuts down Glide and all Voodoo Graphics subsystems previously opened with grSstWinOpen(). It should be called only when an application is finished using Glide, and should not be executed unless grGlideInit() and grSstWinOpen() have already been called.

void grGlideShutdown( void )
Example 3.3 shows a minimal Glide program: it executes the four function calls that initialize the Voodoo Graphics subsystem and then terminates.

Example 3.3 A minimal Glide program.
The complete program below includes the Glide initialization and termination procedure and nothing else.
#include < glide.h >

GrHwConfiguration hw;

void main(void)
{
    grGlideInit(void);

    if (! grSstQueryHardware(&hw))
        printf(“ERROR: no Voodoo Graphics!\n”);

    grSstSelect(0);
    grSstWinOpen( Null,
      GR_RESOLUTION_640x480,
      GR_REFRESH_60HZ,
      GR_COLORFORMAT_RGBA
      GR_ORIGIN_LOWER_LEFT,
      2, 0);
    grGlideShutdown();
}

Chapter 3                                                                                                           The Display Buffer