Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
1.9 KiB

  1. #include <windows.h>
  2. #include <gl\gl.h>
  3. #include <stdio.h>
  4. #include "hugetest.h"
  5. #include "small2.h"
  6. SmallTriangle2::SmallTriangle2()
  7. {
  8. int xa, xb, ya, yb;
  9. int SIZE;
  10. td.swapbuffers = TRUE;
  11. td.iDuration = 10000;
  12. td.iX = 0;
  13. td.iY = 0;
  14. td.iW = 640;
  15. td.iH = 480;
  16. sprintf(td.acName, "Small Triangles 2");
  17. sprintf(td.acTestStatName, "Triangles");
  18. td.dResult = 0.0;
  19. bd.uiClear = GL_COLOR_BUFFER_BIT;
  20. bd.cColorBits = 8;
  21. bd.cDepthBits = 16;
  22. bd.fClearColor[0] = 0.0;
  23. bd.fClearColor[1] = 0.0;
  24. bd.fClearColor[2] = 1.0;
  25. bd.fClearColor[3] = 0.0;
  26. afDrawColor[0] = 0.0;
  27. afDrawColor[1] = 1.0;
  28. afDrawColor[2] = 0.0;
  29. range.fxMin = 0;
  30. range.fxMax = 640;
  31. range.fyMin = 0;
  32. range.fyMax = 480;
  33. SIZE = 4;
  34. aPntLst[3].AllocatePoints(3*(300/SIZE)*(200/SIZE));
  35. for(ya = 0, yb = SIZE ; yb <= range.fyMax ; ya += SIZE, yb += SIZE)
  36. for(xa = 0, xb = SIZE ; xb <= range.fxMax ; xa += SIZE, xb += SIZE) {
  37. // lower right half
  38. aPntLst[3].AddPoint((GLfloat) xa, (GLfloat) ya, 0);
  39. aPntLst[3].AddPoint((GLfloat) xb, (GLfloat) yb, 0);
  40. aPntLst[3].AddPoint((GLfloat) xb, (GLfloat) ya, 0);
  41. }
  42. td.dResult = (double) (aPntLst[3].QueryNumber() / 3);
  43. /*
  44. for(ya = 0, yb = SIZE ; yb <= range.fyMax ; ya += SIZE, yb += SIZE)
  45. for(xa = 0, xb = SIZE ; xb <= range.fyMin ; xa += SIZE, xb += SIZE) {
  46. // upper left half
  47. aPntLst[3].AddPoint((GLfloat) xa, (GLfloat) ya, 0);
  48. aPntLst[3].AddPoint((GLfloat) xa, (GLfloat) yb, 0);
  49. aPntLst[3].AddPoint((GLfloat) xb, (GLfloat) yb, 0);
  50. }
  51. */
  52. }
  53. void SmallTriangle2::IDLEFUNCTION()
  54. {
  55. static BOOL bFlip = TRUE;
  56. if ((bFlip = !bFlip)) {
  57. afDrawColor[0] = 0.0;
  58. afDrawColor[1] = 1.0;
  59. afDrawColor[2] = 0.0;
  60. } else {
  61. afDrawColor[0] = 1.0;
  62. afDrawColor[1] = 0.0;
  63. afDrawColor[2] = 0.0;
  64. }
  65. }