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.

86 lines
2.5 KiB

  1. #ifndef PROFILETEST_H
  2. #define PROFILETEST_H
  3. // without windows.h, gl/gl.h causes errors.
  4. // without gl/gl.h, test.h causes errors.
  5. // technically, you should have both of these includes in your .c file...
  6. #include <windows.h>
  7. #include <commctrl.h>
  8. #include <gl/gl.h>
  9. #include "buffers.h"
  10. #define MAXNAMELENGTH 32
  11. #define MAXSTATLENGTH 32
  12. #define MAXABOUTLENGTH 128
  13. #define MAXTYPELENGTH 32
  14. #define TOTALVERLENGTH 256
  15. typedef struct {
  16. char acDummy1[16];
  17. // General stuff
  18. int iX,iY,iH,iW; // window position and size
  19. BOOL swapbuffers; // Double buffered?
  20. char acName[MAXNAMELENGTH]; // name of test
  21. char acAbout[MAXABOUTLENGTH]; // a discription of the test
  22. char acTestStatName[MAXSTATLENGTH]; // statistic to be tested
  23. int iDuration; // duration (ms) of test
  24. double dResult;
  25. char acDummy2[16];
  26. } TESTDATA;
  27. #define CNFGFUNCTION() cnfgfunct(HWND hwndParent)
  28. #define INITFUNCTION() initfunct(GLsizei w, GLsizei h)
  29. #define IDLEFUNCTION() idlefunct(void)
  30. #define RENDFUNCTION() rendfunct(void)
  31. #define DESTFUNCTION() destfunct(void)
  32. class SkeletonTest {
  33. public:
  34. SkeletonTest();
  35. ~SkeletonTest(void) {};
  36. virtual BOOL CNFGFUNCTION(); // if an error occurred FALSE else TRUE
  37. virtual void INITFUNCTION() {}; // called once, when creating window
  38. virtual void IDLEFUNCTION() {}; // the idle function
  39. virtual void RENDFUNCTION() {}; // the rendering function (WM_PAINT)
  40. virtual void DESTFUNCTION() {}; // called once, when destroying window
  41. virtual void ReadExtraData(char *) {};
  42. void SetThisType(const char *szType);
  43. void SetThisVersion(const char *szVer);
  44. void AddPropertyPages(int, PROPSHEETPAGE*);
  45. void Rename(char *szNew) { sprintf(td.acName,"%s",szNew); };
  46. // I want to get ride of these functions soon, as the should be redundant
  47. virtual void SaveData();
  48. virtual void RestoreSaved();
  49. virtual void ForgetSaved();
  50. virtual int Save(HANDLE hFile);
  51. virtual int Load(HANDLE hFile);
  52. const char *QueryName() { return td.acName; };
  53. const char *QueryType() { return szTypeName; };
  54. const char *QueryVersion() { return szVersion; };
  55. TESTDATA td;
  56. protected:
  57. BUFFERDATA bd;
  58. friend void SetDCPixelFormat(HDC hDC);
  59. private:
  60. char szTypeName[MAXTYPELENGTH];
  61. char szVersion[TOTALVERLENGTH];
  62. PROPSHEETPAGE *aPSpages;
  63. int iNumConfigPages;
  64. };
  65. #endif // PROFILETEST_H