Windows NT 4.0 source code leak
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.

383 lines
8.4 KiB

5 years ago
  1. /*
  2. ** Copyright 1992, 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. #include <windows.h>
  18. #include <GL/gl.h>
  19. #include "shell.h"
  20. void CallCallList(void)
  21. {
  22. Output("glCallList\n");
  23. glCallList(1);
  24. Output("\n");
  25. }
  26. void CallCallLists(void)
  27. {
  28. static unsigned char buf[8] = {
  29. 0, 0, 0, 0, 0, 0, 0, 0
  30. };
  31. long i;
  32. Output("glCallLists\n");
  33. for (i = 0; enum_ListNameType[i].value != -1; i++) {
  34. Output("\t%s\n", enum_ListNameType[i].name);
  35. glCallLists(1, enum_ListNameType[i].value, buf);
  36. ProbeEnum();
  37. }
  38. Output("\n");
  39. }
  40. void CallClear(void)
  41. {
  42. long i;
  43. Output("glClear\n");
  44. for (i = 0; enum_ClearBufferMask[i].value != -1; i++) {
  45. Output("\t%s\n", enum_ClearBufferMask[i].name);
  46. glClear(enum_ClearBufferMask[i].value);
  47. ProbeEnum();
  48. }
  49. Output("\n");
  50. }
  51. void CallClearAccum(void)
  52. {
  53. Output("glClearAccum\n");
  54. glClearAccum(0.0, 0.0, 0.0, 0.0);
  55. Output("\n");
  56. }
  57. void CallClearColor(void)
  58. {
  59. Output("glClearColor\n");
  60. glClearColor(0.0, 0.0, 0.0, 1.0);
  61. Output("\n");
  62. }
  63. void CallClearDepth(void)
  64. {
  65. Output("glClearDepth\n");
  66. glClearDepth(0);
  67. Output("\n");
  68. }
  69. void CallClearIndex(void)
  70. {
  71. Output("glClearIndex\n");
  72. glClearIndex(0.0);
  73. Output("\n");
  74. }
  75. void CallClearStencil(void)
  76. {
  77. Output("glClearStencil\n");
  78. glClearStencil(0);
  79. Output("\n");
  80. }
  81. void CallClipPlane(void)
  82. {
  83. static GLdouble buf[] = {
  84. 1.0, 1.0, 1.0, 1.0
  85. };
  86. long i;
  87. Output("glClipPlane\n");
  88. for (i = 0; enum_ClipPlaneName[i].value != -1; i++) {
  89. Output("\t%s\n", enum_ClipPlaneName[i].name);
  90. glClipPlane(enum_ClipPlaneName[i].value, buf);
  91. ProbeEnum();
  92. }
  93. Output("\n");
  94. }
  95. void CallColor(void)
  96. {
  97. GLfloat r, g, b, a;
  98. r = 1.0;
  99. g = 1.0;
  100. b = 1.0;
  101. a = 1.0;
  102. Output("glColor3b, ");
  103. Output("glColor3bv, ");
  104. Output("glColor3ub, ");
  105. Output("glColor3ubv, ");
  106. Output("glColor3s, ");
  107. Output("glColor3sv, ");
  108. Output("glColor3us, ");
  109. Output("glColor3usv, ");
  110. Output("glColor3i, ");
  111. Output("glColor3iv, ");
  112. Output("glColor3ui, ");
  113. Output("glColor3uiv, ");
  114. Output("glColor3f, ");
  115. Output("glColor3fv, ");
  116. Output("glColor3d, ");
  117. Output("glColor3dv, ");
  118. Output("glColor4b, ");
  119. Output("glColor4bv, ");
  120. Output("glColor4ub, ");
  121. Output("glColor4ubv, ");
  122. Output("glColor4s, ");
  123. Output("glColor4sv, ");
  124. Output("glColor4us, ");
  125. Output("glColor4usv, ");
  126. Output("glColor4i, ");
  127. Output("glColor4iv, ");
  128. Output("glColor4ui, ");
  129. Output("glColor4uiv, ");
  130. Output("glColor4f, ");
  131. Output("glColor4fv, ");
  132. Output("glColor4d, ");
  133. Output("glColor4dv\n");
  134. glColor3b((GLbyte)(r*255.0), (GLbyte)(g*255.0), (GLbyte)(b*255.0));
  135. {
  136. GLbyte buf[3];
  137. buf[0] = (GLbyte)(r * 255.0);
  138. buf[1] = (GLbyte)(g * 255.0);
  139. buf[2] = (GLbyte)(b * 255.0);
  140. glColor3bv(buf);
  141. }
  142. glColor3ub((GLubyte)(r*255.0), (GLubyte)(g*255.0), (GLubyte)(b*255.0));
  143. {
  144. GLubyte buf[3];
  145. buf[0] = (GLubyte)(r * 255.0);
  146. buf[1] = (GLubyte)(g * 255.0);
  147. buf[2] = (GLubyte)(b * 255.0);
  148. glColor3ubv(buf);
  149. }
  150. glColor3s((GLshort)(r*65535.0), (GLshort)(g*65535.0), (GLshort)(b*65535.0));
  151. {
  152. GLshort buf[3];
  153. buf[0] = (GLshort)(r * 65535.0);
  154. buf[1] = (GLshort)(g * 65535.0);
  155. buf[2] = (GLshort)(b * 65535.0);
  156. glColor3sv(buf);
  157. }
  158. glColor3us((GLushort)(r*65535.0), (GLushort)(g*65535.0), (GLushort)(b*65535.0));
  159. {
  160. GLushort buf[3];
  161. buf[0] = (GLushort)(r * 65535.0);
  162. buf[1] = (GLushort)(g * 65535.0);
  163. buf[2] = (GLushort)(b * 65535.0);
  164. glColor3usv(buf);
  165. }
  166. glColor3i((GLint)(r*65535.0), (GLint)(g*65535.0), (GLint)(b*65535.0));
  167. {
  168. GLint buf[3];
  169. buf[0] = (GLint)(r * 65535.0);
  170. buf[1] = (GLint)(g * 65535.0);
  171. buf[2] = (GLint)(b * 65535.0);
  172. glColor3iv(buf);
  173. }
  174. glColor3ui((GLuint)(r*65535.0), (GLuint)(g*65535.0), (GLuint)(b*65535.0));
  175. {
  176. GLuint buf[3];
  177. buf[0] = (GLuint)(r * 65535.0);
  178. buf[1] = (GLuint)(g * 65535.0);
  179. buf[2] = (GLuint)(b * 65535.0);
  180. glColor3uiv((GLuint *)buf);
  181. }
  182. glColor3f((GLfloat)(r*1.0), (GLfloat)(g*1.0), (GLfloat)(b*1.0));
  183. {
  184. GLfloat buf[3];
  185. buf[0] = (GLfloat)(r * 1.0);
  186. buf[1] = (GLfloat)(g * 1.0);
  187. buf[2] = (GLfloat)(b * 1.0);
  188. glColor3fv(buf);
  189. }
  190. glColor3d((GLdouble)(r*1.0), (GLdouble)(g*1.0), (GLdouble)(b*1.0));
  191. {
  192. GLdouble buf[3];
  193. buf[0] = (GLdouble)(r * 1.0);
  194. buf[1] = (GLdouble)(g * 1.0);
  195. buf[2] = (GLdouble)(b * 1.0);
  196. glColor3dv(buf);
  197. }
  198. glColor4b((GLbyte)(r*255.0), (GLbyte)(g*255.0), (GLbyte)(b*255.0), (GLbyte)(a*255.0));
  199. {
  200. GLbyte buf[4];
  201. buf[0] = (GLbyte)(r * 255.0);
  202. buf[1] = (GLbyte)(g * 255.0);
  203. buf[2] = (GLbyte)(b * 255.0);
  204. buf[3] = (GLbyte)(a * 255.0);
  205. glColor4bv(buf);
  206. }
  207. glColor4ub((GLubyte)(r*255.0), (GLubyte)(g*255.0), (GLubyte)(b*255.0), (GLubyte)(a*255.0));
  208. {
  209. GLubyte buf[4];
  210. buf[0] = (GLubyte)(r * 255.0);
  211. buf[1] = (GLubyte)(g * 255.0);
  212. buf[2] = (GLubyte)(b * 255.0);
  213. buf[3] = (GLubyte)(a * 255.0);
  214. glColor4ubv(buf);
  215. }
  216. glColor4s((GLshort)(r*65535.0), (GLshort)(g*65535.0), (GLshort)(b*65535.0), (GLshort)(a*65535.0));
  217. {
  218. GLshort buf[4];
  219. buf[0] = (GLshort)(r * 65535.0);
  220. buf[1] = (GLshort)(g * 65535.0);
  221. buf[2] = (GLshort)(b * 65535.0);
  222. buf[3] = (GLshort)(a * 65535.0);
  223. glColor4sv(buf);
  224. }
  225. glColor4us((GLushort)(r*65535.0), (GLushort)(g*65535.0), (GLushort)(b*65535.0), (GLushort)(a*65535.0));
  226. {
  227. GLushort buf[4];
  228. buf[0] = (GLushort)(r * 65535.0);
  229. buf[1] = (GLushort)(g * 65535.0);
  230. buf[2] = (GLushort)(b * 65535.0);
  231. buf[3] = (GLushort)(a * 65535.0);
  232. glColor4usv(buf);
  233. }
  234. glColor4i((GLint)(r*65535.0), (GLint)(g*65535.0), (GLint)(b*65535.0), (GLint)(a*65535.0));
  235. {
  236. GLint buf[4];
  237. buf[0] = (GLint)(r * 65535.0);
  238. buf[1] = (GLint)(g * 65535.0);
  239. buf[2] = (GLint)(b * 65535.0);
  240. buf[3] = (GLint)(a * 65535.0);
  241. glColor4iv(buf);
  242. }
  243. glColor4ui((GLuint)(r*65535.0), (GLuint)(g*65535.0), (GLuint)(b*65535.0), (GLuint)(a*65535.0));
  244. {
  245. GLuint buf[4];
  246. buf[0] = (GLuint)(r * 65535.0);
  247. buf[1] = (GLuint)(g * 65535.0);
  248. buf[2] = (GLuint)(b * 65535.0);
  249. buf[3] = (GLuint)(a * 65535.0);
  250. glColor4uiv((GLuint *)buf);
  251. }
  252. glColor4f((GLfloat)(r*1.0), (GLfloat)(g*1.0), (GLfloat)(b*1.0), (GLfloat)(a*1.0));
  253. {
  254. GLfloat buf[4];
  255. buf[0] = (GLfloat)(r * 1.0);
  256. buf[1] = (GLfloat)(g * 1.0);
  257. buf[2] = (GLfloat)(b * 1.0);
  258. buf[3] = (GLfloat)(a * 1.0);
  259. glColor4fv(buf);
  260. }
  261. glColor4d((GLdouble)(r*1.0), (GLdouble)(g*1.0), (GLdouble)(b*1.0), (GLdouble)(a*1.0));
  262. {
  263. GLdouble buf[4];
  264. buf[0] = (GLdouble)(r * 1.0);
  265. buf[1] = (GLdouble)(g * 1.0);
  266. buf[2] = (GLdouble)(b * 1.0);
  267. buf[3] = (GLdouble)(a * 1.0);
  268. glColor4dv(buf);
  269. }
  270. Output("\n");
  271. }
  272. void CallColorMask(void)
  273. {
  274. Output("glColorMask\n");
  275. glColorMask(0, 0, 0, 1);
  276. Output("\n");
  277. }
  278. void CallColorMaterial(void)
  279. {
  280. long i, j;
  281. Output("glColorMaterial\n");
  282. for (i = 0; enum_MaterialFace[i].value != -1; i++) {
  283. for (j = 0; enum_MaterialParameter[j].value != -1; j++) {
  284. if (enum_MaterialParameter[j].value == GL_COLOR_INDEXES) {
  285. continue;
  286. } else if (enum_MaterialParameter[j].value == GL_SHININESS) {
  287. continue;
  288. }
  289. Output("\t%s, %s\n", enum_MaterialFace[i].name, enum_MaterialParameter[j].name);
  290. glColorMaterial(enum_MaterialFace[i].value, enum_MaterialParameter[j].value);
  291. ProbeEnum();
  292. }
  293. }
  294. Output("\n");
  295. }
  296. void CallCopyPixels(void)
  297. {
  298. long i;
  299. Output("glCopyPixels\n");
  300. for (i = 0; enum_PixelCopyType[i].value != -1; i++) {
  301. Output("\t%s\n", enum_PixelCopyType[i].name);
  302. glCopyPixels(0, 0, 10, 10, enum_PixelCopyType[i].value);
  303. ProbeEnum();
  304. }
  305. Output("\n");
  306. }
  307. void CallCullFace(void)
  308. {
  309. long i;
  310. Output("glCullFace\n");
  311. for (i = 0; enum_CullFaceMode[i].value != -1; i++) {
  312. Output("\t%s\n", enum_CullFaceMode[i].name);
  313. glCullFace(enum_CullFaceMode[i].value);
  314. ProbeEnum();
  315. }
  316. Output("\n");
  317. }