home *** CD-ROM | disk | FTP | other *** search
-
- #include <proto/games.h>
- #include <proto/exec.h>
-
- #define AMT_PLANES 1
-
- struct GMSBase *GMSBase;
- extern struct ExecBase *SysBase;
-
- UWORD Palette[] =
- {
- 0x0000,0x08ff
- };
-
- struct GameScreen *GameScreen;
-
- /*=========================================================================*/
-
- void main(void)
- {
- ULONG mousestat;
- int sx,sy,ex,ey;
-
- sx = 50;
- sy = 50;
- ex = 200;
- ey = 100;
-
- if (GMSBase = (struct GMSBase *) OpenLibrary("games.library",0))
- {
- SetUserPrefs(0);
- if (AllocBlitter() == NULL)
- {
- if (GameScreen = AddScreenTags(TAGS,NULL,
- GSA_Planes,AMT_PLANES,
- GSA_Palette,Palette,
- GSA_ScrMode,HIRES|COL12BIT,
- GSA_ScrWidth,640,
- GSA_ScrHeight,256,
- TAGEND)) {
-
- ShowScreen(GameScreen);
-
- do
- {
- ClrScreen(GameScreen,BUFFER1);
-
- mousestat = ReadMouse(JPORT1);
- if (mousestat & MB_LMB) {
- sx += GetX(mousestat);
- sy += GetY(mousestat);
- }
- else {
- ex += GetX(mousestat);
- ey += GetY(mousestat);
- }
- DrawLine(GameScreen,BUFFER1,sx,sy,ex,ey,1);
- WaitSVBL();
- } while (!(mousestat & MB_RMB));
-
- DeleteScreen(GameScreen);
- }
- FreeBlitter();
- }
- CloseLibrary((struct Library *)GMSBase);
- }
- }
-
- /*=========================================================================*/
-
-