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.

180 lines
7.6 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: compsize.h
  3. *
  4. * Function prototypes and macros to compute size of input buffer.
  5. *
  6. *
  7. * Copyright (c) 1993 Microsoft Corporation
  8. \**************************************************************************/
  9. #ifndef __COMPSIZE_H__
  10. #define __COMPSIZE_H__
  11. #ifndef _CLIENTSIDE_
  12. GLint __glCallLists_size(GLint n, GLenum type);
  13. GLint __glCltMap1_size(GLenum target);
  14. GLint __glCltMap2_size(GLenum target);
  15. GLint __glGetMap_size(GLenum target, GLenum query);
  16. GLint __glGetPixelMap_size(GLenum map);
  17. GLint __glGet_size(GLenum pname);
  18. #define __glGetMapdv_size(target,query) \
  19. (__glGetMap_size(target,query)*sizeof(GLdouble))
  20. #define __glGetMapfv_size(target,query) \
  21. (__glGetMap_size(target,query)*sizeof(GLfloat))
  22. #define __glGetMapiv_size(target,query) \
  23. (__glGetMap_size(target,query)*sizeof(GLint))
  24. #define __glGetPixelMapfv_size(map) \
  25. (__glGetPixelMap_size(map)*sizeof(GLfloat))
  26. #define __glGetPixelMapuiv_size(map) \
  27. (__glGetPixelMap_size(map)*sizeof(GLuint))
  28. #define __glGetPixelMapusv_size(map) \
  29. (__glGetPixelMap_size(map)*sizeof(GLushort))
  30. #endif
  31. // FOG_ASSERT
  32. #if !(((GL_FOG_INDEX +1) == GL_FOG_DENSITY) && \
  33. ((GL_FOG_DENSITY+1) == GL_FOG_START ) && \
  34. ((GL_FOG_START +1) == GL_FOG_END ) && \
  35. ((GL_FOG_END +1) == GL_FOG_MODE ) && \
  36. ((GL_FOG_MODE +1) == GL_FOG_COLOR ) \
  37. )
  38. #error "bad fog index ordering"
  39. #endif
  40. // LIGHT_SOURCE_ASSERT
  41. #if !(((GL_AMBIENT +1) == GL_DIFFUSE ) && \
  42. ((GL_DIFFUSE +1) == GL_SPECULAR ) && \
  43. ((GL_SPECULAR +1) == GL_POSITION ) && \
  44. ((GL_POSITION +1) == GL_SPOT_DIRECTION ) && \
  45. ((GL_SPOT_DIRECTION +1) == GL_SPOT_EXPONENT ) && \
  46. ((GL_SPOT_EXPONENT +1) == GL_SPOT_CUTOFF ) && \
  47. ((GL_SPOT_CUTOFF +1) == GL_CONSTANT_ATTENUATION ) && \
  48. ((GL_CONSTANT_ATTENUATION+1) == GL_LINEAR_ATTENUATION ) && \
  49. ((GL_LINEAR_ATTENUATION +1) == GL_QUADRATIC_ATTENUATION) \
  50. )
  51. #error "bad light source index ordering"
  52. #endif
  53. // LIGHT_MODEL_ASSERT
  54. #if !(((GL_LIGHT_MODEL_LOCAL_VIEWER+1) == GL_LIGHT_MODEL_TWO_SIDE) && \
  55. ((GL_LIGHT_MODEL_TWO_SIDE +1) == GL_LIGHT_MODEL_AMBIENT ) \
  56. )
  57. #error "bad light model index ordering"
  58. #endif
  59. // TEX_GEN_ASSERT
  60. #if !(((GL_TEXTURE_GEN_MODE+1) == GL_OBJECT_PLANE) && \
  61. ((GL_OBJECT_PLANE+1) == GL_EYE_PLANE) \
  62. )
  63. #error "bad tex gen index ordering"
  64. #endif
  65. // TEX_PARAMETER_ASSERT
  66. #if !(((GL_TEXTURE_MAG_FILTER +1) == GL_TEXTURE_MIN_FILTER ) && \
  67. ((GL_TEXTURE_MIN_FILTER +1) == GL_TEXTURE_WRAP_S ) && \
  68. ((GL_TEXTURE_WRAP_S +1) == GL_TEXTURE_WRAP_T ) \
  69. )
  70. #error "bad tex parameter index ordering"
  71. #endif
  72. // PIXEL_MAP_ASSERT
  73. #if !(((GL_PIXEL_MAP_I_TO_I+1) == GL_PIXEL_MAP_S_TO_S) && \
  74. ((GL_PIXEL_MAP_S_TO_S+1) == GL_PIXEL_MAP_I_TO_R) && \
  75. ((GL_PIXEL_MAP_I_TO_R+1) == GL_PIXEL_MAP_I_TO_G) && \
  76. ((GL_PIXEL_MAP_I_TO_G+1) == GL_PIXEL_MAP_I_TO_B) && \
  77. ((GL_PIXEL_MAP_I_TO_B+1) == GL_PIXEL_MAP_I_TO_A) && \
  78. ((GL_PIXEL_MAP_I_TO_A+1) == GL_PIXEL_MAP_R_TO_R) && \
  79. ((GL_PIXEL_MAP_R_TO_R+1) == GL_PIXEL_MAP_G_TO_G) && \
  80. ((GL_PIXEL_MAP_G_TO_G+1) == GL_PIXEL_MAP_B_TO_B) && \
  81. ((GL_PIXEL_MAP_B_TO_B+1) == GL_PIXEL_MAP_A_TO_A) && \
  82. ((GL_PIXEL_MAP_I_TO_I_SIZE+1) == GL_PIXEL_MAP_S_TO_S_SIZE) && \
  83. ((GL_PIXEL_MAP_S_TO_S_SIZE+1) == GL_PIXEL_MAP_I_TO_R_SIZE) && \
  84. ((GL_PIXEL_MAP_I_TO_R_SIZE+1) == GL_PIXEL_MAP_I_TO_G_SIZE) && \
  85. ((GL_PIXEL_MAP_I_TO_G_SIZE+1) == GL_PIXEL_MAP_I_TO_B_SIZE) && \
  86. ((GL_PIXEL_MAP_I_TO_B_SIZE+1) == GL_PIXEL_MAP_I_TO_A_SIZE) && \
  87. ((GL_PIXEL_MAP_I_TO_A_SIZE+1) == GL_PIXEL_MAP_R_TO_R_SIZE) && \
  88. ((GL_PIXEL_MAP_R_TO_R_SIZE+1) == GL_PIXEL_MAP_G_TO_G_SIZE) && \
  89. ((GL_PIXEL_MAP_G_TO_G_SIZE+1) == GL_PIXEL_MAP_B_TO_B_SIZE) && \
  90. ((GL_PIXEL_MAP_B_TO_B_SIZE+1) == GL_PIXEL_MAP_A_TO_A_SIZE) \
  91. )
  92. #error "bad pixel map index ordering"
  93. #endif
  94. // MAP1_ASSERT
  95. #if !(((GL_MAP1_COLOR_4 +1) == GL_MAP1_INDEX ) &&\
  96. ((GL_MAP1_INDEX +1) == GL_MAP1_NORMAL ) &&\
  97. ((GL_MAP1_NORMAL +1) == GL_MAP1_TEXTURE_COORD_1) &&\
  98. ((GL_MAP1_TEXTURE_COORD_1+1) == GL_MAP1_TEXTURE_COORD_2) &&\
  99. ((GL_MAP1_TEXTURE_COORD_2+1) == GL_MAP1_TEXTURE_COORD_3) &&\
  100. ((GL_MAP1_TEXTURE_COORD_3+1) == GL_MAP1_TEXTURE_COORD_4) &&\
  101. ((GL_MAP1_TEXTURE_COORD_4+1) == GL_MAP1_VERTEX_3 ) &&\
  102. ((GL_MAP1_VERTEX_3 +1) == GL_MAP1_VERTEX_4 ) \
  103. )
  104. #error "bad map1 index ordering"
  105. #endif
  106. // MAP2_ASSERT
  107. #if !(((GL_MAP2_COLOR_4 +1) == GL_MAP2_INDEX ) &&\
  108. ((GL_MAP2_INDEX +1) == GL_MAP2_NORMAL ) &&\
  109. ((GL_MAP2_NORMAL +1) == GL_MAP2_TEXTURE_COORD_1) &&\
  110. ((GL_MAP2_TEXTURE_COORD_1+1) == GL_MAP2_TEXTURE_COORD_2) &&\
  111. ((GL_MAP2_TEXTURE_COORD_2+1) == GL_MAP2_TEXTURE_COORD_3) &&\
  112. ((GL_MAP2_TEXTURE_COORD_3+1) == GL_MAP2_TEXTURE_COORD_4) &&\
  113. ((GL_MAP2_TEXTURE_COORD_4+1) == GL_MAP2_VERTEX_3 ) &&\
  114. ((GL_MAP2_VERTEX_3 +1) == GL_MAP2_VERTEX_4 ) \
  115. )
  116. #error "bad map2 index ordering"
  117. #endif
  118. // TYPE_ASSERT
  119. #if !(((GL_BYTE +1) == GL_UNSIGNED_BYTE ) && \
  120. ((GL_UNSIGNED_BYTE +1) == GL_SHORT ) && \
  121. ((GL_SHORT +1) == GL_UNSIGNED_SHORT) && \
  122. ((GL_UNSIGNED_SHORT+1) == GL_INT ) && \
  123. ((GL_INT +1) == GL_UNSIGNED_INT ) && \
  124. ((GL_UNSIGNED_INT +1) == GL_FLOAT ) && \
  125. ((GL_FLOAT +1) == GL_2_BYTES ) && \
  126. ((GL_2_BYTES +1) == GL_3_BYTES ) && \
  127. ((GL_3_BYTES +1) == GL_4_BYTES ) && \
  128. ((GL_4_BYTES +1) == GL_DOUBLE ) \
  129. )
  130. #error "bad GL type index ordering"
  131. #endif
  132. // ARRAY_TYPE_ASSERT
  133. #if !(((GL_VERTEX_ARRAY +1) == GL_NORMAL_ARRAY ) && \
  134. ((GL_NORMAL_ARRAY +1) == GL_COLOR_ARRAY ) && \
  135. ((GL_COLOR_ARRAY +1) == GL_INDEX_ARRAY ) && \
  136. ((GL_INDEX_ARRAY +1) == GL_TEXTURE_COORD_ARRAY ) && \
  137. ((GL_TEXTURE_COORD_ARRAY +1) == GL_EDGE_FLAG_ARRAY ) \
  138. )
  139. #error "bad GL array type ordering"
  140. #endif
  141. // INTERLEAVED_FORMAT_ASSERT
  142. #if !(((GL_V2F +1) == GL_V3F ) && \
  143. ((GL_V3F +1) == GL_C4UB_V2F ) && \
  144. ((GL_C4UB_V2F +1) == GL_C4UB_V3F ) && \
  145. ((GL_C4UB_V3F +1) == GL_C3F_V3F ) && \
  146. ((GL_C3F_V3F +1) == GL_N3F_V3F ) && \
  147. ((GL_N3F_V3F +1) == GL_C4F_N3F_V3F ) && \
  148. ((GL_C4F_N3F_V3F +1) == GL_T2F_V3F ) && \
  149. ((GL_T2F_V3F +1) == GL_T4F_V4F ) && \
  150. ((GL_T4F_V4F +1) == GL_T2F_C4UB_V3F ) && \
  151. ((GL_T2F_C4UB_V3F +1) == GL_T2F_C3F_V3F ) && \
  152. ((GL_T2F_C3F_V3F +1) == GL_T2F_N3F_V3F ) && \
  153. ((GL_T2F_N3F_V3F +1) == GL_T2F_C4F_N3F_V3F ) && \
  154. ((GL_T2F_C4F_N3F_V3F +1) == GL_T4F_C4F_N3F_V4F ) \
  155. )
  156. #error "bad GL interleaved array format ordering"
  157. #endif
  158. #ifndef _CLIENTSIDE_
  159. #define GLSETERROR(e) {DBGLEVEL1(LEVEL_INFO,"GLSETERROR(%ld)\n",e);}
  160. #else
  161. #define GLSETERROR(e) __glSetError(e)
  162. #endif
  163. #endif /* !__COMPSIZE_H__ */