/* Atari Computing GEM Tutorial: Opening A Window Demo */ /* By Mark Wherry, using Lattice C5 */ #include #include int ap_id; /* The Application Identifier */ int whandle; /* The Window Handle */ int wx,wy,ww,wh; /* The Window Coordinates */ short gx,gy,gw,gh; /* Reserved - Will be used in the next part */ char *title; short vhandle; /* The Physical (VDI) Handle */ short junk; /* A 'null' identifier */ short work_in[11]={1,1,1,1,1,1,1,1,1,1,2}; short work_out[57]; /* Define the identifiers used by the VDI */ int main(void) { ap_id=appl_init(); /* Initialise the AES */ vhandle=graf_handle(&junk,&junk,&junk,&junk); /* Initialise the VDI */ v_opnvwk(work_in,&vhandle,work_out); wx=20; /* Set the window's position and size */ wy=20; ww=100; wh=100; title="Test Window"; /* Set the title */ whandle=wind_create(NAME|CLOSE|MOVE,wx,wy,ww,wh); /* Create a window */ wind_set(whandle,WF_NAME,ADDR(title),0,0); /* Set the title */ wind_open(whandle,wx,wy,ww,wh); /* Open the window */ /* Here is some more code not mentioned in the article. */ /* There are explanations, but don't worry if you don't */ /* understand them, we'll be covering them next issue. */ evnt_keybd(); /* Wait for a key to be pressed */ wind_close(whandle); /* Close the window (ON SCREEN) */ wind_delete(whandle); /* Delete the window from memory */ appl_exit(); /* This tells the AES that we've finished */ /* using it, and should always be called */ /* before you terminate your application */ return 0; }