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.

200 lines
6.8 KiB

  1. #ifndef __glevaluator_h_
  2. #define __glevaluator_h_
  3. /*
  4. ** Copyright 1991, Silicon Graphics, Inc.
  5. ** All Rights Reserved.
  6. **
  7. ** This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  8. ** the contents of this file may not be disclosed to third parties, copied or
  9. ** duplicated in any form, in whole or in part, without the prior written
  10. ** permission of Silicon Graphics, Inc.
  11. **
  12. ** RESTRICTED RIGHTS LEGEND:
  13. ** Use, duplication or disclosure by the Government is subject to restrictions
  14. ** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  15. ** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  16. ** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  17. ** rights reserved under the Copyright Laws of the United States.
  18. **
  19. ** $Revision: 1.5 $
  20. ** $Date: 1993/11/23 21:33:10 $
  21. */
  22. #include "types.h"
  23. /* XXX Can this be changed? */
  24. #define __GL_MAX_ORDER 40
  25. /* Number of maps */
  26. #define __GL_MAP_RANGE_COUNT 9
  27. #define __GL_EVAL1D_INDEX(old) ((old) - GL_MAP1_COLOR_4)
  28. #define __GL_EVAL2D_INDEX(old) ((old) - GL_MAP2_COLOR_4)
  29. /* Evaluator Flag Macros */
  30. #define GET_EVALSTATE(gc) \
  31. ((gc)->eval.evalStateFlags)
  32. #define GET_EVALSTATE_PTR(gc) \
  33. (&((gc)->eval.evalStateFlags))
  34. #define SET_EVALSTATE(gc,Flag) \
  35. ((gc)->eval.evalStateFlags = (DWORD)(Flag))
  36. /* Evaluator Stack State Macros */
  37. #define GET_EVALSTACKSTATE(gc) \
  38. ((gc)->eval.evalStackState)
  39. #define GET_EVALSTACKSTATE_PTR(gc) \
  40. (&((gc)->eval.evalStackState))
  41. #define SET_EVALSTACKSTATE(gc,Flag) \
  42. ((gc)->eval.evalStackState= (DWORD)(Flag))
  43. // Flags set by various API for indicating the Evaluator State.
  44. #define __EVALS_AFFECTS_1D_EVAL 0x00000001
  45. #define __EVALS_AFFECTS_2D_EVAL 0x00000002
  46. #define __EVALS_AFFECTS_ALL_EVAL 0x00000004
  47. #define __EVALS_PUSH_EVAL_ATTRIB 0x00000008
  48. #define __EVALS_POP_EVAL_ATTRIB 0x00000010
  49. /* Largest Grid Size */
  50. #define __GL_MAX_EVAL_WIDTH 1024
  51. /* internal form of map range indexes */
  52. #define __GL_C4 __GL_EVAL1D_INDEX(GL_MAP1_COLOR_4)
  53. #define __GL_I __GL_EVAL1D_INDEX(GL_MAP1_INDEX)
  54. #define __GL_N3 __GL_EVAL1D_INDEX(GL_MAP1_NORMAL)
  55. #define __GL_T1 __GL_EVAL1D_INDEX(GL_MAP1_TEXTURE_COORD_1)
  56. #define __GL_T2 __GL_EVAL1D_INDEX(GL_MAP1_TEXTURE_COORD_2)
  57. #define __GL_T3 __GL_EVAL1D_INDEX(GL_MAP1_TEXTURE_COORD_3)
  58. #define __GL_T4 __GL_EVAL1D_INDEX(GL_MAP1_TEXTURE_COORD_4)
  59. #define __GL_V3 __GL_EVAL1D_INDEX(GL_MAP1_VERTEX_3)
  60. #define __GL_V4 __GL_EVAL1D_INDEX(GL_MAP1_VERTEX_4)
  61. #define EVAL_COLOR_VALID 0x00000001
  62. #define EVAL_NORMAL_VALID 0x00000002
  63. #define EVAL_TEXTURE_VALID 0x00000004
  64. typedef struct {
  65. /*
  66. ** not strictly necessary since it can be inferred from the index,
  67. ** but it makes the code simpler.
  68. */
  69. GLint k;
  70. /*
  71. ** Order of the polynomial + 1
  72. */
  73. GLint order;
  74. __GLfloat u1, u2;
  75. } __GLevaluator1;
  76. typedef struct {
  77. GLint k;
  78. GLint majorOrder, minorOrder;
  79. __GLfloat u1, u2;
  80. __GLfloat v1, v2;
  81. } __GLevaluator2;
  82. typedef struct {
  83. __GLfloat start;
  84. __GLfloat finish;
  85. __GLfloat step;
  86. GLint n;
  87. } __GLevaluatorGrid;
  88. typedef struct {
  89. __GLevaluatorGrid u1, u2, v2;
  90. } __GLevaluatorState;
  91. typedef struct {
  92. __GLevaluator1 eval1[__GL_MAP_RANGE_COUNT];
  93. __GLevaluator2 eval2[__GL_MAP_RANGE_COUNT];
  94. __GLfloat *eval1Data[__GL_MAP_RANGE_COUNT];
  95. __GLfloat *eval2Data[__GL_MAP_RANGE_COUNT];
  96. __GLfloat uvalue;
  97. __GLfloat vvalue;
  98. __GLfloat ucoeff[__GL_MAX_ORDER];
  99. __GLfloat vcoeff[__GL_MAX_ORDER];
  100. __GLfloat ucoeffDeriv[__GL_MAX_ORDER];
  101. __GLfloat vcoeffDeriv[__GL_MAX_ORDER];
  102. GLint uorder;
  103. GLint vorder;
  104. GLint utype;
  105. GLint vtype;
  106. // Currently 16 bits long because that is the
  107. // maximum attribute stack depth.
  108. // The right-end is the stack-top
  109. // This field is used to keep track of PushAttrib/PopAttrib calls
  110. // that affect the Evaluator state.
  111. DWORD evalStackState;
  112. // This field is used to keep track of calls that can potentially
  113. // that affect the Evaluator state. If any of the flags are set,
  114. // a glsbAttention() call is made in the affected Evaluator client
  115. // side functions.
  116. DWORD evalStateFlags;
  117. // These are used to store the respective state values in POLYDATA
  118. // if they have been set by a not evaluator call (glcltColor,
  119. // glcltNormal etc.)
  120. DWORD accFlags;
  121. __GLcolor color;
  122. __GLcoord normal;
  123. __GLcoord texture;
  124. } __GLevaluatorMachine;
  125. extern void __glCopyEvaluatorState(__GLcontext *gc, __GLattribute *dst,
  126. const __GLattribute *src);
  127. extern GLint FASTCALL __glEvalComputeK(GLenum target);
  128. extern void APIPRIVATE __glFillMap1f(GLint k, GLint order, GLint stride,
  129. const GLfloat *points, __GLfloat *data);
  130. extern void APIPRIVATE __glFillMap1d(GLint k, GLint order, GLint stride,
  131. const GLdouble *points, __GLfloat *data);
  132. extern void APIPRIVATE __glFillMap2f(GLint k, GLint majorOrder, GLint minorOrder,
  133. GLint majorStride, GLint minorStride,
  134. const GLfloat *points, __GLfloat *data);
  135. extern void APIPRIVATE __glFillMap2d(GLint k, GLint majorOrder, GLint minorOrder,
  136. GLint majorStride, GLint minorStride,
  137. const GLdouble *points, __GLfloat *data);
  138. #ifdef NT
  139. #define __glMap1_size(k,order) ((k)*(order))
  140. #define __glMap2_size(k,majorOrder,minorOrder) ((k)*(majorOrder)*(minorOrder))
  141. #else
  142. extern GLint FASTCALL __glMap1_size(GLint k, GLint order);
  143. extern GLint FASTCALL __glMap2_size(GLint k, GLint majorOrder, GLint minorOrder);
  144. #endif
  145. extern __GLevaluator1 *__glSetUpMap1(__GLcontext *gc, GLenum type,
  146. GLint order, __GLfloat u1, __GLfloat u2);
  147. extern __GLevaluator2 *__glSetUpMap2(__GLcontext *gc, GLenum type,
  148. GLint majorOrder, GLint minorOrder,
  149. __GLfloat u1, __GLfloat u2,
  150. __GLfloat v1, __GLfloat v2);
  151. extern void __glDoEvalCoord1(__GLcontext *gc, __GLfloat u);
  152. extern void __glDoEvalCoord2(__GLcontext *gc, __GLfloat u, __GLfloat v);
  153. extern void FASTCALL __glEvalMesh1Line(__GLcontext *gc, GLint low, GLint high);
  154. extern void FASTCALL __glEvalMesh1Point(__GLcontext *gc, GLint low, GLint high);
  155. extern void __glEvalMesh2Fill(__GLcontext *gc, GLint lowU, GLint lowV,
  156. GLint highU, GLint highV);
  157. extern void __glEvalMesh2Line(__GLcontext *gc, GLint lowU, GLint lowV,
  158. GLint highU, GLint highV);
  159. extern void __glEvalMesh2Point(__GLcontext *gc, GLint lowU, GLint lowV,
  160. GLint highU, GLint highV);
  161. #endif /* __glevaluator_h_ */