home *** CD-ROM | disk | FTP | other *** search
/ Millennium Time Capsule / AC2000.BIN / disks / ac16disk / articles / features / prog_gem / gem1.c next >
Encoding:
C/C++ Source or Header  |  1998-04-30  |  1.8 KB  |  51 lines

  1. /* Atari Computing GEM Tutorial: Opening A Window Demo */
  2. /* By Mark Wherry, using Lattice C5                    */
  3.  
  4. #include <aes.h>
  5. #include <vdi.h>
  6.  
  7. int ap_id;                  /* The Application Identifier */
  8.  
  9. int whandle;                /* The Window Handle */
  10. int wx,wy,ww,wh;            /* The Window Coordinates */
  11. short gx,gy,gw,gh;          /* Reserved - Will be used in the next part */
  12. char *title;
  13.  
  14. short vhandle;              /* The Physical (VDI) Handle */
  15. short junk;                 /* A 'null' identifier */
  16. short work_in[11]={1,1,1,1,1,1,1,1,1,1,2};     
  17. short work_out[57];         /* Define the identifiers used by the VDI */
  18.  
  19. int main(void)
  20. {
  21.   ap_id=appl_init();        /* Initialise the AES */ 
  22.   
  23.   vhandle=graf_handle(&junk,&junk,&junk,&junk);   /* Initialise the VDI */
  24.   v_opnvwk(work_in,&vhandle,work_out);
  25.   
  26.   wx=20;                    /* Set the window's position and size */
  27.   wy=20;
  28.   ww=100;
  29.   wh=100;
  30.   title="Test Window";      /* Set the title */
  31.   
  32.   whandle=wind_create(NAME|CLOSE|MOVE,wx,wy,ww,wh); /* Create a window */
  33.   wind_set(whandle,WF_NAME,ADDR(title),0,0);        /* Set the title */
  34.   wind_open(whandle,wx,wy,ww,wh);                   /* Open the window */ 
  35.   
  36.   /* Here is some more code not mentioned in the article. */
  37.   /* There are explanations, but don't worry if you don't */
  38.   /*  understand them, we'll be covering them next issue. */
  39.   
  40.   evnt_keybd();             /* Wait for a key to be pressed */
  41.   
  42.   wind_close(whandle);      /* Close the window (ON SCREEN) */
  43.   
  44.   wind_delete(whandle);     /* Delete the window from memory */
  45.   
  46.   appl_exit();              /* This tells the AES that we've finished */
  47.                             /* using it, and should always be called */
  48.                             /* before you terminate your application */
  49.                               
  50.   return 0;