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.

302 lines
6.1 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 CallRasterPos(void)
  21. {
  22. float x, y, z, w;
  23. x = 1.0;
  24. y = 1.0;
  25. z = 1.0;
  26. w = 1.0;
  27. Output("glRasterPos2s, ");
  28. Output("glRasterPos2sv, ");
  29. Output("glRasterPos2i, ");
  30. Output("glRasterPos2iv, ");
  31. Output("glRasterPos2f, ");
  32. Output("glRasterPos2fv, ");
  33. Output("glRasterPos2d, ");
  34. Output("glRasterPos2dv, ");
  35. Output("glRasterPos3s, ");
  36. Output("glRasterPos3sv, ");
  37. Output("glRasterPos3i, ");
  38. Output("glRasterPos3iv, ");
  39. Output("glRasterPos3f, ");
  40. Output("glRasterPos3fv, ");
  41. Output("glRasterPos3d, ");
  42. Output("glRasterPos3dv, ");
  43. Output("glRasterPos4s, ");
  44. Output("glRasterPos4sv, ");
  45. Output("glRasterPos4i, ");
  46. Output("glRasterPos4iv, ");
  47. Output("glRasterPos4f, ");
  48. Output("glRasterPos4fv, ");
  49. Output("glRasterPos4d, ");
  50. Output("glRasterPos4dv\n");
  51. glRasterPos2s((GLshort)x, (GLshort)y);
  52. {
  53. GLshort buf[2];
  54. buf[0] = (GLshort)x;
  55. buf[1] = (GLshort)y;
  56. glRasterPos2sv(buf);
  57. }
  58. glRasterPos2i((GLint)x, (GLint)y);
  59. {
  60. GLint buf[2];
  61. buf[0] = (GLint)x;
  62. buf[1] = (GLint)y;
  63. glRasterPos2iv(buf);
  64. }
  65. glRasterPos2f((GLfloat)x, (GLfloat)y);
  66. {
  67. GLfloat buf[2];
  68. buf[0] = (GLfloat)x;
  69. buf[1] = (GLfloat)y;
  70. glRasterPos2fv(buf);
  71. }
  72. glRasterPos2d((GLdouble)x, (GLdouble)y);
  73. {
  74. GLdouble buf[2];
  75. buf[0] = (GLdouble)x;
  76. buf[1] = (GLdouble)y;
  77. glRasterPos2dv(buf);
  78. }
  79. glRasterPos3s((GLshort)x, (GLshort)y, (GLshort)z);
  80. {
  81. GLshort buf[3];
  82. buf[0] = (GLshort)x;
  83. buf[1] = (GLshort)y;
  84. buf[2] = (GLshort)z;
  85. glRasterPos3sv(buf);
  86. }
  87. glRasterPos3i((GLint)x, (GLint)y, (GLint)z);
  88. {
  89. GLint buf[3];
  90. buf[0] = (GLint)x;
  91. buf[1] = (GLint)y;
  92. buf[2] = (GLint)z;
  93. glRasterPos3iv(buf);
  94. }
  95. glRasterPos3f((GLfloat)x, (GLfloat)y, (GLfloat)z);
  96. {
  97. GLfloat buf[3];
  98. buf[0] = (GLfloat)x;
  99. buf[1] = (GLfloat)y;
  100. buf[2] = (GLfloat)z;
  101. glRasterPos3fv(buf);
  102. }
  103. glRasterPos3d((GLdouble)x, (GLdouble)y, (GLdouble)z);
  104. {
  105. GLdouble buf[3];
  106. buf[0] = (GLdouble)x;
  107. buf[1] = (GLdouble)y;
  108. buf[2] = (GLdouble)z;
  109. glRasterPos3dv(buf);
  110. }
  111. glRasterPos4s((GLshort)x, (GLshort)y, (GLshort)z, (GLshort)w);
  112. {
  113. GLshort buf[4];
  114. buf[0] = (GLshort)x;
  115. buf[1] = (GLshort)y;
  116. buf[2] = (GLshort)z;
  117. buf[3] = (GLshort)w;
  118. glRasterPos4sv(buf);
  119. }
  120. glRasterPos4i((GLint)x, (GLint)y, (GLint)z, (GLint)w);
  121. {
  122. GLint buf[4];
  123. buf[0] = (GLint)x;
  124. buf[1] = (GLint)y;
  125. buf[2] = (GLint)z;
  126. buf[3] = (GLint)w;
  127. glRasterPos4iv(buf);
  128. }
  129. glRasterPos4f((GLfloat)x, (GLfloat)y, (GLfloat)z, (GLfloat)w);
  130. {
  131. GLfloat buf[4];
  132. buf[0] = (GLfloat)x;
  133. buf[1] = (GLfloat)y;
  134. buf[2] = (GLfloat)z;
  135. buf[3] = (GLfloat)w;
  136. glRasterPos4fv(buf);
  137. }
  138. glRasterPos4d((GLdouble)x, (GLdouble)y, (GLdouble)z, (GLdouble)w);
  139. {
  140. GLdouble buf[4];
  141. buf[0] = (GLdouble)x;
  142. buf[1] = (GLdouble)y;
  143. buf[2] = (GLdouble)z;
  144. buf[3] = (GLdouble)w;
  145. glRasterPos4dv(buf);
  146. }
  147. Output("\n");
  148. }
  149. void CallReadBuffer(void)
  150. {
  151. long i;
  152. Output("glReadBuffer\n");
  153. for (i = 0; enum_ReadBufferMode[i].value != -1; i++) {
  154. Output("\t%s\n", enum_ReadBufferMode[i].name);
  155. glReadBuffer(enum_ReadBufferMode[i].value);
  156. ProbeEnum();
  157. }
  158. Output("\n");
  159. }
  160. void CallReadDrawPixels(void)
  161. {
  162. float buf[100];
  163. long i, j;
  164. Output("glReadPixels, ");
  165. Output("glDrawPixels\n");
  166. for (i = 0; enum_PixelFormat[i].value != -1; i++) {
  167. for (j = 0; enum_PixelType[j].value != -1; j++) {
  168. if (enum_PixelType[j].value == GL_BITMAP) {
  169. continue;
  170. }
  171. Output("\t%s, %s\n", enum_PixelFormat[i].name, enum_PixelType[j].name);
  172. glReadPixels(0, 0, 1, 1, enum_PixelFormat[i].value, enum_PixelType[j].value, (GLubyte *)buf);
  173. glDrawPixels(1, 1, enum_PixelFormat[i].value, enum_PixelType[j].value, (GLubyte *)buf);
  174. ProbeEnum();
  175. }
  176. }
  177. Output("\n");
  178. }
  179. void CallRect(void)
  180. {
  181. float x1, y1, x2, y2;
  182. x1 = 1.0;
  183. y1 = 1.0;
  184. x2 = 1.0;
  185. y2 = 1.0;
  186. Output("glRects, ");
  187. Output("glRectsv, ");
  188. Output("glRecti, ");
  189. Output("glRectiv, ");
  190. Output("glRectf, ");
  191. Output("glRectfv, ");
  192. Output("glRectd, ");
  193. Output("glRectdv\n");
  194. glRects((GLshort)x1, (GLshort)y1, (GLshort)x2, (GLshort)y2);
  195. {
  196. GLshort buf1[2], buf2[2];
  197. buf1[0] = (GLshort)x1;
  198. buf1[1] = (GLshort)y1;
  199. buf2[0] = (GLshort)x2;
  200. buf2[1] = (GLshort)y2;
  201. glRectsv(buf1, buf2);
  202. }
  203. glRecti((GLint)x1, (GLint)y1, (GLint)x2, (GLint)y2);
  204. {
  205. GLint buf1[2], buf2[2];
  206. buf1[0] = (GLint)x1;
  207. buf1[1] = (GLint)y1;
  208. buf2[0] = (GLint)x2;
  209. buf2[1] = (GLint)y2;
  210. glRectiv(buf1, buf2);
  211. }
  212. glRectf((GLfloat)x1, (GLfloat)y1, (GLfloat)x2, (GLfloat)y2);
  213. {
  214. GLfloat buf1[2], buf2[2];
  215. buf1[0] = (GLfloat)x1;
  216. buf1[1] = (GLfloat)y1;
  217. buf2[0] = (GLfloat)x2;
  218. buf2[1] = (GLfloat)y2;
  219. glRectfv(buf1, buf2);
  220. }
  221. glRectd((GLdouble)x1, (GLdouble)y1, (GLdouble)x2, (GLdouble)y2);
  222. {
  223. GLdouble buf1[2], buf2[2];
  224. buf1[0] = (GLdouble)x1;
  225. buf1[1] = (GLdouble)y1;
  226. buf2[0] = (GLdouble)x2;
  227. buf2[1] = (GLdouble)y2;
  228. glRectdv(buf1, buf2);
  229. }
  230. Output("\n");
  231. }
  232. void CallRenderMode(void)
  233. {
  234. GLint i, j;
  235. Output("glRenderMode\n");
  236. for (i = 0; enum_RenderingMode[i].value != -1; i++) {
  237. Output("\t%s\n", enum_RenderingMode[i].name);
  238. j = glRenderMode(enum_RenderingMode[i].value);
  239. ProbeEnum();
  240. }
  241. Output("\n");
  242. }
  243. void CallRotate(void)
  244. {
  245. Output("glRotatef, ");
  246. Output("glRotated\n");
  247. glRotatef(0.0, 1, 1, 1);
  248. glRotated(0.0, 1, 1, 1);
  249. Output("\n");
  250. }