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.

196 lines
7.0 KiB

  1. #if !defined(__glslib_h_)
  2. #define __glslib_h_
  3. /*
  4. ** Copyright 1995-2095, 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. /******************************************************************************
  20. Constants
  21. ******************************************************************************/
  22. #define __GLS_BOOLEAN 0x0001
  23. #define __GLS_MAX_ALIGN_BYTES 8
  24. #define __GLS_MAX_CALL_NESTING 64
  25. #define __GLS_MAX_CAPTURE_NESTING 16
  26. #define __GLS_MAX_OUT_ARGS 4
  27. #define __GLS_VERSION_MAJOR 1
  28. #define __GLS_VERSION_MINOR 0
  29. #define __GLS_COMMAND_ALIGN_EVEN32_BIT 0x80000000
  30. #define __GLS_COMMAND_ALIGN_ODD32_BIT 0x40000000
  31. #define __GLS_COMMAND_0_PARAMS_BIT 0x20000000
  32. #define __GLS_COMMAND_ATTRIB_MASK 0x0000FFFF
  33. /******************************************************************************
  34. Extensions
  35. ******************************************************************************/
  36. // DrewB
  37. #ifndef __GLS_PLATFORM_WIN32
  38. #define __GL_EXT_abgr 1
  39. #define __GL_EXT_blend_color 1
  40. #define __GL_EXT_blend_logic_op 1
  41. #define __GL_EXT_blend_minmax 1
  42. #define __GL_EXT_blend_subtract 1
  43. #define __GL_EXT_cmyka 1
  44. #define __GL_EXT_convolution 1
  45. #define __GL_EXT_copy_texture 1
  46. #define __GL_EXT_histogram 1
  47. #define __GL_EXT_packed_pixels 1
  48. #define __GL_EXT_polygon_offset 1
  49. #define __GL_EXT_rescale_normal 1
  50. #define __GL_EXT_subtexture 1
  51. #define __GL_EXT_texture 1
  52. #define __GL_EXT_texture_object 1
  53. #define __GL_EXT_texture3D 1
  54. #define __GL_EXT_vertex_array 1
  55. #else
  56. #define __GL_EXT_paletted_texture 1
  57. #define __GL_EXT_bgra 1
  58. #define __GL_WIN_draw_range_elements 1
  59. #endif
  60. #if __GLS_PLATFORM_IRIX
  61. #define __GL_SGI_color_matrix 1
  62. #define __GL_SGI_color_table 1
  63. #define __GL_SGI_texture_color_table 1
  64. #define __GL_SGIS_component_select 1
  65. #define __GL_SGIS_detail_texture 1
  66. #define __GL_SGIS_multisample 1
  67. #define __GL_SGIS_sharpen_texture 1
  68. #define __GL_SGIS_texture_border_clamp 1
  69. #define __GL_SGIS_texture4D 1
  70. #define __GL_SGIX_interlace 1
  71. #define __GL_SGIX_multisample 1
  72. #define __GL_SGIX_pixel_texture 1
  73. #define __GL_SGIX_pixel_tiles 1
  74. #define __GL_SGIX_texture_multi_buffer 1
  75. #if __GLS_PLATFORM_IRIX_FUTURE
  76. #define __GL_SGIS_texture_edge_clamp 1
  77. #define __GL_SGIS_texture_filter4 0
  78. #define __GL_SGIS_texture_lod 1
  79. #define __GL_SGIX_multipass 0
  80. #define __GL_SGIX_sprite 0
  81. #endif /* __GLS_PLATFORM_IRIX_FUTURE */
  82. #endif /* __GLS_PLATFORM_IRIX */
  83. /******************************************************************************
  84. Macros
  85. ******************************************************************************/
  86. #define __GL_ENUM_OFFSET(inEnum) (GLint)(inEnum % __GL_ENUMS_PER_PAGE)
  87. #define __GL_ENUM_PAGE(inEnum) (GLint)(inEnum / __GL_ENUMS_PER_PAGE)
  88. #define __GL_ENUM(inPage, inOffset) ( \
  89. (inPage) * __GL_ENUMS_PER_PAGE + (inOffset) \
  90. )
  91. #define __GLS_ENUM_OFFSET(inEnum) (GLint)(inEnum % __GLS_ENUMS_PER_PAGE)
  92. #define __GLS_ENUM_PAGE(inEnum) (GLint)(inEnum / __GLS_ENUMS_PER_PAGE)
  93. #define __GLS_ENUM(inPage, inOffset) ( \
  94. (inPage) * __GLS_ENUMS_PER_PAGE + (inOffset) \
  95. )
  96. #define __GLS_FORWARD
  97. /******************************************************************************
  98. Includes
  99. ******************************************************************************/
  100. #include <glmf.h>
  101. #include "glsint.h"
  102. #include "glsutil.h"
  103. #include "encoding.h"
  104. #include "opcode.h"
  105. #include "pixel.h"
  106. #include "read.h"
  107. #include "parser.h"
  108. #include "ctx.h"
  109. #include "platform.h"
  110. #include "write.h"
  111. #ifdef __GLS_PLATFORM_WIN32
  112. // DrewB
  113. #include "glssize.h"
  114. #endif
  115. /******************************************************************************
  116. Global data
  117. ******************************************************************************/
  118. extern const GLSenum __glsAllAPIs[__GLS_API_COUNT + 1];
  119. extern const GLubyte *const __glAttribMaskString[__GL_ATTRIB_MASK_COUNT];
  120. extern const GLbitfield __glAttribMaskVal[__GL_ATTRIB_MASK_COUNT];
  121. extern __GLSdict *__glsContextDict;
  122. extern __GLScontextList __glsContextList;
  123. extern const GLubyte *const *const __glEnumString[__GL_ENUM_PAGE_COUNT];
  124. extern const GLint __glEnumStringCount[__GL_ENUM_PAGE_COUNT];
  125. extern const GLSfunc __glsDispatchCapture[__GLS_OPCODE_COUNT];
  126. extern __GLSdecodeBinFunc __glsDispatchDecode_bin_default[__GLS_OPCODE_COUNT];
  127. extern const __GLSdecodeBinFunc __glsDispatchDecode_bin_swap[
  128. __GLS_OPCODE_COUNT
  129. ];
  130. extern const __GLSdecodeTextFunc __glsDispatchDecode_text[__GLS_OPCODE_COUNT];
  131. extern GLSfunc __glsDispatchExec[__GLS_OPCODE_COUNT];
  132. extern const GLubyte *const *const __glsEnumString[__GLS_ENUM_PAGE_COUNT];
  133. extern const GLint __glsEnumStringCount[__GLS_ENUM_PAGE_COUNT];
  134. extern const GLubyte *const __glsExtensions;
  135. extern const GLubyte *const __glsImageFlagsString[__GLS_IMAGE_FLAGS_COUNT];
  136. extern const GLbitfield __glsImageFlagsVal[__GLS_IMAGE_FLAGS_COUNT];
  137. extern const GLbitfield __glsOpcodeAttrib[__GLS_OPCODE_COUNT];
  138. extern const GLubyte *const __glsOpcodeString[__GLS_OPCODE_COUNT];
  139. extern const GLSopcode __glsOpcodesGL[];
  140. extern const GLSopcode __glsOpcodesGLS[];
  141. extern const GLint __glsOpcodesGLCount;
  142. extern const GLint __glsOpcodesGLSCount;
  143. extern __GLSparser *__glsParser;
  144. #if __GLS_MAPPED_OPCODE_PAGE_COUNT
  145. extern const GLint __glsOpPageMap[__GLS_MAPPED_OPCODE_PAGE_COUNT];
  146. #endif /* __GLS_MAPPED_OPCODE_PAGE_COUNT */
  147. /******************************************************************************
  148. Global functions
  149. ******************************************************************************/
  150. #define __GLS_RAISE_ERROR(inError) if (!__GLS_ERROR) __GLS_PUT_ERROR(inError)
  151. #ifndef __GLS_PLATFORM_WIN32
  152. // DrewB
  153. extern void __glsCallError(GLSopcode inOpcode, GLSenum inError);
  154. #define __GLS_CALL_ERROR(ctx, inOpcode, inError) \
  155. __glsCallError(inOpcode, inError)
  156. extern void __glsCallUnsupportedCommand(void);
  157. #define __GLS_CALL_UNSUPPORTED_COMMAND(ctx) \
  158. __glsCallUnsupportedCommand()
  159. #else
  160. extern void __glsCallError(__GLScontext *ctx,
  161. GLSopcode inOpcode, GLSenum inError);
  162. #define __GLS_CALL_ERROR(ctx, inOpcode, inError) \
  163. __glsCallError(ctx, inOpcode, inError)
  164. extern void __glsCallUnsupportedCommand(__GLScontext *ctx);
  165. #define __GLS_CALL_UNSUPPORTED_COMMAND(ctx) \
  166. __glsCallUnsupportedCommand(ctx)
  167. #endif
  168. #endif /* __glslib_h_ */