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.

365 lines
11 KiB

  1. /*
  2. ** Copyright 1995-2095, 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. /******************************************************************************
  18. __GLSwriteStream
  19. ******************************************************************************/
  20. typedef struct {
  21. FILE *channel;
  22. __GLSstring name;
  23. GLboolean created;
  24. GLboolean opened;
  25. GLSwriteFunc writeFunc;
  26. } __GLSwriteStream;
  27. extern __GLSwriteStream* __glsWriteStream_create(
  28. const GLubyte *inName, GLboolean inAppend
  29. );
  30. extern __GLSwriteStream* __glsWriteStream_destroy(__GLSwriteStream *inStream);
  31. extern size_t __glsWriteStream_getByteCount(const __GLSwriteStream *inStream);
  32. /******************************************************************************
  33. __GLSwriter
  34. ******************************************************************************/
  35. typedef struct __GLSwriter __GLSwriter;
  36. struct __GLSwriter {
  37. GLboolean (*alloc)(
  38. __GLSwriter *inoutWriter, size_t inWordCount
  39. );
  40. GLboolean (*beginCommand)(
  41. __GLSwriter *inoutWriter, GLSopcode inOpcode, size_t inByteCount
  42. );
  43. void (*endCommand)(
  44. __GLSwriter *inoutWriter
  45. );
  46. void (*nextList)(
  47. __GLSwriter *inoutWriter
  48. );
  49. GLboolean (*padWordCount)(
  50. __GLSwriter *inoutWriter, GLboolean inCountMod2
  51. );
  52. void (*putGLSenum)(
  53. __GLSwriter *inoutWriter, GLSenum inVal
  54. );
  55. void (*putGLSimageFlags)(
  56. __GLSwriter *inoutWriter, GLbitfield inVal
  57. );
  58. void (*putGLSopcode)(
  59. __GLSwriter *inoutWriter, GLSopcode inVal
  60. );
  61. void (*putGLattribMask)(
  62. __GLSwriter *inoutWriter, GLbitfield inVal
  63. );
  64. void (*putGLbitvs)(
  65. __GLSwriter *inoutWriter,
  66. GLboolean inItemSwap,
  67. GLint inItemLeftShift,
  68. GLint inStrideDataItems,
  69. GLint inStridePadItems,
  70. GLint inStrideCount,
  71. const GLubyte *inVec
  72. );
  73. void (*putGLblendingFactor)(
  74. __GLSwriter *inoutWriter, GLenum inVal
  75. );
  76. void (*putGLboolean)(
  77. __GLSwriter *inoutWriter, GLboolean inVal
  78. );
  79. void (*putGLbooleanv)(
  80. __GLSwriter *inoutWriter, GLuint inCount, const GLboolean *inVec
  81. );
  82. void (*putGLbooleanvs)(
  83. __GLSwriter *inoutWriter,
  84. GLboolean inItemSwap,
  85. GLint inStride1DataItems,
  86. GLint inStride1PadBytes,
  87. GLint inStride1Count,
  88. GLint inStride2PadBytes,
  89. GLint inStride2Count,
  90. const GLboolean *inVec
  91. );
  92. void (*putGLbyte)(
  93. __GLSwriter *inoutWriter, GLbyte inVal
  94. );
  95. void (*putGLbytev)(
  96. __GLSwriter *inoutWriter, GLuint inCount, const GLbyte *inVec
  97. );
  98. void (*putGLbytevs)(
  99. __GLSwriter *inoutWriter,
  100. GLboolean inItemSwap,
  101. GLint inStride1DataItems,
  102. GLint inStride1PadBytes,
  103. GLint inStride1Count,
  104. GLint inStride2PadBytes,
  105. GLint inStride2Count,
  106. const GLbyte *inVec
  107. );
  108. void (*putGLcharv)(
  109. __GLSwriter *inoutWriter, GLuint inCount, const GLubyte *inVec
  110. );
  111. void (*putGLclearBufferMask)(
  112. __GLSwriter *inoutWriter, GLbitfield inVal
  113. );
  114. void (*putGLdouble)(
  115. __GLSwriter *inoutWriter, GLdouble inVal
  116. );
  117. void (*putGLdoubleOrGLenum)(
  118. __GLSwriter *inoutWriter, GLenum inParam, GLdouble inVal
  119. );
  120. void (*putGLdoubleOrGLenumv)(
  121. __GLSwriter *inoutWriter,
  122. GLenum inParam, GLuint inCount, const GLdouble *inVec
  123. );
  124. void (*putGLdoublem)(
  125. __GLSwriter *inoutWriter, const GLdouble *inMat
  126. );
  127. void (*putGLdoublev)(
  128. __GLSwriter *inoutWriter, GLuint inCount, const GLdouble *inVec
  129. );
  130. void (*putGLdoublevs)(
  131. __GLSwriter *inoutWriter,
  132. GLboolean inItemSwap,
  133. GLint inStride1DataItems,
  134. GLint inStride1PadBytes,
  135. GLint inStride1Count,
  136. GLint inStride2PadBytes,
  137. GLint inStride2Count,
  138. const GLdouble *inVec
  139. );
  140. void (*putGLdrawBufferMode)(
  141. __GLSwriter *inoutWriter, GLenum inVal
  142. );
  143. void (*putGLenum)(
  144. __GLSwriter *inoutWriter, GLenum inVal
  145. );
  146. void (*putGLfloat)(
  147. __GLSwriter *inoutWriter, GLfloat inVal
  148. );
  149. void (*putGLfloatOrGLenum)(
  150. __GLSwriter *inoutWriter, GLenum inParam, GLfloat inVal
  151. );
  152. void (*putGLfloatOrGLenumv)(
  153. __GLSwriter *inoutWriter,
  154. GLenum inParam, GLuint inCount, const GLfloat *inVec
  155. );
  156. void (*putGLfloatm)(
  157. __GLSwriter *inoutWriter, const GLfloat *inMat
  158. );
  159. void (*putGLfloatv)(
  160. __GLSwriter *inoutWriter, GLuint inCount, const GLfloat *inVec
  161. );
  162. void (*putGLfloatvs)(
  163. __GLSwriter *inoutWriter,
  164. GLboolean inItemSwap,
  165. GLint inStride1DataItems,
  166. GLint inStride1PadBytes,
  167. GLint inStride1Count,
  168. GLint inStride2PadBytes,
  169. GLint inStride2Count,
  170. const GLfloat *inVec
  171. );
  172. void (*putGLint)(
  173. __GLSwriter *inoutWriter, GLint inVal
  174. );
  175. void (*putGLintOrGLSenum)(
  176. __GLSwriter *inoutWriter, GLenum inParam, GLint inVal
  177. );
  178. void (*putGLintOrGLenum)(
  179. __GLSwriter *inoutWriter, GLenum inParam, GLint inVal
  180. );
  181. void (*putGLintOrGLenumv)(
  182. __GLSwriter *inoutWriter,
  183. GLenum inParam, GLuint inCount, const GLint *inVec
  184. );
  185. void (*putGLintv)(
  186. __GLSwriter *inoutWriter, GLuint inCount, const GLint *inVec
  187. );
  188. void (*putGLintvs)(
  189. __GLSwriter *inoutWriter,
  190. GLboolean inItemSwap,
  191. GLint inStride1DataItems,
  192. GLint inStride1PadBytes,
  193. GLint inStride1Count,
  194. GLint inStride2PadBytes,
  195. GLint inStride2Count,
  196. const GLint *inVec
  197. );
  198. void (*putGLlong)(
  199. __GLSwriter *inoutWriter, GLlong inVal
  200. );
  201. void (*putGLlongv)(
  202. __GLSwriter *inoutWriter, GLuint inCount, const GLlong *inVec
  203. );
  204. void (*putGLoutArg)(
  205. __GLSwriter *inoutWriter, GLuint inIndex, const GLvoid *inVal
  206. );
  207. void (*putGLshort)(
  208. __GLSwriter *inoutWriter, GLshort inVal
  209. );
  210. void (*putGLshortv)(
  211. __GLSwriter *inoutWriter, GLuint inCount, const GLshort *inVec
  212. );
  213. void (*putGLshortvs)(
  214. __GLSwriter *inoutWriter,
  215. GLboolean inItemSwap,
  216. GLint inStride1DataItems,
  217. GLint inStride1PadBytes,
  218. GLint inStride1Count,
  219. GLint inStride2PadBytes,
  220. GLint inStride2Count,
  221. const GLshort *inVec
  222. );
  223. void (*putGLstencilOp)(
  224. __GLSwriter *inoutWriter, GLenum inVal
  225. );
  226. void (*putGLtextureComponentCount)(
  227. __GLSwriter *inoutWriter, GLint inVal
  228. );
  229. void (*putGLubyte)(
  230. __GLSwriter *inoutWriter, GLubyte inVal
  231. );
  232. void (*putGLubytev)(
  233. __GLSwriter *inoutWriter, GLuint inCount, const GLubyte *inVec
  234. );
  235. void (*putGLubytevs)(
  236. __GLSwriter *inoutWriter,
  237. GLboolean inItemSwap,
  238. GLint inStride1DataItems,
  239. GLint inStride1PadBytes,
  240. GLint inStride1Count,
  241. GLint inStride2PadBytes,
  242. GLint inStride2Count,
  243. const GLubyte *inVec
  244. );
  245. void (*putGLuint)(
  246. __GLSwriter *inoutWriter, GLuint inVal
  247. );
  248. void (*putGLuinthex)(
  249. __GLSwriter *inoutWriter, GLuint inVal
  250. );
  251. void (*putGLuintv)(
  252. __GLSwriter *inoutWriter, GLuint inCount, const GLuint *inVec
  253. );
  254. void (*putGLuintvs)(
  255. __GLSwriter *inoutWriter,
  256. GLboolean inItemSwap,
  257. GLint inStride1DataItems,
  258. GLint inStride1PadBytes,
  259. GLint inStride1Count,
  260. GLint inStride2PadBytes,
  261. GLint inStride2Count,
  262. const GLuint *inVec
  263. );
  264. void (*putGLulong)(
  265. __GLSwriter *inoutWriter, GLulong inVal
  266. );
  267. void (*putGLulonghex)(
  268. __GLSwriter *inoutWriter, GLulong inVal
  269. );
  270. void (*putGLulongv)(
  271. __GLSwriter *inoutWriter, GLuint inCount, const GLulong *inVec
  272. );
  273. void (*putGLushort)(
  274. __GLSwriter *inoutWriter, GLushort inVal
  275. );
  276. void (*putGLushorthex)(
  277. __GLSwriter *inoutWriter, GLushort inVal
  278. );
  279. void (*putGLushortv)(
  280. __GLSwriter *inoutWriter, GLuint inCount, const GLushort *inVec
  281. );
  282. void (*putGLushortvs)(
  283. __GLSwriter *inoutWriter,
  284. GLboolean inItemSwap,
  285. GLint inStride1DataItems,
  286. GLint inStride1PadBytes,
  287. GLint inStride1Count,
  288. GLint inStride2PadBytes,
  289. GLint inStride2Count,
  290. const GLushort *inVec
  291. );
  292. GLubyte *bufPtr;
  293. GLubyte *bufTail;
  294. GLSopcode commandOpcode;
  295. GLubyte *commandHead;
  296. GLubyte *commandTail;
  297. GLboolean contextCreated;
  298. __GLScontextStream *contextStream;
  299. GLboolean error;
  300. GLubyte *externBuf;
  301. GLubyte *externBufHead;
  302. __GLSwriteStream *externStream;
  303. GLint paramCount;
  304. __GLSbinCommandHead_large *prevCommand;
  305. __GLScontextStreamBlock *startBlock;
  306. size_t startOffset;
  307. GLSenum type;
  308. size_t wordCount;
  309. };
  310. extern __GLSwriter* __glsWriter_create(
  311. const GLubyte *inStreamName, GLSenum inStreamType, GLbitfield inWriteFlags
  312. );
  313. extern __GLSwriter* __glsWriter_destroy(__GLSwriter *inWriter);
  314. extern GLboolean __glsWriter_flush(__GLSwriter *inoutWriter);
  315. extern void __glsWriter_putListv(
  316. __GLSwriter *inoutWriter,
  317. GLenum inType,
  318. GLint inCount,
  319. const GLvoid *inVec
  320. );
  321. extern void __glsWriter_putPixelv(
  322. __GLSwriter *inoutWriter,
  323. GLenum inFormat,
  324. GLenum inType,
  325. GLint inWidth,
  326. GLint inHeight,
  327. const GLvoid *inVec
  328. );
  329. // DrewB - Always enabled for 1.1 support
  330. extern void __glsWriter_putVertexv(
  331. __GLSwriter *inoutWriter,
  332. GLint inSize,
  333. GLenum inType,
  334. GLint inStride,
  335. GLint inCount,
  336. const GLvoid *inVec
  337. );
  338. /******************************************************************************
  339. __GLSwriter binary
  340. ******************************************************************************/
  341. extern void __glsWriter_initDispatch_bin(
  342. __GLSwriter *inoutWriter, GLSenum inStreamType
  343. );
  344. /******************************************************************************
  345. __GLSwriter text
  346. ******************************************************************************/
  347. extern void __glsWriter_initDispatch_text(
  348. __GLSwriter *inoutWriter
  349. );