home *** CD-ROM | disk | FTP | other *** search
- // Example: 147 from Library Reference
- #include "..\3D-Ware\dddware.h"
- #include <stdio.h>
- char far default_mouse_sprite[] = { 0x01,0x03,0x00,0x02,0x06,0x0F,0x0F,0x0F,0x0C,0x00,0x00,0x0F,0x0F,0x0C,0x00,
- 0x00,0x00,0x0F,0x00,0x0F,0x0C,0x00,0x00,0x00,0x00,0x00,0x0F,0x0C,0x00 };
- char far *amouse_sprite=default_mouse_sprite;
- short myXpos, myYpos, myButtons;
- short left = 80, right = 242, top = 50, bottom = 150;
- char string[80];
- short main(void)
- {
- dddSelectEmmAmount(300); // Request 300k of EMM.
- dddInitAll();
- dddReadPcx("EXAMPLE.PCX");
- dddCopyLogbase2ScreenBuffer();
- dddSetSpriteClip(left, right, top, bottom); // Set up the clipping region.
- while (!dddkeycode)
- {
- dddCopyScreenBuffer2Logbase();
- dddMouseGetPointerXy(&myXpos,&myYpos,&myButtons);
- sprintf(string,"MOUSE X POS IS :- %d",myXpos);
- dddPrint6(1,0,0,string);
- sprintf(string,"MOUSE Y POS IS :- %d",myYpos);
- dddPrint6(1,0,10,string);
- dddDrawLine(1,left, top, right, top);
- dddDrawLine(1,right, top, right, bottom);
- dddDrawLine(1,left, bottom, right, bottom);
- dddDrawLine(1,left, top, left, bottom);
- dddMaskSprite(amouse_sprite,0,myXpos,myYpos); // Display the clipped sprite.
- dddScreenSwap();
- }
- dddRestoreAll();
- return 0; // Bye.
- }
-