home *** CD-ROM | disk | FTP | other *** search
/ Virtual Reality Madness / VRMAD96_ONE.ISO / virtek / libex / libex147.c < prev    next >
C/C++ Source or Header  |  1995-08-24  |  1KB  |  35 lines

  1.                                                  // Example: 147 from Library Reference
  2. #include "..\3D-Ware\dddware.h"
  3. #include    <stdio.h>
  4. char   far default_mouse_sprite[] = { 0x01,0x03,0x00,0x02,0x06,0x0F,0x0F,0x0F,0x0C,0x00,0x00,0x0F,0x0F,0x0C,0x00,
  5.                                       0x00,0x00,0x0F,0x00,0x0F,0x0C,0x00,0x00,0x00,0x00,0x00,0x0F,0x0C,0x00 };
  6. char   far *amouse_sprite=default_mouse_sprite;
  7. short  myXpos, myYpos, myButtons;
  8. short  left = 80, right = 242, top = 50, bottom = 150;
  9. char   string[80];
  10. short  main(void)
  11. {
  12.   dddSelectEmmAmount(300);                       // Request 300k of EMM.
  13.   dddInitAll();
  14.   dddReadPcx("EXAMPLE.PCX");
  15.   dddCopyLogbase2ScreenBuffer();
  16.   dddSetSpriteClip(left, right, top, bottom);    // Set up the clipping region.
  17.   while  (!dddkeycode)
  18.   {
  19.     dddCopyScreenBuffer2Logbase();
  20.     dddMouseGetPointerXy(&myXpos,&myYpos,&myButtons);
  21.     sprintf(string,"MOUSE X POS IS :- %d",myXpos);
  22.     dddPrint6(1,0,0,string);
  23.     sprintf(string,"MOUSE Y POS IS :- %d",myYpos);
  24.     dddPrint6(1,0,10,string);
  25.     dddDrawLine(1,left, top, right, top);
  26.     dddDrawLine(1,right, top, right, bottom);
  27.     dddDrawLine(1,left, bottom, right, bottom);
  28.     dddDrawLine(1,left, top, left, bottom);
  29.     dddMaskSprite(amouse_sprite,0,myXpos,myYpos); // Display the clipped sprite.
  30.     dddScreenSwap();
  31.   }
  32.   dddRestoreAll();
  33.   return 0;                                      // Bye.
  34. }
  35.