GNU Info

Info Node: (aalib.info)Easy initialization of AA-lib

(aalib.info)Easy initialization of AA-lib


Next: Parsing of command line options Prev: Initialization as a normal graphics library Up: Initialization as a normal graphics library
Enter node , (file) or (file)node

Easy initialization of AA-lib
-----------------------------

   Following example is the most trivial way to initialize AA-lib.

     #include <stdio.h>
     #include <aalib.h>
     aa_context *context;
     void main(void)
     {
       aa_parseoptions (NULL, NULL, NULL, NULL);
     
           /* Every AA-lib program ought to call the aa_perseoptions at least
              in this way to make the AAOPTS environment variable work.  */
     
       context = aa_autoinit(&aa_defparams);
       if(context == NULL) {
         fprintf(stderr,"Cannot initialize AA-lib. Sorry\n");
         exit(1);
       }
       ...
       aa_close(context);
     }

   This code will do all autodetection/initialization stuff for you and
it will fire up AA-lib (using default parameters). Because AA-lib
supports output driver using ordinarry stdio functions, the failure is
very unlikely, but you ought to check it.


automatically generated by info2www version 1.2.2.9