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

  1.                                   // Example: 143 from Library Reference
  2. #include "..\3D-Ware\dddware.h"
  3. char    mouse_crosshair[] = {0x01,0x03,0x00,0x04,0x06,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,
  4.       0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,
  5.       0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,
  6.       0x00,0x00,0x00,0x00,0x00};
  7. char    my_mouse_buffer[128];
  8. void main(void)
  9. {
  10.   dddInitAll();
  11.   dddCls();
  12.   dddBox(2,10,10,310,190);
  13.   dddBox(3,20,20,300,180);
  14.   dddBox(4,30,30,290,170);
  15.   dddPrint7(11,55,97,"PRESS SPACE TO TOGGLE CURSORS.");
  16.   dddPrint7(11,60,105,"MOVE THE MOUSE AROUND.");
  17.   dddScreenSwap();
  18.   dddSetLogbase2CurrentDisplay();
  19.   while  (dddkeycode!=_ESC)
  20.   {
  21.     dddHideGraphicsMouse();
  22.     if (dddkeypressed[_SPACE])    // If "space" is pressed then change to the new cursor.
  23.     {
  24.                                   // New cursor crosshair.
  25.       dddSetMouseCursor(mouse_crosshair, my_mouse_buffer, 4,3,5,5,0,0);
  26.     }
  27.     else                          // Otherwise use normal cursor.
  28.     {
  29.       dddSetDefaultMouseCursor(); // Standard mouse cursor.
  30.     }
  31.     dddReadMousePosition();       // Read any changes to the mouse position.
  32.     dddDrawGraphicsMouse();       // Draw the mouse at (mouse_x,mouse_y).
  33.     dddVsync();                   // Wait for Vertical sync so things don't get messy.
  34.   }
  35.   dddRestoreAll();                // Restore previous video mode
  36. }
  37.