home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the 3D Game Programming Gurus / gurus.iso / Articles / XtremeDebugging / monlist4.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1997-04-19  |  1.9 KB  |  82 lines

  1.  
  2. // INCLUDES /////////////////////////////////////////////////////////////////
  3.  
  4. #define WIN32_LEAN_AND_MEAN  // make sure certain headers are included correctly
  5. #include <windows.h>         // include the standard windows stuff
  6. #include <windowsx.h>        // include the 32 bit stuff
  7. #include <conio.h>
  8. #include <stdlib.h>
  9. #include <malloc.h>
  10. #include <string.h>
  11. #include <stdio.h>
  12. #include <math.h> 
  13. #include <io.h>
  14. #include "mono.h"
  15.  
  16. // MAIN //////////////////////////////////////////////////////////////////////////
  17.  
  18. void main(void)
  19. {
  20. mono_print debug;    // create an instance of a debugger port
  21.  
  22. int x,y;            // used to get the cursor position
  23. char buffer[80];    // used to build up strings
  24.  
  25. // clear the debugging display
  26. debug.clear();
  27.  
  28. // demo of simple methods
  29.  
  30. // demo of draw
  31. debug.draw("This is the draw method",0,0,MONO_BRIGHT);
  32. Sleep(2000);
  33.  
  34. // demo of set_cursor
  35. debug.set_cursor(10,10);
  36. debug.print("Using the print method after setting the cursor position to 10,10");
  37. Sleep(2000);
  38.  
  39. // demo of set_style
  40. debug.set_style(MONO_DARK);
  41. debug.print("\nUsing the print method again with a differnt style");
  42. Sleep(2000);
  43.  
  44. // demo of get_cursor
  45. debug.get_cursor(x,y);
  46. sprintf(buffer,"\nCursor at (%d,%d)",x,y);
  47. debug.print(buffer);
  48. Sleep(2000);
  49.  
  50. // demo of disable method
  51. debug.disable();
  52. debug.print("\nYou can't see this.");
  53. Sleep(2000);
  54.  
  55. // demo of enable method
  56. debug.enable();
  57. debug.print("\n");
  58. debug.print("\n");
  59. debug.print("\nNow you can see me, but not for long...\n");
  60. Sleep(2000);
  61.  
  62. // demo of set_style
  63. debug.set_style(MONO_BRIGHT);
  64. debug.print("\nJust changed style to bright!");
  65. Sleep(2000);
  66.  
  67. // demo of clear
  68. debug.clear();
  69. Sleep(2000);
  70.  
  71. // demo of scrolling
  72. while(!kbhit())
  73.     {
  74.     debug.print("hit any key to exit          ");
  75.     Sleep(50);
  76.     } // end while
  77.  
  78. // demo of clear
  79. debug.clear();
  80.  
  81. } // end main
  82.