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.

899 lines
47 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: gli386.c *
  3. * *
  4. * This module implements a program which generates structure offset *
  5. * definitions for OpenGL structures that are accessed in assembly code. *
  6. * *
  7. * Created: 24-Aug-1992 01:24:49 *
  8. * Author: Charles Whitmer [chuckwh] *
  9. * Ported for OpenGL 4/1/1994 Otto Berkes [ottob] *
  10. * *
  11. * Copyright (c) 1994 Microsoft Corporation *
  12. \**************************************************************************/
  13. #include <nt.h>
  14. #include <ntrtl.h>
  15. #include <nturtl.h>
  16. #include <stddef.h>
  17. #include <stdio.h>
  18. #include <windows.h>
  19. #include <ddraw.h>
  20. #include <glp.h>
  21. #include "types.h"
  22. #include "context.h"
  23. #include "render.h"
  24. #include "attrib.h"
  25. #include "gencx.h"
  26. #define __BUILD_GLI386__
  27. #include "..\..\dlist\dl_pdata.h"
  28. #define OFFSET(type, field) ((LONG)(&((type *)0)->field))
  29. // pblank prints a blank line.
  30. #define pblank() fprintf(outfh,"\n")
  31. // pstruct defines an empty structure with the correct size.
  32. #define pstruct(n,c) fprintf(outfh, \
  33. "%s struc\n db %d dup(0)\n%s ends\n", \
  34. n,c,n);
  35. // pstr prints a string.
  36. #define pstr(s) fprintf(outfh,"%s\n",s)
  37. // pcomment prints a comment.
  38. #define pcomment(s) fprintf(outfh,"; %s\n",s)
  39. // pequate prints an equate statement.
  40. #define pequate(m,v) fprintf(outfh,"%s equ 0%lXH\n",m,v);
  41. void CreateInc(FILE *outfh)
  42. {
  43. __GLmatrix *m = 0;
  44. __GLfloat one = (__GLfloat)1;
  45. pblank();
  46. pcomment("------------------------------------------------------------------");
  47. pcomment(" Module Name: gli386.inc");
  48. pcomment("");
  49. pcomment(" Defines OpenGL assembly-language structures.");
  50. pcomment("");
  51. pcomment(" Copyright (c) 1994, 1995 Microsoft Corporation");
  52. pcomment("------------------------------------------------------------------");
  53. pblank();
  54. pblank();
  55. pblank();
  56. pcomment("Matrix structure offsets");
  57. pblank();
  58. pequate("__MATRIX_M00 ", &m->matrix[0][0]);
  59. pequate("__MATRIX_M01 ", &m->matrix[0][1]);
  60. pequate("__MATRIX_M02 ", &m->matrix[0][2]);
  61. pequate("__MATRIX_M03 ", &m->matrix[0][3]);
  62. pequate("__MATRIX_M10 ", &m->matrix[1][0]);
  63. pequate("__MATRIX_M11 ", &m->matrix[1][1]);
  64. pequate("__MATRIX_M12 ", &m->matrix[1][2]);
  65. pequate("__MATRIX_M13 ", &m->matrix[1][3]);
  66. pequate("__MATRIX_M20 ", &m->matrix[2][0]);
  67. pequate("__MATRIX_M21 ", &m->matrix[2][1]);
  68. pequate("__MATRIX_M22 ", &m->matrix[2][2]);
  69. pequate("__MATRIX_M23 ", &m->matrix[2][3]);
  70. pequate("__MATRIX_M30 ", &m->matrix[3][0]);
  71. pequate("__MATRIX_M31 ", &m->matrix[3][1]);
  72. pequate("__MATRIX_M32 ", &m->matrix[3][2]);
  73. pequate("__MATRIX_M33 ", &m->matrix[3][3]);
  74. pblank();
  75. // GLGENwindow
  76. pcomment("GLGENwindow structure");
  77. pblank();
  78. pequate("GENWIN_sem ", OFFSET(GLGENwindow, sem));
  79. pequate("GENWIN_lUsers ", OFFSET(GLGENwindow, lUsers));
  80. pequate("GENWIN_gengc ", OFFSET(GLGENwindow, gengc));
  81. pequate("GENWIN_owningThread ", OFFSET(GLGENwindow, owningThread));
  82. pequate("GENWIN_lockRecursion ", OFFSET(GLGENwindow, lockRecursion));
  83. pblank();
  84. // Stuff from: \nt\private\windows\gdi\opengl\server\inc\gencx.h
  85. pcomment("__GLGENcontextRec structure");
  86. pblank();
  87. pstruct("GLGENcontextRec",sizeof(struct __GLGENcontextRec));
  88. pblank();
  89. pequate("GENCTX_hrc ",OFFSET(struct __GLGENcontextRec,hrc ));
  90. pequate("GENCTX_pajTranslateVector",OFFSET(struct __GLGENcontextRec,pajTranslateVector));
  91. pequate("GENCTX_pPrivateArea ",OFFSET(struct __GLGENcontextRec,pPrivateArea));
  92. pequate("GENGC_ColorsBits ",OFFSET(struct __GLGENcontextRec,ColorsBits));
  93. pequate("GENGC_SPAN_r ",OFFSET(struct __GLGENcontextRec,genAccel.spanValue.r));
  94. pequate("GENGC_SPAN_g ",OFFSET(struct __GLGENcontextRec,genAccel.spanValue.g));
  95. pequate("GENGC_SPAN_b ",OFFSET(struct __GLGENcontextRec,genAccel.spanValue.b));
  96. pequate("GENGC_SPAN_a ",OFFSET(struct __GLGENcontextRec,genAccel.spanValue.a));
  97. pequate("GENGC_SPAN_s ",OFFSET(struct __GLGENcontextRec,genAccel.spanValue.s));
  98. pequate("GENGC_SPAN_t ",OFFSET(struct __GLGENcontextRec,genAccel.spanValue.t));
  99. pequate("GENGC_SPAN_dr ",OFFSET(struct __GLGENcontextRec,genAccel.spanDelta.r));
  100. pequate("GENGC_SPAN_dg ",OFFSET(struct __GLGENcontextRec,genAccel.spanDelta.g));
  101. pequate("GENGC_SPAN_db ",OFFSET(struct __GLGENcontextRec,genAccel.spanDelta.b));
  102. pequate("GENGC_SPAN_da ",OFFSET(struct __GLGENcontextRec,genAccel.spanDelta.a));
  103. pequate("GENGC_SPAN_ds ",OFFSET(struct __GLGENcontextRec,genAccel.spanDelta.s));
  104. pequate("GENGC_SPAN_dt ",OFFSET(struct __GLGENcontextRec,genAccel.spanDelta.t));
  105. pequate("GENGC_SPAN_z ",OFFSET(struct __GLGENcontextRec,gc.polygon.shader.frag.z));
  106. pequate("GENGC_SPAN_dz ",OFFSET(struct __GLGENcontextRec,gc.polygon.shader.dzdx));
  107. pequate("GENGC_SPAN_zbuf ",OFFSET(struct __GLGENcontextRec,gc.polygon.shader.zbuf));
  108. pequate("GENGC_SPAN_ppix ",OFFSET(struct __GLGENcontextRec,genAccel.pPix));
  109. pequate("GENGC_SPAN_x ",OFFSET(struct __GLGENcontextRec,gc.polygon.shader.frag.x));
  110. pequate("GENGC_SPAN_y ",OFFSET(struct __GLGENcontextRec,gc.polygon.shader.frag.y));
  111. pequate("GENGC_SPAN_length ",OFFSET(struct __GLGENcontextRec,gc.polygon.shader.length));
  112. pequate("GENGC_rAccum ",OFFSET(struct __GLGENcontextRec,genAccel.rAccum));
  113. pequate("GENGC_gAccum ",OFFSET(struct __GLGENcontextRec,genAccel.gAccum));
  114. pequate("GENGC_bAccum ",OFFSET(struct __GLGENcontextRec,genAccel.bAccum));
  115. pequate("GENGC_aAccum ",OFFSET(struct __GLGENcontextRec,genAccel.aAccum));
  116. pequate("GENGC_zAccum ",OFFSET(struct __GLGENcontextRec,genAccel.zAccum));
  117. pequate("GENGC_sAccum ",OFFSET(struct __GLGENcontextRec,genAccel.sAccum));
  118. pequate("GENGC_tAccum ",OFFSET(struct __GLGENcontextRec,genAccel.tAccum));
  119. pequate("GENGC_pixAccum ",OFFSET(struct __GLGENcontextRec,genAccel.pixAccum));
  120. pequate("GENGC_ditherAccum ",OFFSET(struct __GLGENcontextRec,genAccel.ditherAccum));
  121. pequate("GENGC_sResult ",OFFSET(struct __GLGENcontextRec,genAccel.sResult[0]));
  122. pequate("GENGC_tResult ",OFFSET(struct __GLGENcontextRec,genAccel.tResult[0]));
  123. pequate("GENGC_sResultNew ",OFFSET(struct __GLGENcontextRec,genAccel.sResultNew[0]));
  124. pequate("GENGC_tResultNew ",OFFSET(struct __GLGENcontextRec,genAccel.tResultNew[0]));
  125. pequate("GENGC_sMask ",OFFSET(struct __GLGENcontextRec,genAccel.sMask));
  126. pequate("GENGC_tMaskSubDiv ",OFFSET(struct __GLGENcontextRec,genAccel.tMaskSubDiv));
  127. pequate("GENGC_tShiftSubDiv ",OFFSET(struct __GLGENcontextRec,genAccel.tShiftSubDiv));
  128. pequate("GENGC_texImage ",OFFSET(struct __GLGENcontextRec,genAccel.texImage));
  129. pequate("GENGC_texImageReplace ",OFFSET(struct __GLGENcontextRec,genAccel.texImageReplace));
  130. pequate("GENGC_texPalette ",OFFSET(struct __GLGENcontextRec,genAccel.texPalette));
  131. pequate("GENGC_qwAccum ",OFFSET(struct __GLGENcontextRec,genAccel.qwAccum));
  132. pequate("GENGC_SPAN_dqwdx ",OFFSET(struct __GLGENcontextRec,gc.polygon.shader.dqwdx));
  133. pequate("GENGC_SPAN_qw ",OFFSET(struct __GLGENcontextRec,gc.polygon.shader.frag.qw));
  134. pequate("GENGC_xlatPalette ",OFFSET(struct __GLGENcontextRec,xlatPalette));
  135. pequate("GENGC_sStepX ",OFFSET(struct __GLGENcontextRec,genAccel.sStepX));
  136. pequate("GENGC_tStepX ",OFFSET(struct __GLGENcontextRec,genAccel.tStepX));
  137. pequate("GENGC_qwStepX ",OFFSET(struct __GLGENcontextRec,genAccel.qwStepX));
  138. pequate("GENGC_subDs ",OFFSET(struct __GLGENcontextRec,genAccel.subDs));
  139. pequate("GENGC_subDt ",OFFSET(struct __GLGENcontextRec,genAccel.subDt));
  140. pequate("GENGC_rDisplay ",OFFSET(struct __GLGENcontextRec,genAccel.displayColor[0]));
  141. pequate("GENGC_gDisplay ",OFFSET(struct __GLGENcontextRec,genAccel.displayColor[1]));
  142. pequate("GENGC_bDisplay ",OFFSET(struct __GLGENcontextRec,genAccel.displayColor[2]));
  143. pequate("GENGC_aDisplay ",OFFSET(struct __GLGENcontextRec,genAccel.displayColor[3]));
  144. pequate("GENGC_bytesPerPixel ",OFFSET(struct __GLGENcontextRec,genAccel.xMultiplier));
  145. pequate("GENGC_bpp ",OFFSET(struct __GLGENcontextRec,genAccel.bpp));
  146. pequate("GENGC_flags ",OFFSET(struct __GLGENcontextRec,genAccel.flags));
  147. pequate("GENGC_pInvTranslateVector",OFFSET(struct __GLGENcontextRec,pajInvTranslateVector));
  148. pequate("GENGC_pwndMakeCur ", OFFSET(__GLGENcontext, pwndMakeCur));
  149. pequate("GENGC_pwndLocked ", OFFSET(__GLGENcontext, pwndLocked));
  150. pequate("GENGC_fsLocks ", OFFSET(__GLGENcontext, fsLocks));
  151. pequate("GENGC_fsGenLocks ", OFFSET(__GLGENcontext, fsGenLocks));
  152. pblank();
  153. pequate("COLOR_r ",OFFSET(struct __GLcolorRec,r ));
  154. pequate("COLOR_g ",OFFSET(struct __GLcolorRec,g ));
  155. pequate("COLOR_b ",OFFSET(struct __GLcolorRec,b ));
  156. pequate("COLOR_a ",OFFSET(struct __GLcolorRec,a ));
  157. pblank();
  158. // Stuff from: \nt\private\windows\gdi\opengl\server\inc\gencx.h
  159. pcomment("__GLcontextRec structure");
  160. pblank();
  161. pblank();
  162. pequate("GC_paTeb ",OFFSET(struct __GLcontextRec,paTeb));
  163. pequate("GC_oneOverRedVertexScale ",OFFSET(struct __GLcontextRec,oneOverRedVertexScale));
  164. pequate("GC_oneOverGreenVertexScale ",OFFSET(struct __GLcontextRec,oneOverGreenVertexScale));
  165. pequate("GC_oneOverBlueVertexScale ",OFFSET(struct __GLcontextRec,oneOverBlueVertexScale));
  166. pequate("GC_redVertexScale ",OFFSET(struct __GLcontextRec,redVertexScale));
  167. pequate("GC_greenVertexScale ",OFFSET(struct __GLcontextRec,greenVertexScale));
  168. pequate("GC_blueVertexScale ",OFFSET(struct __GLcontextRec,blueVertexScale));
  169. pequate("GC_alphaVertexScale ",OFFSET(struct __GLcontextRec,alphaVertexScale));
  170. pequate("GC_redClampTable ",OFFSET(struct __GLcontextRec,redClampTable[0]));
  171. pequate("GC_greenClampTable ",OFFSET(struct __GLcontextRec,greenClampTable[0]));
  172. pequate("GC_blueClampTable ",OFFSET(struct __GLcontextRec,blueClampTable[0]));
  173. pequate("GC_alphaClampTable ",OFFSET(struct __GLcontextRec,alphaClampTable[0]));
  174. pequate("GC_SHADER_R ", OFFSET(__GLcontext, polygon.shader.frag.color.r));
  175. pequate("GC_SHADER_G ", OFFSET(__GLcontext, polygon.shader.frag.color.g));
  176. pequate("GC_SHADER_B ", OFFSET(__GLcontext, polygon.shader.frag.color.b));
  177. pequate("GC_SHADER_A ", OFFSET(__GLcontext, polygon.shader.frag.color.a));
  178. pequate("GC_SHADER_DRDX ", OFFSET(__GLcontext, polygon.shader.drdx));
  179. pequate("GC_SHADER_DGDX ", OFFSET(__GLcontext, polygon.shader.dgdx));
  180. pequate("GC_SHADER_DBDX ", OFFSET(__GLcontext, polygon.shader.dbdx));
  181. pequate("GC_SHADER_DADX ", OFFSET(__GLcontext, polygon.shader.dadx));
  182. pblank();
  183. pequate("GC_LIGHT_front ", OFFSET(__GLcontext, light.front));
  184. pequate("GC_LIGHT_back ", OFFSET(__GLcontext, light.back));
  185. pblank();
  186. pequate("GC_mInv ", OFFSET(__GLcontext, mInv));
  187. pblank();
  188. pcomment("Other constants");
  189. pblank();
  190. pequate("__FLOAT_ONE ", *(long*)&one);
  191. pblank();
  192. pequate("SURFACE_TYPE_DIB ", SURFACE_TYPE_DIB);
  193. pequate("GEN_TEXTURE_ORTHO ", GEN_TEXTURE_ORTHO);
  194. pequate("PANEEDS_NORMAL ", PANEEDS_NORMAL);
  195. pequate("__GL_CLIP_USER0 ", __GL_CLIP_USER0);
  196. pequate("__GL_FRONTFACE ", __GL_FRONTFACE);
  197. pequate("__GL_BACKFACE ", __GL_BACKFACE);
  198. pequate("__GL_NORMALIZE_ENABLE ", __GL_NORMALIZE_ENABLE);
  199. pequate("__GL_SPEC_LOOKUP_TABLE_SIZE ", __GL_SPEC_LOOKUP_TABLE_SIZE);
  200. pequate("__GL_MATERIAL_AMBIENT ", __GL_MATERIAL_AMBIENT);
  201. pequate("__GL_MATERIAL_DIFFUSE ", __GL_MATERIAL_DIFFUSE);
  202. pequate("__GL_MATERIAL_SPECULAR ", __GL_MATERIAL_SPECULAR);
  203. pequate("__GL_MATERIAL_EMISSIVE ", __GL_MATERIAL_EMISSIVE);
  204. pblank();
  205. pequate("GC_SHADE_rLittle ",OFFSET(__GLcontext, polygon.shader.rLittle));
  206. pequate("GC_SHADE_gLittle ",OFFSET(__GLcontext, polygon.shader.gLittle));
  207. pequate("GC_SHADE_bLittle ",OFFSET(__GLcontext, polygon.shader.bLittle));
  208. pequate("GC_SHADE_aLittle ",OFFSET(__GLcontext, polygon.shader.aLittle));
  209. pblank();
  210. pequate("GC_SHADE_drdy ",OFFSET(__GLcontext, polygon.shader.drdy));
  211. pequate("GC_SHADE_dgdy ",OFFSET(__GLcontext, polygon.shader.dgdy));
  212. pequate("GC_SHADE_dbdy ",OFFSET(__GLcontext, polygon.shader.dbdy));
  213. pequate("GC_SHADE_dady ",OFFSET(__GLcontext, polygon.shader.dady));
  214. pblank();
  215. pequate("GC_SHADE_drdx ",OFFSET(__GLcontext, polygon.shader.drdx ));
  216. pequate("GC_SHADE_dgdx ",OFFSET(__GLcontext, polygon.shader.dgdx ));
  217. pequate("GC_SHADE_dbdx ",OFFSET(__GLcontext, polygon.shader.dbdx ));
  218. pequate("GC_SHADE_dadx ",OFFSET(__GLcontext, polygon.shader.dadx ));
  219. pblank();
  220. pequate("GC_VIEWPORT_xScale ", OFFSET(__GLcontext, state.viewport.xScale));
  221. pequate("GC_VIEWPORT_yScale ", OFFSET(__GLcontext, state.viewport.yScale));
  222. pequate("GC_VIEWPORT_zScale ", OFFSET(__GLcontext, state.viewport.zScale));
  223. pequate("GC_VIEWPORT_xCenter ", OFFSET(__GLcontext, state.viewport.xCenter));
  224. pequate("GC_VIEWPORT_yCenter ", OFFSET(__GLcontext, state.viewport.yCenter));
  225. pequate("GC_VIEWPORT_zCenter ", OFFSET(__GLcontext, state.viewport.zCenter));
  226. pblank();
  227. pequate("GC_STATE_clipPlanes0 ",OFFSET(__GLcontext, state.transform.eyeClipPlanes));
  228. pequate("GC_STATE_enablesClipPlanes ",OFFSET(__GLcontext, state.enables.clipPlanes));
  229. pequate("GC_STATE_enablesGeneral ",OFFSET(__GLcontext, state.enables.general));
  230. pequate("GC_STATE_lightModelAmbient ",OFFSET(__GLcontext, state.light.model.ambient));
  231. pblank();
  232. pequate("GC_LIGHT_sources ",OFFSET(__GLcontext, light.sources));
  233. pblank();
  234. pequate("GC_VERTEX_paNeeds ",OFFSET(__GLcontext, vertex.paNeeds));
  235. pblank();
  236. pequate("VERTEX_color ", OFFSET(__GLvertex, color));
  237. pblank();
  238. #ifndef _WIN95_
  239. pequate("TeglPaTeb ", TeglPaTeb);
  240. pequate("TeglSectionInfo ", TeglSectionInfo);
  241. #else
  242. pequate("GtiPaTeb ", OFFSET(GLTEBINFO, glReserved1));
  243. pequate("GtiSectionInfo ", OFFSET(GLTEBINFO, glSectionInfo));
  244. #endif
  245. pblank();
  246. pequate("sizeof_MATERIAL ", sizeof(__GLmaterialMachine));
  247. pequate("MATERIAL_scale ", OFFSET(__GLmaterialMachine, scale));
  248. pequate("MATERIAL_threshold ", OFFSET(__GLmaterialMachine, threshold));
  249. pequate("MATERIAL_specTable ", OFFSET(__GLmaterialMachine, specTable));
  250. pequate("MATERIAL_alpha ", OFFSET(__GLmaterialMachine, alpha));
  251. pequate("MATERIAL_paSceneColor ", OFFSET(__GLmaterialMachine, paSceneColor));
  252. pequate("MATERIAL_colorMaterialChange ", OFFSET(__GLmaterialMachine, colorMaterialChange));
  253. pequate("MATERIAL_cachedEmissiveAmbient ", OFFSET(__GLmaterialMachine, cachedEmissiveAmbient));
  254. pequate("MATERIAL_cachedNonLit ", OFFSET(__GLmaterialMachine, cachedNonLit));
  255. pblank();
  256. pequate("sizeof_LIGHTSOURCE ", sizeof(__GLlightSourceMachine));
  257. pequate("LIGHTSOURCE_next ", OFFSET(__GLlightSourceMachine, next));
  258. pequate("LIGHTSOURCE_front ", OFFSET(__GLlightSourceMachine, front));
  259. pequate("LIGHTSOURCE_back ", OFFSET(__GLlightSourceMachine, back));
  260. pequate("LIGHTSOURCE_unitVPpli ", OFFSET(__GLlightSourceMachine, unitVPpli.x));
  261. pequate("LIGHTSOURCE_hHat ", OFFSET(__GLlightSourceMachine, hHat.x));
  262. pequate("LIGHTSOURCE_state ", OFFSET(__GLlightSourceMachine, state));
  263. pblank();
  264. pequate("sizeof_LIGHTSOURCESTATE ", sizeof(__GLlightSourceState));
  265. pequate("LIGHTSOURCESTATE_ambient ", OFFSET(__GLlightSourceState, ambient));
  266. pequate("LIGHTSOURCESTATE_diffuse ", OFFSET(__GLlightSourceState, diffuse));
  267. pequate("LIGHTSOURCESTATE_specular ", OFFSET(__GLlightSourceState, specular));
  268. pblank();
  269. pequate("sizeof_LIGHTSOURCEPERMATERIAL ", sizeof(__GLlightSourcePerMaterialMachine));
  270. pequate("LIGHTSOURCEPERMATERIAL_ambient ", OFFSET(__GLlightSourcePerMaterialMachine, ambient.r));
  271. pequate("LIGHTSOURCEPERMATERIAL_specular ", OFFSET(__GLlightSourcePerMaterialMachine, specular.r));
  272. pequate("LIGHTSOURCEPERMATERIAL_diffuse ", OFFSET(__GLlightSourcePerMaterialMachine, diffuse.r));
  273. pblank();
  274. pequate("PA_flags ", OFFSET(POLYARRAY, flags));
  275. pequate("PA_pdNextVertex ", OFFSET(POLYARRAY, pdNextVertex));
  276. pequate("PA_pdFlush ", OFFSET(POLYARRAY, pdFlush));
  277. pequate("PA_pdCurNormal ", OFFSET(POLYARRAY, pdCurNormal));
  278. pequate("PA_pdCurTexture ", OFFSET(POLYARRAY, pdCurTexture));
  279. pequate("PA_pdCurColor ", OFFSET(POLYARRAY, pdCurColor));
  280. pequate("PA_pd0 ", OFFSET(POLYARRAY, pd0));
  281. pequate("PA_andClipCodes ", OFFSET(POLYARRAY, andClipCodes));
  282. pequate("PA_orClipCodes ", OFFSET(POLYARRAY, orClipCodes));
  283. pequate("POLYARRAY_IN_BEGIN ", POLYARRAY_IN_BEGIN);
  284. pequate("POLYARRAY_VERTEX3 ", POLYARRAY_VERTEX3);
  285. pequate("POLYARRAY_VERTEX2 ", POLYARRAY_VERTEX2);
  286. pequate("POLYARRAY_TEXTURE2 ", POLYARRAY_TEXTURE2);
  287. pequate("POLYARRAY_TEXTURE3 ", POLYARRAY_TEXTURE3);
  288. pequate("POLYARRAY_CLAMP_COLOR ", POLYARRAY_CLAMP_COLOR);
  289. #ifdef GL_EXT_cull_vertex
  290. pequate("POLYARRAY_HAS_CULLED_VERTEX", POLYARRAY_HAS_CULLED_VERTEX);
  291. pequate("GL_EXT_cull_vertex", 1);
  292. pequate("NOT_GL_CLIP_CULL_VERTEX", ~__GL_CLIP_CULL_VERTEX);
  293. #endif // GL_EXT_cull_vertex
  294. pblank();
  295. pequate("PD_flags ", OFFSET(POLYDATA, flags));
  296. pequate("PD_obj ", OFFSET(POLYDATA, obj.x));
  297. pequate("PD_normal ", OFFSET(POLYDATA, normal.x));
  298. pequate("PD_texture ", OFFSET(POLYDATA, texture.x));
  299. pequate("PD_colors0 ", OFFSET(POLYDATA, colors[0].r));
  300. pequate("PD_clip ", OFFSET(POLYDATA, clip.x));
  301. pequate("PD_window ", OFFSET(POLYDATA, window.x));
  302. pequate("PD_eye ", OFFSET(POLYDATA, eye.x));
  303. pequate("PD_clipCode ", OFFSET(POLYDATA, clipCode));
  304. pequate("POLYDATA_VERTEX3 ", POLYDATA_VERTEX3);
  305. pequate("POLYDATA_VERTEX2 ", POLYDATA_VERTEX2);
  306. pequate("POLYDATA_DLIST_TEXTURE2", POLYDATA_DLIST_TEXTURE2);
  307. pequate("POLYDATA_DLIST_TEXTURE3", POLYDATA_DLIST_TEXTURE3);
  308. pequate("POLYDATA_NORMAL_VALID ", POLYDATA_NORMAL_VALID);
  309. pequate("POLYDATA_TEXTURE_VALID ", POLYDATA_TEXTURE_VALID);
  310. pequate("POLYDATA_COLOR_VALID ", POLYDATA_COLOR_VALID);
  311. pequate("POLYDATA_NORMAL_VALID ", POLYDATA_NORMAL_VALID);
  312. pequate("POLYDATA_DLIST_COLOR_4 ", POLYDATA_DLIST_COLOR_4);
  313. pequate("sizeof_POLYDATA ", sizeof(POLYDATA));
  314. #ifdef GL_EXT_cull_vertex
  315. pequate("PD_color ", OFFSET(POLYDATA, color));
  316. pequate("POLYDATA_VERTEX_USED ", POLYDATA_VERTEX_USED);
  317. #endif // GL_EXT_cull_vertex
  318. pblank();
  319. pequate("GLMATRIX_xfNorm ", OFFSET(__GLmatrix, xfNorm));
  320. // Stuff from: \nt\private\windows\gdi\opengl\dlist\dl_pdata.h
  321. pblank();
  322. pblank();
  323. pequate("__PDATA_SIZE_T2F ", __PDATA_SIZE_T2F);
  324. pequate("__PDATA_SIZE_C3F " , __PDATA_SIZE_C3F);
  325. pequate("__PDATA_SIZE_C4F ", __PDATA_SIZE_C4F);
  326. pequate("__PDATA_SIZE_N3F ", __PDATA_SIZE_N3F);
  327. pequate("__PDATA_SIZE_V3F ", __PDATA_SIZE_V3F);
  328. pequate("__PDATA_PD_FLAGS_T2F ", __PDATA_PD_FLAGS_T2F);
  329. pequate("__PDATA_PD_FLAGS_C3F ", __PDATA_PD_FLAGS_C3F);
  330. pequate("__PDATA_PD_FLAGS_C4F ", __PDATA_PD_FLAGS_C4F);
  331. pequate("__PDATA_PD_FLAGS_N3F ", __PDATA_PD_FLAGS_N3F);
  332. pequate("__PDATA_PD_FLAGS_V3F ", __PDATA_PD_FLAGS_V3F);
  333. pequate("__PDATA_PA_FLAGS_T2F ", __PDATA_PA_FLAGS_T2F);
  334. pequate("__PDATA_PA_FLAGS_C3F ", __PDATA_PA_FLAGS_C3F);
  335. pequate("__PDATA_PA_FLAGS_C4F ", __PDATA_PA_FLAGS_C4F);
  336. pequate("__PDATA_PA_FLAGS_N3F ", __PDATA_PA_FLAGS_N3F);
  337. pequate("__PDATA_PA_FLAGS_V3F ", __PDATA_PA_FLAGS_V3F);
  338. }
  339. #undef pstruct
  340. // pcomment prints a comment.
  341. #undef pcomment
  342. #define pcomment(s) fprintf(outfh,"// %s\n",s)
  343. // pequate prints an equate statement.
  344. #undef pequate
  345. #define pequate(m,v) fprintf(outfh,"#define %s 0x%lX\n",m,v);
  346. void CreateH(FILE *outfh)
  347. {
  348. __GLmatrix *m = 0;
  349. __GLfloat one = (__GLfloat)1;
  350. pblank();
  351. pcomment("");
  352. pcomment(" Module Name: gli386.h");
  353. pcomment("");
  354. pcomment(" Defines OpenGL inline assembly structures.");
  355. pcomment("");
  356. pcomment(" Copyright (c) 1994-1996 Microsoft Corporation");
  357. pcomment("");
  358. pblank();
  359. pblank();
  360. pblank();
  361. pcomment("Matrix structure offsets");
  362. pblank();
  363. pequate("__MATRIX_M00", &m->matrix[0][0]);
  364. pequate("__MATRIX_M01", &m->matrix[0][1]);
  365. pequate("__MATRIX_M02", &m->matrix[0][2]);
  366. pequate("__MATRIX_M03", &m->matrix[0][3]);
  367. pequate("__MATRIX_M10", &m->matrix[1][0]);
  368. pequate("__MATRIX_M11", &m->matrix[1][1]);
  369. pequate("__MATRIX_M12", &m->matrix[1][2]);
  370. pequate("__MATRIX_M13", &m->matrix[1][3]);
  371. pequate("__MATRIX_M20", &m->matrix[2][0]);
  372. pequate("__MATRIX_M21", &m->matrix[2][1]);
  373. pequate("__MATRIX_M22", &m->matrix[2][2]);
  374. pequate("__MATRIX_M23", &m->matrix[2][3]);
  375. pequate("__MATRIX_M30", &m->matrix[3][0]);
  376. pequate("__MATRIX_M31", &m->matrix[3][1]);
  377. pequate("__MATRIX_M32", &m->matrix[3][2]);
  378. pequate("__MATRIX_M33", &m->matrix[3][3]);
  379. pblank();
  380. pcomment("__GLGENcontextRec structure");
  381. pblank();
  382. pblank();
  383. pequate("GENCTX_hrc ",OFFSET(struct __GLGENcontextRec,hrc ));
  384. pequate("GENCTX_pajTranslateVector",OFFSET(struct __GLGENcontextRec,pajTranslateVector));
  385. pequate("GENCTX_pPrivateArea ",OFFSET(struct __GLGENcontextRec,pPrivateArea));
  386. pequate("GENGC_ColorsBits ",OFFSET(struct __GLGENcontextRec,ColorsBits));
  387. pequate("GENGC_SPAN_r ",OFFSET(struct __GLGENcontextRec,genAccel.spanValue.r));
  388. pequate("GENGC_SPAN_g ",OFFSET(struct __GLGENcontextRec,genAccel.spanValue.g));
  389. pequate("GENGC_SPAN_b ",OFFSET(struct __GLGENcontextRec,genAccel.spanValue.b));
  390. pequate("GENGC_SPAN_a ",OFFSET(struct __GLGENcontextRec,genAccel.spanValue.a));
  391. pequate("GENGC_SPAN_s ",OFFSET(struct __GLGENcontextRec,genAccel.spanValue.s));
  392. pequate("GENGC_SPAN_t ",OFFSET(struct __GLGENcontextRec,genAccel.spanValue.t));
  393. pequate("GENGC_SPAN_dr ",OFFSET(struct __GLGENcontextRec,genAccel.spanDelta.r));
  394. pequate("GENGC_SPAN_dg ",OFFSET(struct __GLGENcontextRec,genAccel.spanDelta.g));
  395. pequate("GENGC_SPAN_db ",OFFSET(struct __GLGENcontextRec,genAccel.spanDelta.b));
  396. pequate("GENGC_SPAN_da ",OFFSET(struct __GLGENcontextRec,genAccel.spanDelta.a));
  397. pequate("GENGC_SPAN_ds ",OFFSET(struct __GLGENcontextRec,genAccel.spanDelta.s));
  398. pequate("GENGC_SPAN_dt ",OFFSET(struct __GLGENcontextRec,genAccel.spanDelta.t));
  399. pequate("GENGC_SPAN_z ",OFFSET(struct __GLGENcontextRec,gc.polygon.shader.frag.z));
  400. pequate("GENGC_SPAN_dz ",OFFSET(struct __GLGENcontextRec,gc.polygon.shader.dzdx));
  401. pequate("GENGC_SPAN_zbuf ",OFFSET(struct __GLGENcontextRec,gc.polygon.shader.zbuf));
  402. pequate("GENGC_SPAN_ppix ",OFFSET(struct __GLGENcontextRec,genAccel.pPix));
  403. pequate("GENGC_SPAN_x ",OFFSET(struct __GLGENcontextRec,gc.polygon.shader.frag.x));
  404. pequate("GENGC_SPAN_y ",OFFSET(struct __GLGENcontextRec,gc.polygon.shader.frag.y));
  405. pequate("GENGC_SPAN_length ",OFFSET(struct __GLGENcontextRec,gc.polygon.shader.length));
  406. pequate("GENGC_rAccum ",OFFSET(struct __GLGENcontextRec,genAccel.rAccum));
  407. pequate("GENGC_gAccum ",OFFSET(struct __GLGENcontextRec,genAccel.gAccum));
  408. pequate("GENGC_bAccum ",OFFSET(struct __GLGENcontextRec,genAccel.bAccum));
  409. pequate("GENGC_aAccum ",OFFSET(struct __GLGENcontextRec,genAccel.aAccum));
  410. pequate("GENGC_zAccum ",OFFSET(struct __GLGENcontextRec,genAccel.zAccum));
  411. pequate("GENGC_sAccum ",OFFSET(struct __GLGENcontextRec,genAccel.sAccum));
  412. pequate("GENGC_tAccum ",OFFSET(struct __GLGENcontextRec,genAccel.tAccum));
  413. pequate("GENGC_pixAccum ",OFFSET(struct __GLGENcontextRec,genAccel.pixAccum));
  414. pequate("GENGC_ditherAccum ",OFFSET(struct __GLGENcontextRec,genAccel.ditherAccum));
  415. pequate("GENGC_sResult ",OFFSET(struct __GLGENcontextRec,genAccel.sResult[0]));
  416. pequate("GENGC_tResult ",OFFSET(struct __GLGENcontextRec,genAccel.tResult[0]));
  417. pequate("GENGC_sResultNew ",OFFSET(struct __GLGENcontextRec,genAccel.sResultNew[0]));
  418. pequate("GENGC_tResultNew ",OFFSET(struct __GLGENcontextRec,genAccel.tResultNew[0]));
  419. pequate("GENGC_sMask ",OFFSET(struct __GLGENcontextRec,genAccel.sMask));
  420. pequate("GENGC_tMaskSubDiv ",OFFSET(struct __GLGENcontextRec,genAccel.tMaskSubDiv));
  421. pequate("GENGC_tShiftSubDiv ",OFFSET(struct __GLGENcontextRec,genAccel.tShiftSubDiv));
  422. pequate("GENGC_texImage ",OFFSET(struct __GLGENcontextRec,genAccel.texImage));
  423. pequate("GENGC_texImageReplace ",OFFSET(struct __GLGENcontextRec,genAccel.texImageReplace));
  424. pequate("GENGC_texPalette ",OFFSET(struct __GLGENcontextRec,genAccel.texPalette));
  425. pequate("GENGC_qwAccum ",OFFSET(struct __GLGENcontextRec,genAccel.qwAccum));
  426. pequate("GENGC_SPAN_dqwdx ",OFFSET(struct __GLGENcontextRec,gc.polygon.shader.dqwdx));
  427. pequate("GENGC_SPAN_qw ",OFFSET(struct __GLGENcontextRec,gc.polygon.shader.frag.qw));
  428. pequate("GENGC_xlatPalette ",OFFSET(struct __GLGENcontextRec,xlatPalette));
  429. pequate("GENGC_sStepX ",OFFSET(struct __GLGENcontextRec,genAccel.sStepX));
  430. pequate("GENGC_tStepX ",OFFSET(struct __GLGENcontextRec,genAccel.tStepX));
  431. pequate("GENGC_qwStepX ",OFFSET(struct __GLGENcontextRec,genAccel.qwStepX));
  432. pequate("GENGC_subDs ",OFFSET(struct __GLGENcontextRec,genAccel.subDs));
  433. pequate("GENGC_subDt ",OFFSET(struct __GLGENcontextRec,genAccel.subDt));
  434. pequate("GENGC_rDisplay ",OFFSET(struct __GLGENcontextRec,genAccel.displayColor[0]));
  435. pequate("GENGC_gDisplay ",OFFSET(struct __GLGENcontextRec,genAccel.displayColor[1]));
  436. pequate("GENGC_bDisplay ",OFFSET(struct __GLGENcontextRec,genAccel.displayColor[2]));
  437. pequate("GENGC_aDisplay ",OFFSET(struct __GLGENcontextRec,genAccel.displayColor[3]));
  438. pequate("GENGC_bytesPerPixel ",OFFSET(struct __GLGENcontextRec,genAccel.xMultiplier));
  439. pequate("GENGC_bpp ",OFFSET(struct __GLGENcontextRec,genAccel.bpp));
  440. pequate("GENGC_flags ",OFFSET(struct __GLGENcontextRec,genAccel.flags));
  441. pequate("GENGC_pInvTranslateVector",OFFSET(struct __GLGENcontextRec,pajInvTranslateVector));
  442. pblank();
  443. pequate("COLOR_r ",OFFSET(struct __GLcolorRec,r ));
  444. pequate("COLOR_g ",OFFSET(struct __GLcolorRec,g ));
  445. pequate("COLOR_b ",OFFSET(struct __GLcolorRec,b ));
  446. pequate("COLOR_a ",OFFSET(struct __GLcolorRec,a ));
  447. pblank();
  448. pequate("GC_SHADER_R ", OFFSET(__GLcontext, polygon.shader.frag.color.r));
  449. pequate("GC_SHADER_G ", OFFSET(__GLcontext, polygon.shader.frag.color.g));
  450. pequate("GC_SHADER_B ", OFFSET(__GLcontext, polygon.shader.frag.color.b));
  451. pequate("GC_SHADER_A ", OFFSET(__GLcontext, polygon.shader.frag.color.a));
  452. pblank();
  453. pequate("GC_SHADE_rLittle ",OFFSET(__GLcontext, polygon.shader.rLittle ));
  454. pequate("GC_SHADE_gLittle ",OFFSET(__GLcontext, polygon.shader.gLittle ));
  455. pequate("GC_SHADE_bLittle ",OFFSET(__GLcontext, polygon.shader.bLittle ));
  456. pequate("GC_SHADE_aLittle ",OFFSET(__GLcontext, polygon.shader.aLittle ));
  457. pblank();
  458. pequate("GC_SHADE_drdy ",OFFSET(__GLcontext, polygon.shader.drdy ));
  459. pequate("GC_SHADE_dgdy ",OFFSET(__GLcontext, polygon.shader.dgdy ));
  460. pequate("GC_SHADE_dbdy ",OFFSET(__GLcontext, polygon.shader.dbdy ));
  461. pequate("GC_SHADE_dady ",OFFSET(__GLcontext, polygon.shader.dady ));
  462. pblank();
  463. pequate("GC_SHADE_drdx ",OFFSET(__GLcontext, polygon.shader.drdx ));
  464. pequate("GC_SHADE_dgdx ",OFFSET(__GLcontext, polygon.shader.dgdx ));
  465. pequate("GC_SHADE_dbdx ",OFFSET(__GLcontext, polygon.shader.dbdx ));
  466. pequate("GC_SHADE_dadx ",OFFSET(__GLcontext, polygon.shader.dadx ));
  467. pblank();
  468. pequate("VERTEX_color ", OFFSET(__GLvertex, color));
  469. pblank();
  470. pequate("GC_VIEWPORT_xScale ", OFFSET(__GLcontext, state.viewport.xScale));
  471. pequate("GC_VIEWPORT_yScale ", OFFSET(__GLcontext, state.viewport.yScale));
  472. pequate("GC_VIEWPORT_zScale ", OFFSET(__GLcontext, state.viewport.zScale));
  473. pequate("GC_VIEWPORT_xCenter ", OFFSET(__GLcontext, state.viewport.xCenter));
  474. pequate("GC_VIEWPORT_yCenter ", OFFSET(__GLcontext, state.viewport.yCenter));
  475. pequate("GC_VIEWPORT_zCenter ", OFFSET(__GLcontext, state.viewport.zCenter));
  476. pblank();
  477. pequate("__FLOAT_ONE", *(long*)&one);
  478. pblank();
  479. pequate("VCLIP_x", OFFSET(__GLvertex, clip.x));
  480. pequate("VFCOL_r", OFFSET(__GLvertex, colors[__GL_FRONTFACE].r));
  481. pequate("VBCOL_r", OFFSET(__GLvertex, colors[__GL_BACKFACE].r));
  482. pequate("VTEX_x", OFFSET(__GLvertex, texture.x));
  483. pequate("VNOR_x", OFFSET(__GLvertex, normal.x));
  484. pequate("VEYE_x", OFFSET(__GLvertex, eyeX));
  485. pblank();
  486. pequate("PA_flags ", OFFSET(POLYARRAY, flags));
  487. pequate("PA_pdNextVertex ", OFFSET(POLYARRAY, pdNextVertex));
  488. pequate("PA_pdFlush ", OFFSET(POLYARRAY, pdFlush));
  489. pequate("PA_pdCurNormal ", OFFSET(POLYARRAY, pdCurNormal));
  490. pequate("PA_pdCurTexture ", OFFSET(POLYARRAY, pdCurTexture));
  491. pequate("PA_pdCurColor ", OFFSET(POLYARRAY, pdCurColor));
  492. pblank();
  493. pequate("PD_flags ", OFFSET(POLYDATA, flags));
  494. pequate("PD_obj ", OFFSET(POLYDATA, obj.x));
  495. pequate("PD_normal ", OFFSET(POLYDATA, normal.x));
  496. pequate("PD_texture ", OFFSET(POLYDATA, texture.x));
  497. pequate("PD_colors0 ", OFFSET(POLYDATA, colors[0].r));
  498. pequate("PD_clip ", OFFSET(POLYDATA, clip.x));
  499. pequate("PD_window ", OFFSET(POLYDATA, window.x));
  500. pequate("sizeof_POLYDATA ", sizeof(POLYDATA));
  501. }
  502. /******************************Public*Routine******************************\
  503. * GLi386 *
  504. * *
  505. * This is how we make structures consistent between C and ASM for OpenGL. *
  506. * *
  507. \**************************************************************************/
  508. int __cdecl main(int argc,char *argv[])
  509. {
  510. FILE *outfh;
  511. char *outName;
  512. char *dot;
  513. if (argc != 2) {
  514. fprintf(stderr, "Usage: %s file_name\n", argv[0]);
  515. exit(1);
  516. }
  517. outfh = fopen(argv[1], "w");
  518. if (NULL == outfh) {
  519. fprintf(stderr, "Cannot open %s\n", argv[1]);
  520. exit(1);
  521. }
  522. CreateInc(outfh);
  523. fclose(outfh);
  524. dot = strrchr(argv[1], '.');
  525. if (dot == NULL)
  526. {
  527. fprintf(stderr, "Cannot create H\n", argv[1]);
  528. exit(1);
  529. }
  530. *(++dot) = 'h';
  531. *(++dot) = 0;
  532. outfh = fopen(argv[1], "w");
  533. if (NULL == outfh) {
  534. fprintf(stderr, "Cannot open %s\n", argv[1]);
  535. exit(1);
  536. }
  537. CreateH(outfh);
  538. fclose(outfh);
  539. // UNUSED
  540. #if 0
  541. // Stuff from: \nt\public\sdk\inc\gl\gl.h
  542. pcomment("Pixel Format Descriptor");
  543. pblank();
  544. pequate("PFD_cColorBits ",OFFSET(PIXELFORMATDESCRIPTOR,cColorBits ));
  545. pequate("PFD_iPixelType ",OFFSET(PIXELFORMATDESCRIPTOR,iPixelType ));
  546. pequate("PFD_cDepthBits ",OFFSET(PIXELFORMATDESCRIPTOR,cDepthBits ));
  547. pcomment("GL Test Functions");
  548. pblank();
  549. pequate("GL_NEVER ",GL_NEVER );
  550. pequate("GL_LESS ",GL_LESS );
  551. pequate("GL_EQUAL ",GL_EQUAL );
  552. pequate("GL_LEQUAL ",GL_LEQUAL );
  553. pequate("GL_GREATER ",GL_GREATER );
  554. pequate("GL_NOTEQUAL ",GL_NOTEQUAL);
  555. pequate("GL_GEQUAL ",GL_GEQUAL );
  556. pequate("GL_ALWAYS ",GL_ALWAYS );
  557. pblank();
  558. pblank();
  559. pcomment("GL Mode Flags");
  560. pblank();
  561. pequate("__GL_SHADE_RGB ",__GL_SHADE_RGB );
  562. pequate("__GL_SHADE_SMOOTH ",__GL_SHADE_SMOOTH );
  563. pequate("__GL_SHADE_DEPTH_TEST ",__GL_SHADE_DEPTH_TEST );
  564. pequate("__GL_SHADE_DITHER ",__GL_SHADE_DITHER );
  565. pequate("__GL_SHADE_LOGICOP ",__GL_SHADE_LOGICOP );
  566. pequate("__GL_SHADE_MASK ",__GL_SHADE_MASK );
  567. pblank();
  568. pblank();
  569. pcomment("GL Type Sizes");
  570. pblank();
  571. pequate("GLbyteSize ",sizeof(GLbyte));
  572. pequate("GLshortSize ",sizeof(GLshort));
  573. pequate("GLintSize ",sizeof(GLint));
  574. pequate("GLfloatSize ",sizeof(GLfloat));
  575. pequate("__GLfloatSize ",sizeof(__GLfloat));
  576. pequate("__GLzValueSize ",sizeof(__GLzValue));
  577. pblank();
  578. pblank();
  579. // Stuff from: \nt\private\windows\gdi\opengl\server\inc\render.h
  580. pcomment("__GLfragmentRec structure");
  581. pblank();
  582. pstruct("GLfragmentRec",sizeof(struct __GLfragmentRec));
  583. pblank();
  584. pequate("FRAG_x ",OFFSET(struct __GLfragmentRec,x ));
  585. pequate("FRAG_y ",OFFSET(struct __GLfragmentRec,y ));
  586. pequate("FRAG_z ",OFFSET(struct __GLfragmentRec,z ));
  587. pequate("FRAG_color ",OFFSET(struct __GLfragmentRec,color ));
  588. pequate("FRAG_s ",OFFSET(struct __GLfragmentRec,s ));
  589. pequate("FRAG_t ",OFFSET(struct __GLfragmentRec,t ));
  590. pequate("FRAG_qw ",OFFSET(struct __GLfragmentRec,qw ));
  591. pequate("FRAG_f ",OFFSET(struct __GLfragmentRec,f ));
  592. pblank();
  593. pcomment("__GLshadeRec structure");
  594. pblank();
  595. pstruct("__GLshadeRec",sizeof(struct __GLshadeRec));
  596. pblank();
  597. pequate("SHADE_dxLeftLittle ",OFFSET(struct __GLshadeRec,dxLeftLittle ));
  598. pequate("SHADE_dxLeftBig ",OFFSET(struct __GLshadeRec,dxLeftBig ));
  599. pequate("SHADE_dxLeftFrac ",OFFSET(struct __GLshadeRec,dxLeftFrac ));
  600. pequate("SHADE_ixLeft ",OFFSET(struct __GLshadeRec,ixLeft ));
  601. pequate("SHADE_ixLeftFrac ",OFFSET(struct __GLshadeRec,ixLeftFrac ));
  602. pequate("SHADE_dxRightLittle",OFFSET(struct __GLshadeRec,dxRightLittle ));
  603. pequate("SHADE_dxRightBig ",OFFSET(struct __GLshadeRec,dxRightBig ));
  604. pequate("SHADE_dxRightFrac ",OFFSET(struct __GLshadeRec,dxRightFrac ));
  605. pequate("SHADE_ixRight ",OFFSET(struct __GLshadeRec,ixRight ));
  606. pequate("SHADE_ixRightFrac ",OFFSET(struct __GLshadeRec,ixRightFrac ));
  607. pequate("SHADE_area ",OFFSET(struct __GLshadeRec,area ));
  608. pequate("SHADE_dxAC ",OFFSET(struct __GLshadeRec,dxAC ));
  609. pequate("SHADE_dxBC ",OFFSET(struct __GLshadeRec,dxBC ));
  610. pequate("SHADE_dyAC ",OFFSET(struct __GLshadeRec,dyAC ));
  611. pequate("SHADE_dyBC ",OFFSET(struct __GLshadeRec,dyBC ));
  612. pequate("SHADE_frag ",OFFSET(struct __GLshadeRec,frag ));
  613. pequate("SHADE_spanLength ",OFFSET(struct __GLshadeRec,length ));
  614. pequate("SHADE_rBig ",OFFSET(struct __GLshadeRec,rBig ));
  615. pequate("SHADE_gBig ",OFFSET(struct __GLshadeRec,gBig ));
  616. pequate("SHADE_bBig ",OFFSET(struct __GLshadeRec,bBig ));
  617. pequate("SHADE_aBig ",OFFSET(struct __GLshadeRec,aBig ));
  618. pequate("SHADE_zLittle ",OFFSET(struct __GLshadeRec,zLittle ));
  619. pequate("SHADE_zBig ",OFFSET(struct __GLshadeRec,zBig ));
  620. pequate("SHADE_dzdx ",OFFSET(struct __GLshadeRec,dzdx ));
  621. pequate("SHADE_dzdyf ",OFFSET(struct __GLshadeRec,dzdyf ));
  622. pequate("SHADE_dzdxf ",OFFSET(struct __GLshadeRec,dzdxf ));
  623. pequate("SHADE_sLittle ",OFFSET(struct __GLshadeRec,sLittle ));
  624. pequate("SHADE_tLittle ",OFFSET(struct __GLshadeRec,tLittle ));
  625. pequate("SHADE_qwLittle ",OFFSET(struct __GLshadeRec,qwLittle ));
  626. pequate("SHADE_sBig ",OFFSET(struct __GLshadeRec,sBig ));
  627. pequate("SHADE_tBig ",OFFSET(struct __GLshadeRec,tBig ));
  628. pequate("SHADE_qwBig ",OFFSET(struct __GLshadeRec,qwBig ));
  629. pequate("SHADE_dsdx ",OFFSET(struct __GLshadeRec,dsdx ));
  630. pequate("SHADE_dtdx ",OFFSET(struct __GLshadeRec,dtdx ));
  631. pequate("SHADE_dqwdx ",OFFSET(struct __GLshadeRec,dqwdx ));
  632. pequate("SHADE_dsdy ",OFFSET(struct __GLshadeRec,dsdy ));
  633. pequate("SHADE_dtdy ",OFFSET(struct __GLshadeRec,dtdy ));
  634. pequate("SHADE_dqwdy ",OFFSET(struct __GLshadeRec,dqwdy ));
  635. pequate("SHADE_fLittle ",OFFSET(struct __GLshadeRec,fLittle ));
  636. pequate("SHADE_fBig ",OFFSET(struct __GLshadeRec,fBig ));
  637. pequate("SHADE_dfdy ",OFFSET(struct __GLshadeRec,dfdy ));
  638. pequate("SHADE_dfdx ",OFFSET(struct __GLshadeRec,dfdx ));
  639. pequate("SHADE_modeFlags ",OFFSET(struct __GLshadeRec,modeFlags ));
  640. pequate("SHADE_zbuf ",OFFSET(struct __GLshadeRec,zbuf ));
  641. pequate("SHADE_zbufBig ",OFFSET(struct __GLshadeRec,zbufBig ));
  642. pequate("SHADE_zbufLittle ",OFFSET(struct __GLshadeRec,zbufLittle ));
  643. pequate("SHADE_sbuf ",OFFSET(struct __GLshadeRec,sbuf ));
  644. pequate("SHADE_sbufBig ",OFFSET(struct __GLshadeRec,sbufBig ));
  645. pequate("SHADE_sbufLittle ",OFFSET(struct __GLshadeRec,sbufLittle ));
  646. pequate("SHADE_colors ",OFFSET(struct __GLshadeRec,colors ));
  647. pequate("SHADE_fbcolors ",OFFSET(struct __GLshadeRec,fbcolors ));
  648. pequate("SHADE_stipplePat ",OFFSET(struct __GLshadeRec,stipplePat ));
  649. pequate("SHADE_done ",OFFSET(struct __GLshadeRec,done ));
  650. pequate("SHADE_cfb ",OFFSET(struct __GLshadeRec,cfb ));
  651. pblank();
  652. pblank();
  653. pcomment("__GLpolygonMachineRec structure");
  654. pblank();
  655. pstruct("GLpolygonMachineRec",sizeof(struct __GLpolygonMachineRec));
  656. pblank();
  657. pequate("POLY_stipple ",OFFSET(struct __GLpolygonMachineRec,stipple));
  658. pequate("POLY_shader ",OFFSET(struct __GLpolygonMachineRec,shader ));
  659. pblank();
  660. pblank();
  661. // Stuff from: \nt\private\windows\gdi\opengl\server\inc\buffers.h
  662. pequate("DIB_FORMAT ",DIB_FORMAT);
  663. pcomment("__GLbufferRec structure");
  664. pblank();
  665. pstruct("GLbufferRec",sizeof(struct __GLbufferRec));
  666. pblank();
  667. pequate("BUF_gc ",OFFSET(struct __GLbufferRec,gc ));
  668. pequate("BUF_width ",OFFSET(struct __GLbufferRec,width ));
  669. pequate("BUF_height ",OFFSET(struct __GLbufferRec,height ));
  670. pequate("BUF_depth ",OFFSET(struct __GLbufferRec,depth ));
  671. pequate("BUF_base ",OFFSET(struct __GLbufferRec,base ));
  672. pequate("BUF_size ",OFFSET(struct __GLbufferRec,size ));
  673. pequate("BUF_elementSize ",OFFSET(struct __GLbufferRec,elementSize ));
  674. pequate("BUF_outerWidth ",OFFSET(struct __GLbufferRec,outerWidth ));
  675. pequate("BUF_xOrigin ",OFFSET(struct __GLbufferRec,xOrigin ));
  676. pequate("BUF_yOrigin ",OFFSET(struct __GLbufferRec,yOrigin ));
  677. pequate("BUF_other ",OFFSET(struct __GLbufferRec,other ));
  678. pblank();
  679. pblank();
  680. pcomment("__GLcolorBufferRec structure");
  681. pblank();
  682. pstruct("GLcolorBufferRec",sizeof(struct __GLcolorBufferRec));
  683. pblank();
  684. pequate("CBUF_redMax ",OFFSET(struct __GLcolorBufferRec,redMax ));
  685. pequate("CBUF_greenMax ",OFFSET(struct __GLcolorBufferRec,greenMax ));
  686. pequate("CBUF_blueMax ",OFFSET(struct __GLcolorBufferRec,blueMax ));
  687. pequate("CBUF_iRedScale ",OFFSET(struct __GLcolorBufferRec,iRedScale ));
  688. pequate("CBUF_iGreenScale ",OFFSET(struct __GLcolorBufferRec,iGreenScale));
  689. pequate("CBUF_iBlueScale ",OFFSET(struct __GLcolorBufferRec,iBlueScale ));
  690. pequate("CBUF_iAlphaScale ",OFFSET(struct __GLcolorBufferRec,iAlphaScale));
  691. pequate("CBUF_iRedShift ",OFFSET(struct __GLcolorBufferRec,redShift ));
  692. pequate("CBUF_iGreenShift ",OFFSET(struct __GLcolorBufferRec,greenShift));
  693. pequate("CBUF_iBlueShift ",OFFSET(struct __GLcolorBufferRec,blueShift ));
  694. pequate("CBUF_iAlphaShift ",OFFSET(struct __GLcolorBufferRec,alphaShift));
  695. pequate("CBUF_sourceMask ",OFFSET(struct __GLcolorBufferRec,sourceMask ));
  696. pequate("CBUF_destMask ",OFFSET(struct __GLcolorBufferRec,destMask ));
  697. pequate("CBUF_other ",OFFSET(struct __GLcolorBufferRec,other ));
  698. pblank();
  699. pblank();
  700. // Stuff from: \nt\private\windows\gdi\opengl\server\inc\attrib.h
  701. pcomment("__GLdepthStateRec structure");
  702. pblank();
  703. pstruct("GLdepthStateRec",sizeof(struct __GLdepthStateRec));
  704. pblank();
  705. pequate("DEPTH_testFunc ",OFFSET(struct __GLdepthStateRec,testFunc ));
  706. pequate("DEPTH_writeEnable ",OFFSET(struct __GLdepthStateRec,writeEnable));
  707. pblank();
  708. pblank();
  709. pcomment("__GLattributeRec structure");
  710. pblank();
  711. pstruct("GLattributeRec",sizeof(struct __GLattributeRec));
  712. pblank();
  713. pequate("ATTR_polygonStipple",OFFSET(struct __GLattributeRec,polygonStipple));
  714. pequate("ATTR_depth ",OFFSET(struct __GLattributeRec,depth));
  715. pequate("ATTR_enables ",OFFSET(struct __GLattributeRec,enables));
  716. pequate("ATTR_raster ",OFFSET(struct __GLattributeRec,raster));
  717. pequate("ATTR_hints ",OFFSET(struct __GLattributeRec,hints));
  718. pblank();
  719. pblank();
  720. // Stuff from: \nt\private\windows\gdi\opengl\server\inc\context.h
  721. pcomment("__GLcontextConstantsRec structure");
  722. pblank();
  723. pstruct("GLcontextConstantsRec",sizeof(struct __GLcontextConstantsRec));
  724. pblank();
  725. pequate("CTXCONST_viewportXAdjust",OFFSET(struct __GLcontextConstantsRec,viewportXAdjust));
  726. pequate("CTXCONST_viewportYAdjust",OFFSET(struct __GLcontextConstantsRec,viewportYAdjust));
  727. pequate("CTXCONST_width ",OFFSET(struct __GLcontextConstantsRec,width));
  728. pequate("CTXCONST_height ",OFFSET(struct __GLcontextConstantsRec,height));
  729. pcomment("__GLcontextRec structure");
  730. pblank();
  731. pstruct("GLcontextRec",sizeof(struct __GLcontextRec));
  732. pblank();
  733. pequate("CTX_gcState ",OFFSET(struct __GLcontextRec,gcState ));
  734. pequate("CTX_state ",OFFSET(struct __GLcontextRec,state ));
  735. pequate("CTX_renderMode ",OFFSET(struct __GLcontextRec,renderMode ));
  736. pequate("CTX_modes ",OFFSET(struct __GLcontextRec,modes ));
  737. pequate("CTX_constants ",OFFSET(struct __GLcontextRec,constants ));
  738. pequate("CTX_drawBuffer ",OFFSET(struct __GLcontextRec,drawBuffer ));
  739. pequate("CTX_readBuffer ",OFFSET(struct __GLcontextRec,readBuffer ));
  740. pequate("CTX_polygon ",OFFSET(struct __GLcontextRec,polygon ));
  741. pequate("CTX_pixel ",OFFSET(struct __GLcontextRec,pixel ));
  742. pblank();
  743. pblank();
  744. pcomment("SPANREC structure");
  745. pblank();
  746. pstruct("SPANREC",sizeof(SPANREC));
  747. pblank();
  748. pequate("SPANREC_r ",OFFSET(SPANREC,r ));
  749. pequate("SPANREC_g ",OFFSET(SPANREC,g ));
  750. pequate("SPANREC_b ",OFFSET(SPANREC,b ));
  751. pequate("SPANREC_a ",OFFSET(SPANREC,a ));
  752. pequate("SPANREC_z ",OFFSET(SPANREC,z ));
  753. pblank();
  754. pblank();
  755. pcomment("GENACCEL structure");
  756. pblank();
  757. pstruct("GENACCEL",sizeof(GENACCEL));
  758. pblank();
  759. pequate("SURFACE_TYPE_DIB ",SURFACE_TYPE_DIB);
  760. pblank();
  761. pequate("GENACCEL_spanDelta ",
  762. OFFSET(GENACCEL,spanDelta ));
  763. pequate("GENACCEL_flags ",
  764. OFFSET(GENACCEL,flags ));
  765. pequate("GENACCEL_fastSpanFuncPtr ",
  766. OFFSET(GENACCEL,__fastSpanFuncPtr ));
  767. pequate("GENACCEL_fastFlatSpanFuncPtr ",
  768. OFFSET(GENACCEL,__fastFlatSpanFuncPtr ));
  769. pequate("GENACCEL_fastSmoothSpanFuncPtr ",
  770. OFFSET(GENACCEL,__fastSmoothSpanFuncPtr ));
  771. pequate("GENACCEL_fastZSpanFuncPtr ",
  772. OFFSET(GENACCEL,__fastZSpanFuncPtr));
  773. pblank();
  774. pblank();
  775. #endif
  776. return 0;
  777. }