home *** CD-ROM | disk | FTP | other *** search
- // Example: 083 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 * far dddmouse_sprite=default_mouse_sprite;
- short myXpos;
- short myYpos;
- short myButtons;
- char string[80];
- short main(void)
- {
- dddInitAll();
- dddReadPcx("EXAMPLE.PCX"); // Load up a .PCX file to the logbase viewport.
- dddCopyLogbase2ScreenBuffer(); // Copy the data from logbase to a buffer area.
- while (!dddkeycode)
- {
- dddCopyScreenBuffer2Logbase(); // Copy the buffer to the logbase viewport.
- dddMouseGetPointerXy(&myXpos,&myYpos,&myButtons); // Read in the mouse position.
- 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);
- dddMaskSprite(dddmouse_sprite,0,myXpos,myYpos); // Display the sprite at the required position.
- dddScreenSwap();
- }
- dddRestoreAll();
- return 0; // Bye.
- }
-