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.

66 lines
1.4 KiB

  1. #include <glos.h>
  2. #ifdef NT
  3. #include "glstring.h"
  4. #endif
  5. #ifndef NT
  6. static const char *errors[] = {
  7. "missing gluTessBeginPolygon",
  8. "missing gluTessBeginContour",
  9. "missing gluTessEndPolygon",
  10. "missing gluTessEndContour",
  11. "tesselation coordinate too large",
  12. "need combine callback"
  13. };
  14. #else
  15. static UINT auiTessErrors[] = {
  16. STR_TESS_BEGIN_POLY , // "missing gluTessBeginPolygon",
  17. STR_TESS_BEGIN_CONTOUR , // "missing gluTessBeginContour",
  18. STR_TESS_END_POLY , // "missing gluTessEndPolygon",
  19. STR_TESS_END_CONTOUR , // "missing gluTessEndContour",
  20. STR_TESS_COORD_TOO_LARGE , // "tesselation coordinate too large",
  21. STR_TESS_NEED_COMBINE_CALLBACK // "need combine callback"
  22. };
  23. #define NERRORS ( sizeof(auiTessErrors)/sizeof(auiTessErrors[0]) )
  24. static char *errors[NERRORS];
  25. static WCHAR *errorsW[NERRORS];
  26. #endif
  27. const char *__glTessErrorString(int errno)
  28. {
  29. return (const char *) errors[errno];
  30. }
  31. #ifdef NT
  32. const WCHAR *__glTessErrorStringW(int errno)
  33. {
  34. return (const WCHAR *) errorsW[errno];
  35. }
  36. VOID vInitTessStrings(HINSTANCE hMod, BOOL bAnsi)
  37. {
  38. int i;
  39. if (bAnsi)
  40. {
  41. for (i = 0; i < NERRORS; i++)
  42. errors[i] = pszGetResourceStringA(hMod, auiTessErrors[i]);
  43. }
  44. else
  45. {
  46. for (i = 0; i < NERRORS; i++)
  47. errorsW[i] = pwszGetResourceStringW(hMod, auiTessErrors[i]);
  48. }
  49. }
  50. #endif /* NT */