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.

234 lines
5.9 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 CallMap1(void)
  21. {
  22. long i;
  23. Output("glMap1f, ");
  24. Output("glMap1d\n");
  25. for (i = 0; enum_MapTarget[i].value != -1; i++) {
  26. if (enum_MapTarget[i].value == GL_MAP2_COLOR_4) {
  27. continue;
  28. } else if (enum_MapTarget[i].value == GL_MAP2_INDEX) {
  29. continue;
  30. } else if (enum_MapTarget[i].value == GL_MAP2_NORMAL) {
  31. continue;
  32. } else if (enum_MapTarget[i].value == GL_MAP2_TEXTURE_COORD_1) {
  33. continue;
  34. } else if (enum_MapTarget[i].value == GL_MAP2_TEXTURE_COORD_2) {
  35. continue;
  36. } else if (enum_MapTarget[i].value == GL_MAP2_TEXTURE_COORD_3) {
  37. continue;
  38. } else if (enum_MapTarget[i].value == GL_MAP2_TEXTURE_COORD_4) {
  39. continue;
  40. } else if (enum_MapTarget[i].value == GL_MAP2_VERTEX_3) {
  41. continue;
  42. } else if (enum_MapTarget[i].value == GL_MAP2_VERTEX_4) {
  43. continue;
  44. }
  45. Output("\t%s\n", enum_MapTarget[i].name);
  46. {
  47. static GLfloat buf[] = {
  48. 1.0, 0.0, 0.0, 1.0,
  49. 0.0, 1.0, 0.0, 1.0,
  50. };
  51. glMap1f(enum_MapTarget[i].value, 0.0, 1.0, 4, 2, buf);
  52. }
  53. {
  54. static GLdouble buf[] = {
  55. 1.0, 0.0, 0.0, 1.0,
  56. 0.0, 1.0, 0.0, 1.0,
  57. };
  58. glMap1d(enum_MapTarget[i].value, 0.0, 1.0, 4, 2, buf);
  59. }
  60. ProbeEnum();
  61. }
  62. Output("\n");
  63. }
  64. void CallMap2(void)
  65. {
  66. long i;
  67. Output("glMap2f, ");
  68. Output("glMap2d\n");
  69. for (i = 0; enum_MapTarget[i].value != -1; i++) {
  70. if (enum_MapTarget[i].value == GL_MAP1_COLOR_4) {
  71. continue;
  72. } else if (enum_MapTarget[i].value == GL_MAP1_INDEX) {
  73. continue;
  74. } else if (enum_MapTarget[i].value == GL_MAP1_NORMAL) {
  75. continue;
  76. } else if (enum_MapTarget[i].value == GL_MAP1_TEXTURE_COORD_1) {
  77. continue;
  78. } else if (enum_MapTarget[i].value == GL_MAP1_TEXTURE_COORD_2) {
  79. continue;
  80. } else if (enum_MapTarget[i].value == GL_MAP1_TEXTURE_COORD_3) {
  81. continue;
  82. } else if (enum_MapTarget[i].value == GL_MAP1_TEXTURE_COORD_4) {
  83. continue;
  84. } else if (enum_MapTarget[i].value == GL_MAP1_VERTEX_3) {
  85. continue;
  86. } else if (enum_MapTarget[i].value == GL_MAP1_VERTEX_4) {
  87. continue;
  88. }
  89. Output("\t%s\n", enum_MapTarget[i].name);
  90. {
  91. static GLfloat buf[] = {
  92. 1.0, 0.0, 0.0, 1.0,
  93. 0.0, 1.0, 0.0, 1.0,
  94. 1.0, 0.0, 0.0, 1.0,
  95. 0.0, 1.0, 0.0, 1.0
  96. };
  97. glMap2f(enum_MapTarget[i].value, 0.0, 1.0, 4, 2, 0.0, 1.0, 4, 2, buf);
  98. }
  99. {
  100. static GLdouble buf[] = {
  101. 1.0, 0.0, 0.0, 1.0,
  102. 0.0, 1.0, 0.0, 1.0,
  103. 1.0, 0.0, 0.0, 1.0,
  104. 0.0, 1.0, 0.0, 1.0
  105. };
  106. glMap2d(enum_MapTarget[i].value, 0.0, 1.0, 4, 2, 0.0, 1.0, 4, 2, buf);
  107. }
  108. ProbeEnum();
  109. }
  110. Output("\n");
  111. }
  112. void CallMapGrid1(void)
  113. {
  114. Output("glMapGrid1f, ");
  115. Output("glMapGrid1d\n");
  116. glMapGrid1f(1, 0.0, 1.0);
  117. glMapGrid1d(1, 0.0, 1.0);
  118. Output("\n");
  119. }
  120. void CallMapGrid2(void)
  121. {
  122. Output("glMapGrid2f, ");
  123. Output("glMapGrid2d\n");
  124. glMapGrid2f(1, 0.0, 1.0, 1, 0.0, 1.0);
  125. glMapGrid2d(1, 0.0, 1.0, 1, 0.0, 1.0);
  126. Output("\n");
  127. }
  128. void CallMaterial(void)
  129. {
  130. long i, j;
  131. Output("glMateriali, ");
  132. Output("glMaterialf\n");
  133. for (i = 0; enum_MaterialFace[i].value != -1; i++) {
  134. for (j = 0; enum_MaterialParameter[j].value != -1; j++) {
  135. if (enum_MaterialParameter[j].value == GL_COLOR_INDEXES) {
  136. continue;
  137. } else if (enum_MaterialParameter[j].value == GL_EMISSION) {
  138. continue;
  139. } else if (enum_MaterialParameter[j].value == GL_AMBIENT) {
  140. continue;
  141. } else if (enum_MaterialParameter[j].value == GL_DIFFUSE) {
  142. continue;
  143. } else if (enum_MaterialParameter[j].value == GL_SPECULAR) {
  144. continue;
  145. } else if (enum_MaterialParameter[j].value == GL_AMBIENT_AND_DIFFUSE) {
  146. continue;
  147. }
  148. Output("\t%s, %s\n", enum_MaterialFace[i].name, enum_MaterialParameter[j].name);
  149. glMateriali(enum_MaterialFace[i].value, enum_MaterialParameter[j].value, 0);
  150. glMaterialf(enum_MaterialFace[i].value, enum_MaterialParameter[j].value, 0.0);
  151. ProbeEnum();
  152. }
  153. }
  154. Output("\n");
  155. Output("glMaterialiv, ");
  156. Output("glMaterialfv\n");
  157. for (i = 0; enum_MaterialFace[i].value != -1; i++) {
  158. for (j = 0; enum_MaterialParameter[j].value != -1; j++) {
  159. Output("\t%s, %s\n", enum_MaterialFace[i].name, enum_MaterialParameter[j].name);
  160. {
  161. static GLint buf[] = {
  162. 0, 0, 0, 0
  163. };
  164. glMaterialiv(enum_MaterialFace[i].value, enum_MaterialParameter[j].value, buf);
  165. }
  166. {
  167. static GLfloat buf[] = {
  168. 0.0, 0.0, 0.0, 0.0
  169. };
  170. glMaterialfv(enum_MaterialFace[i].value, enum_MaterialParameter[j].value, buf);
  171. }
  172. ProbeEnum();
  173. }
  174. }
  175. Output("\n");
  176. }
  177. void CallMatrixMode(void)
  178. {
  179. long i;
  180. Output("glMatrixMode\n");
  181. for (i = 0; enum_MatrixMode[i].value != -1; i++) {
  182. Output("\t%s\n", enum_MatrixMode[i].name);
  183. glMatrixMode(enum_MatrixMode[i].value);
  184. ProbeEnum();
  185. }
  186. Output("\n");
  187. }
  188. void CallMultMatrix(void)
  189. {
  190. Output("glMultMatrixf, ");
  191. Output("glMultMatrixd\n");
  192. {
  193. static GLfloat buf[] = {
  194. 1.0, 0.0, 0.0, 0.0,
  195. 0.0, 1.0, 0.0, 0.0,
  196. 0.0, 0.0, 1.0, 0.0,
  197. 0.0, 0.0, 0.0, 1.0
  198. };
  199. glMultMatrixf(buf);
  200. }
  201. {
  202. static GLdouble buf[] = {
  203. 1.0, 0.0, 0.0, 0.0,
  204. 0.0, 1.0, 0.0, 0.0,
  205. 0.0, 0.0, 1.0, 0.0,
  206. 0.0, 0.0, 0.0, 1.0
  207. };
  208. glMultMatrixd(buf);
  209. }
  210. Output("\n");
  211. }