home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Graphics / Graphics.zip / graph2.zip / testGr1.cpp < prev    next >
Text File  |  1996-09-25  |  819b  |  47 lines

  1. #include <stdio.h>
  2. #include "graph2.h"
  3.  
  4. void Func()
  5. {
  6. __GrInit(1);
  7. __GrSetPalEntry(0x01,000,0,255);
  8. __GrSetPalEntry(0x02,255,0,255);
  9. __GrSetColor(1);
  10. for (int y=0;y<480;y+=5) {
  11.    __GrLine(0,y,639,y);
  12. }
  13. for (int x=0;x<640;x+=5) {
  14.    __GrLine(x,0,x,479);
  15. } /* endfor */
  16.  
  17. __GrSetColor(2);
  18. __GrRectl(0,0,639,479);
  19. __GrRectl(2,2,637,477);
  20. __GrSetColor(1);
  21. __GrRectl(1,1,638,478);
  22. __GrSetColor(2);
  23. fgetc(stdin);
  24. for (int y=0;y<256;y++) {
  25.       __GrSetColor(y);
  26.       __GrLine(0,y,639,y);
  27. }
  28. // fgetc(stdin);
  29. __GrSetColor(0x01);
  30. __GrCircle(200,200,100);
  31. __GrRectl(80,80,400,400);
  32. __GrSetColor(0xff/2);
  33. __GrFillRectl(600,0,639,479);
  34. fgetc(stdin);
  35. for (unsigned x=0;x<__GrPtr->colors;x++) {
  36.    __GrSetPalEntry(x,x,x,x);
  37. }
  38. __GrTerm();
  39. }
  40.  
  41. int main()
  42. {
  43. Func();
  44. // Func();
  45. return 0;
  46. }
  47.