Leaked source code of windows server 2003
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.

90 lines
3.5 KiB

  1. /*
  2. ** Copyright 1991, 1992, 1993, Silicon Graphics, Inc.
  3. ** All Rights Reserved.
  4. **
  5. ** This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6. ** the contents of this file may not be disclosed to third parties, copied or
  7. ** duplicated in any form, in whole or in part, without the prior written
  8. ** permission of Silicon Graphics, Inc.
  9. **
  10. ** RESTRICTED RIGHTS LEGEND:
  11. ** Use, duplication or disclosure by the Government is subject to restrictions
  12. ** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13. ** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14. ** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15. ** rights reserved under the Copyright Laws of the United States.
  16. */
  17. #include "precomp.h"
  18. #pragma hdrstop
  19. #ifdef NT
  20. // Disable long to float conversion warning.
  21. #pragma warning (disable:4244)
  22. #endif // NT
  23. __GLcoord __gl_frustumClipPlanes[6] = {
  24. { 1.0, 0.0, 0.0, 1.0 }, /* left */
  25. { -1.0, 0.0, 0.0, 1.0 }, /* right */
  26. { 0.0, 1.0, 0.0, 1.0 }, /* bottom */
  27. { 0.0, -1.0, 0.0, 1.0 }, /* top */
  28. { 0.0, 0.0, 1.0, 1.0 }, /* zNear */
  29. { 0.0, 0.0, -1.0, 1.0 }, /* zFar */
  30. };
  31. GLbyte __glDitherTable[16] = {
  32. 0, 8, 2, 10,
  33. 12, 4, 14, 6,
  34. 3, 11, 1, 9,
  35. 15, 7, 13, 5,
  36. };
  37. // Clip coordinate offsets for frustum clipping
  38. GLuint __glFrustumOffsets[6] =
  39. {
  40. FIELD_OFFSET(__GLvertex, clip.x),
  41. FIELD_OFFSET(__GLvertex, clip.x),
  42. FIELD_OFFSET(__GLvertex, clip.y),
  43. FIELD_OFFSET(__GLvertex, clip.y),
  44. FIELD_OFFSET(__GLvertex, clip.z),
  45. FIELD_OFFSET(__GLvertex, clip.z)
  46. };
  47. #ifdef NT
  48. #if defined(_X86_) || defined(_ALPHA_) || defined(_MIPS_) || defined(_PPC_)
  49. const double __glDoubleTwo = ((double) 2.0);
  50. const double __glDoubleMinusTwo = ((double) -2.0);
  51. // On Alpha, register f31 is always read as zero.
  52. #ifndef _ALPHA_
  53. const __GLfloat __glZero = ((__GLfloat) 0.0);
  54. #endif
  55. const __GLfloat __glOne = ((__GLfloat) 1.0);
  56. const __GLfloat __glMinusOne = ((__GLfloat) -1.0);
  57. const __GLfloat __glHalf = ((__GLfloat) 0.5);
  58. const __GLfloat __glDegreesToRadians = ((__GLfloat) 3.14159265358979323846 /
  59. (__GLfloat) 180.0);
  60. const __GLfloat __glPi = ((__GLfloat) 3.14159265358979323846);
  61. const __GLfloat __glSqrt2 = ((__GLfloat) 1.41421356237309504880);
  62. const __GLfloat __glE = ((__GLfloat) 2.7182818284590452354);
  63. const __GLfloat __glVal128 = ((__GLfloat) 128.0);
  64. const __GLfloat __glVal255 = ((__GLfloat) 255.0);
  65. const __GLfloat __glOneOver255 = ((__GLfloat) (1.0 / 255.0));
  66. const __GLfloat __glVal256 = ((__GLfloat) 256.0);
  67. const __GLfloat __glOneOver512 = ((__GLfloat) (1.0 / 512.0));
  68. const __GLfloat __glVal768 = ((__GLfloat) 768.0);
  69. const __GLfloat __glVal65535 = ((__GLfloat) 65535.0);
  70. const __GLfloat __glVal65536 = ((__GLfloat) 65536.0);
  71. const __GLfloat __glTexSubDiv = ((__GLfloat) TEX_SUBDIV);
  72. const __GLfloat __glOneOver65535 = ((__GLfloat) (1.0 / 65535.0));
  73. const __GLfloat __glVal2147483648 = ((__GLfloat) 2147483648.0);
  74. /*
  75. ** Not quite 2^31-1 because of possible floating point errors. 4294965000
  76. ** is a much safer number to use.
  77. */
  78. const __GLfloat __glVal4294965000 = ((__GLfloat) (4294965000.0));
  79. const __GLfloat __glOneOver4294965000 = ((__GLfloat) (1.0 / 4294965000.0));
  80. #endif // Real values
  81. #endif // NT