home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / sgi / misc / 31 < prev    next >
Encoding:
Text File  |  1992-12-20  |  12.9 KB  |  406 lines

  1. Path: sparky!uunet!gumby!destroyer!cs.ubc.ca!lucille.cs.ubc.ca!not-for-mail
  2. From: samuel@cs.ubc.ca (Stephen Samuel)
  3. Newsgroups: comp.sys.sgi.misc
  4. Subject: ginv (was: Is there a command to tell you the amount of sys. mem.?)
  5. Date: 17 Dec 1992 18:19:23 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Lines: 394
  8. Message-ID: <1grcfbINN5eh@lucille.cs.ubc.ca>
  9. References: <BzDG1F.168@news.cso.uiuc.edu> <1gobmmINN6ng@fido.asd.sgi.com>
  10. NNTP-Posting-Host: lucille.cs.ubc.ca
  11.  
  12. jwag@moose.asd.sgi.com (Chris Wagner) writes:
  13.  
  14. >In article <BzDG1F.168@news.cso.uiuc.edu>, th9708@meibm8.cen.uiuc.edu (Todd Lee Henderson) writes:
  15. >|> operator, installer, etc. is long gone.  I would like to find out how much
  16. >|> system memory is in the machine, is there a command for this?  I'm sure it
  17.  
  18. >hinv(1) will tell you lots about your current hardware configuration
  19.  
  20. and ginv(1) will tell you alot about the graphics hardware configuration.
  21. I've found it rather useful, at times.
  22.  
  23. Hmm, it seems that ginv isn't an SGI product, but it is "anywhere" (read
  24. the source code!).
  25.  
  26. Here it is:
  27.  
  28. # -----------------  CUT HERE ----------------- 
  29. # then stuff the remainder thru sh ('sh < this.file').
  30. # file Makefile 
  31. sed -e 's/^\]//' -e '/<$/s/\<$//' << "++ENDFILE++" > Makefile
  32. ]ginv:
  33. ]    cc -o ginv ginv.c -lfm_s -lgl_s -lc_s
  34. ++ENDFILE++
  35. # file ginv.c 
  36. sed -e 's/^\]//' -e '/<$/s/\<$//' << "++ENDFILE++" > ginv.c
  37. ]/*
  38. ] *    ginv.c
  39. ] *
  40. ] *    ginv (Graphics Inventory)
  41. ] *
  42. ] *    v1.0,    May 1991
  43. ] *
  44. ] *    (c) 1991 Rodney Hoinkes
  45. ] *    Centre for Landscape Research
  46. ] *    University of Toronto
  47. ] *    rodney@dgp.utoronto.ca
  48. ] *
  49. ] *    This software is released under the conventions of
  50. ] *    'anyware', meaning you can put it anyware, do anything,
  51. ] *    or rm it as you please as long as you don't try to
  52. ] *    get money for it (good luck if you want to try!).
  53. ] *
  54. ] *    This software was written to test out the getgdesc
  55. ] *    function and to see what different hardware configurations
  56. ] *    look like to a graphics program that really wants to know.
  57. ] *  The following data was gathered from some machines I have
  58. ] *    access to for general info.  <
  59. ] *
  60. ] *    compile with: cc -o ginv ginv.c -lfm_s -lgl_s -lc_s
  61. ] *    stripping the executable will greatly reduce its size
  62. ] *    strip ginv
  63. ] *
  64. ] *    If there is interest, I am working on a version to inform
  65. ] *    the make process.
  66. ] *
  67. ] *    A machine-independent version of psgl (GL->Postscript) is also
  68. ] *    in the debugging stages since the current GL implementation
  69. ] *    differs depending which machine you compile on, not just what
  70. ] *    parameter set you use. This version does not require compile
  71. ] *    definitions, but determines machine at run-time.
  72. ] *
  73. ] *    If you have another type of
  74. ] *    machine NOT listed here, please email me the output from
  75. ] *    this program.
  76. ] *
  77. ] *    IRIS 4D/20TG
  78. ] *
  79. ] *    IRIS 4D Graphics Inventory (ginv v1.0)
  80. ] *    --------------------------------------
  81. ] *    Machine: 4DPIT running IRIX version 3.3
  82. ] *    1 Screen(s) Accessible on this machine.
  83. ] *    
  84. ] *    Screen Resolution:  1280 x 1024 pixels.
  85. ] *    Zbuffer Resolution: 0xFF800000 min  0x7FFFFF max.
  86. ] *    No Accumulation Buffer present.
  87. ] *    Alpha bitplanes in DoubleBuffered: 0, SingleBuffered: 0
  88. ] *    Red   bitplanes in DoubleBuffered: 4, SingleBuffered: 8
  89. ] *    Green bitplanes in DoubleBuffered: 4, SingleBuffered: 8
  90. ] *    Blue  bitplanes in DoubleBuffered: 4, SingleBuffered: 8
  91. ] *    Zbuffer  bitplanes present: 24
  92. ] *    Stencil  bitplanes present: 0
  93. ] *    Overlay  bitplanes present: 4
  94. ] *    PopUp    bitplanes present: 4
  95. ] *    Underlay bitplanes present: 4
  96. ] *    User-defined Clipping Planes present: 0
  97. ] *    antialiased points available in colormap
  98. ] *    antialiased points not available in RGB
  99. ] *    antialiased lines available in colormap
  100. ] *    antialiased lines not available in RGB
  101. ] *    antialiased polygons not available in RGB
  102. ] *    Number of verticies per polygon allowed: 256.
  103. ] *    
  104. ] *    FUNCTIONS AVAILABLE:
  105. ] *    logicop, readsource AUTO/FONT/BACK, readsource ZBUFFER, subpixel points, subpixel lines, subpixel po
  106. ] *    lygons. <
  107. ] *    
  108. ] *    FUNCTIONS NOT AVAILABLE:
  109. ] *    afunction, fogvertex, two-sided lighting, blendfunction, scrbox, stereo, texture-mapping, polymode, <
  110. ] *    64x64 patterns. <
  111. ] *
  112. ] *    IRIS 4D/70GT w/Alpha Planes
  113. ] *
  114. ] *    IRIS 4D Graphics Inventory (ginv v1.0)
  115. ] *    --------------------------------------
  116. ] *    Machine: 4DGT running IRIX version 3.3
  117. ] *    1 Screen(s) Accessible on this machine.
  118. ] *    
  119. ] *    Screen Resolution:  1280 x 1024 pixels.
  120. ] *    Zbuffer Resolution: 0x0 min  0x7FFFFF max.
  121. ] *    No Accumulation Buffer present.
  122. ] *    Alpha bitplanes in DoubleBuffered: 8, SingleBuffered: 8
  123. ] *    Red   bitplanes in DoubleBuffered: 8, SingleBuffered: 8
  124. ] *    Green bitplanes in DoubleBuffered: 8, SingleBuffered: 8
  125. ] *    Blue  bitplanes in DoubleBuffered: 8, SingleBuffered: 8
  126. ] *    Zbuffer  bitplanes present: 23
  127. ] *    Stencil  bitplanes present: 0
  128. ] *    Overlay  bitplanes present: 4
  129. ] *    PopUp    bitplanes present: 2
  130. ] *    Underlay bitplanes present: 4
  131. ] *    User-defined Clipping Planes present: 0
  132. ] *    antialiased points available in colormap
  133. ] *    antialiased points available in RGB
  134. ] *    antialiased lines available in colormap
  135. ] *    antialiased lines available in RGB
  136. ] *    antialiased polygons not available in RGB
  137. ] *    Number of verticies per polygon allowed: 256.
  138. ] *    
  139. ] *    FUNCTIONS AVAILABLE:
  140. ] *    blendfunction, readsource AUTO/FONT/BACK, readsource ZBUFFER, subpixel points, subpixel lines. <
  141. ] *    
  142. ] *    FUNCTIONS NOT AVAILABLE:
  143. ] *    afunction, logicop, fogvertex, two-sided lighting, scrbox, subpixel polygons, stereo, texture-mappin
  144. ] *    g, polymode, 64x64 patterns. <
  145. ] *
  146. ] *    IRIS 4D/310VGX - 5span
  147. ] *
  148. ] *    IRIS 4D Graphics Inventory (ginv v1.0)
  149. ] *    --------------------------------------
  150. ] *    Machine: 4DVGX running IRIX version 3.3
  151. ] *    1 Screen(s) Accessible on this machine.
  152. ] *    
  153. ] *    Screen Resolution:  1280 x 1024 pixels.
  154. ] *    Zbuffer Resolution: 0xFF800000 min  0x7FFFFF max.
  155. ] *    Software Accumulation Buffer with 16 bitplanes per colour component.
  156. ] *    Alpha bitplanes in DoubleBuffered: 8, SingleBuffered: 8
  157. ] *    Red   bitplanes in DoubleBuffered: 8, SingleBuffered: 8
  158. ] *    Green bitplanes in DoubleBuffered: 8, SingleBuffered: 8
  159. ] *    Blue  bitplanes in DoubleBuffered: 8, SingleBuffered: 8
  160. ] *    Zbuffer  bitplanes present: 24
  161. ] *    Stencil  bitplanes present: 8
  162. ] *    Overlay  bitplanes present: 8
  163. ] *    PopUp    bitplanes present: 2
  164. ] *    Underlay bitplanes present: 8
  165. ] *    User-defined Clipping Planes present: 6
  166. ] *    antialiased points available in colormap
  167. ] *    antialiased points available in RGB
  168. ] *    antialiased lines available in colormap
  169. ] *    antialiased lines available in RGB
  170. ] *    antialiased polygons available in RGB
  171. ] *    Number of verticies per polygon allowed: 256.
  172. ] *    
  173. ] *    FUNCTIONS AVAILABLE:
  174. ] *    afunction, logicop, fogvertex, two-sided lighting, blendfunction, readsource AUTO/FONT/BACK, readsou
  175. ] *    rce ZBUFFER, scrbox, subpixel points, subpixel lines, subpixel polygons, stereo, texture-mapping, po
  176. ] *    lymode. <
  177. ] *    
  178. ] *    FUNCTIONS NOT AVAILABLE:
  179. ] *    64x64 patterns. <
  180. ] *
  181. ] */
  182. ]#include <stdio.h>
  183. ]#include <gl.h>
  184. ]#include <device.h>
  185. ]#include <fmclient.h>
  186.  
  187. ]main(argc,argv)
  188. ]int argc;
  189. ]char *argv[];
  190. ]{
  191. ]    register int i,j,c;
  192. ]    short machinetype;
  193. ]    float softversion;
  194. ]    char version[40],software[6],machine[6];
  195. ]    char buf[50][255];
  196. ]    char opbuf[50][40], yes[4000], no[4000];
  197. ]    char op[50];
  198. ]    char showfonts = 0;
  199.  
  200. ]    /* check commandline parameters */
  201. ]    if(argc == 2) {
  202. ]        if(!strcmp(argv[1],"-h")) {
  203. ]            printf("usage: %s [-h] [-f]\n",argv[0]);
  204. ]            printf("\t-h\tThis help menu.\n");
  205. ]            printf("\t-f\tShow list of installed fonts.\n");
  206. ]            exit(1);
  207. ]        }
  208. ]        else if(!strcmp(argv[1],"-f")) showfonts = 1;
  209. ]    }
  210. ]    /* open program window and setup display settings */
  211. ]    noport();
  212.  
  213. ]    foreground();
  214. ]    winopen("SetupCheck");
  215. ]    gconfig();
  216.  
  217. ]    /* get machine information */
  218. ]    gversion(version);
  219. ]    for(i=2;i<strlen(version);++i){
  220. ]        if(version[i]=='-') break;
  221. ]        machine[i-2]=version[i];
  222. ]    }
  223. ]    machine[i-2]='\0';
  224. ]    software[0]=version[i+1];
  225. ]    software[1]=version[i+2];
  226. ]    software[2]=version[i+3];
  227. ]    software[3]='\0';
  228. ]    softversion = atof(software);
  229.  
  230. ]    printf("IRIS 4D Graphics Inventory (ginv v1.0)\n");
  231. ]    printf("--------------------------------------\n");
  232. ]    printf("Machine: %s running IRIX version %s\n",machine,software);
  233.  
  234. ]    printf("%d Screen(s) Accessible on this machine.\n\n",getgdesc(GD_NSCRNS));
  235.  
  236. ]    i = 0;
  237. ]    sprintf(buf[i++],"Screen Resolution:  %d x %d pixels.",getgdesc(GD_XPMAX),getgdesc(GD_YPMAX));
  238. ]    sprintf(buf[i++],"Zbuffer Resolution: 0x%X min  0x%X max.",getgdesc(GD_ZMIN),getgdesc(GD_ZMAX));
  239.  
  240. ]    if(getgdesc(GD_BITS_ACBUF_HW))
  241. ]        sprintf(buf[i++],"Hardware Accumulation Buffer with %d bitplanes per colour component.",getgdesc(GD_BITS_ACBUF_HW));
  242. ]    else if(getgdesc(GD_BITS_ACBUF))
  243. ]        sprintf(buf[i++],"Software Accumulation Buffer with %d bitplanes per colour component.",getgdesc(GD_BITS_ACBUF));
  244. ]    else
  245. ]        strcpy(buf[i++],"No Accumulation Buffer present.");
  246.  
  247. ]    sprintf(buf[i++],"Alpha bitplanes in DoubleBuffered: %d, SingleBuffered: %d",getgdesc(GD_BITS_NORM_DBL_ALPHA),getgdesc(GD_BITS_NORM_SNG_ALPHA));
  248. ]    sprintf(buf[i++],"Red   bitplanes in DoubleBuffered: %d, SingleBuffered: %d",getgdesc(GD_BITS_NORM_DBL_RED),getgdesc(GD_BITS_NORM_SNG_RED));
  249. ]    sprintf(buf[i++],"Green bitplanes in DoubleBuffered: %d, SingleBuffered: %d",getgdesc(GD_BITS_NORM_DBL_GREEN),getgdesc(GD_BITS_NORM_SNG_GREEN));
  250. ]    sprintf(buf[i++],"Blue  bitplanes in DoubleBuffered: %d, SingleBuffered: %d",getgdesc(GD_BITS_NORM_DBL_BLUE),getgdesc(GD_BITS_NORM_SNG_BLUE));
  251. ]    sprintf(buf[i++],"Zbuffer  bitplanes present: %d",getgdesc(GD_BITS_NORM_ZBUFFER));
  252. ]    sprintf(buf[i++],"Stencil  bitplanes present: %d",getgdesc(GD_BITS_STENCIL));
  253. ]    sprintf(buf[i++],"Overlay  bitplanes present: %d",getgdesc(GD_BITS_OVER_SNG_CMODE));
  254. ]    sprintf(buf[i++],"PopUp    bitplanes present: %d",getgdesc(GD_BITS_PUP_SNG_CMODE));
  255. ]    sprintf(buf[i++],"Underlay bitplanes present: %d",getgdesc(GD_BITS_UNDR_SNG_CMODE));
  256. ]    sprintf(buf[i++],"User-defined Clipping Planes present: %d",getgdesc(GD_CLIPPLANES));
  257. ]    if(getgdesc(GD_PNTSMOOTH_CMODE))
  258. ]        sprintf(buf[i++],"antialiased points available in colormap");
  259. ]    else
  260. ]        sprintf(buf[i++],"antialiased points not available in colormap");
  261. ]    if(getgdesc(GD_PNTSMOOTH_RGB))
  262. ]        sprintf(buf[i++],"antialiased points available in RGB");
  263. ]    else
  264. ]        sprintf(buf[i++],"antialiased points not available in RGB");
  265. ]    if(getgdesc(GD_LINESMOOTH_CMODE))
  266. ]        sprintf(buf[i++],"antialiased lines available in colormap");
  267. ]    else
  268. ]        sprintf(buf[i++],"antialiased lines not available in colormap");
  269. ]    if(getgdesc(GD_LINESMOOTH_RGB))
  270. ]        sprintf(buf[i++],"antialiased lines available in RGB");
  271. ]    else
  272. ]        sprintf(buf[i++],"antialiased lines not available in RGB");
  273. ]    if(getgdesc(GD_POLYSMOOTH))
  274. ]        sprintf(buf[i++],"antialiased polygons available in RGB");
  275. ]    else
  276. ]        sprintf(buf[i++],"antialiased polygons not available in RGB");
  277. ]    if(getgdesc(GD_NVERTEX_POLY) == GD_NOLIMIT)
  278. ]        sprintf(buf[i++],"Number of verticies per polygon allowed: Unlimited.");
  279. ]    else
  280. ]        sprintf(buf[i++],"Number of verticies per polygon allowed: %d.",getgdesc(GD_NVERTEX_POLY));
  281.  
  282. ]    j = 0;
  283. ]    sprintf(opbuf[j],"afunction");
  284. ]    if(getgdesc(GD_AFUNCTION))
  285. ]        op[j++] = 1;
  286. ]    else
  287. ]        op[j++] = 0;
  288.  
  289. ]    sprintf(opbuf[j],"logicop");
  290. ]    if(getgdesc(GD_LOGICOP))
  291. ]        op[j++] = 1;
  292. ]    else
  293. ]        op[j++] = 0;
  294.  
  295. ]    sprintf(opbuf[j],"fogvertex");
  296. ]    if(getgdesc(GD_FOGVERTEX))
  297. ]        op[j++] = 1;
  298. ]    else
  299. ]        op[j++] = 0;
  300.  
  301. ]    sprintf(opbuf[j],"two-sided lighting");
  302. ]    if(getgdesc(GD_LIGHTING_TWOSIDE))
  303. ]        op[j++] = 1;
  304. ]    else
  305. ]        op[j++] = 0;
  306.  
  307. ]    sprintf(opbuf[j],"blendfunction");
  308. ]    if(getgdesc(GD_BLEND))
  309. ]        op[j++] = 1;
  310. ]    else
  311. ]        op[j++] = 0;
  312.  
  313. ]    sprintf(opbuf[j],"readsource AUTO/FONT/BACK");
  314. ]    if(getgdesc(GD_READSOURCE))
  315. ]        op[j++] = 1;
  316. ]    else
  317. ]        op[j++] = 0;
  318.  
  319. ]    sprintf(opbuf[j],"readsource ZBUFFER");
  320. ]    if(getgdesc(GD_READSOURCE_ZBUFFER))
  321. ]        op[j++] = 1;
  322. ]    else
  323. ]        op[j++] = 0;
  324.  
  325. ]    sprintf(opbuf[j],"scrbox");
  326. ]    if(getgdesc(GD_SCRBOX))
  327. ]        op[j++] = 1;
  328. ]    else
  329. ]        op[j++] = 0;
  330.  
  331. ]    sprintf(opbuf[j],"subpixel points");
  332. ]    if(getgdesc(GD_SUBPIXEL_PNT))
  333. ]        op[j++] = 1;
  334. ]    else
  335. ]        op[j++] = 0;
  336.  
  337. ]    sprintf(opbuf[j],"subpixel lines");
  338. ]    if(getgdesc(GD_SUBPIXEL_LINE))
  339. ]        op[j++] = 1;
  340. ]    else
  341. ]        op[j++] = 0;
  342.  
  343. ]    sprintf(opbuf[j],"subpixel polygons");
  344. ]    if(getgdesc(GD_SUBPIXEL_POLY))
  345. ]        op[j++] = 1;
  346. ]    else
  347. ]        op[j++] = 0;
  348.  
  349. ]    sprintf(opbuf[j],"stereo");
  350. ]    if(getgdesc(GD_STEREO))
  351. ]        op[j++] = 1;
  352. ]    else
  353. ]        op[j++] = 0;
  354.  
  355. ]    sprintf(opbuf[j],"texture-mapping");
  356. ]    if(getgdesc(GD_TEXTURE))
  357. ]        op[j++] = 1;
  358. ]    else
  359. ]        op[j++] = 0;
  360.  
  361. ]    sprintf(opbuf[j],"polymode");
  362. ]    if(getgdesc(GD_POLYMODE))
  363. ]        op[j++] = 1;
  364. ]    else
  365. ]        op[j++] = 0;
  366.  
  367. ]    sprintf(opbuf[j],"64x64 patterns");
  368. ]    if(getgdesc(GD_PATSIZE_64))
  369. ]        op[j++] = 1;
  370. ]    else
  371. ]        op[j++] = 0;
  372.  
  373.  
  374.  
  375. ]    for(c=0;c<j;++c) {
  376. ]        if(op[c]) {
  377. ]            strcat(yes,opbuf[c]);
  378. ]            strcat(yes,", ");
  379. ]        } else {
  380. ]            strcat(no,opbuf[c]);
  381. ]            strcat(no,", ");
  382. ]        }
  383. ]    }
  384.  
  385. ]    for(c=0;c<i;++c) puts(buf[c]);
  386.  
  387. ]    yes[strlen(yes)-2] = '.';
  388. ]    no[strlen(no)-2] = '.';
  389. ]    printf("\nFUNCTIONS AVAILABLE:\n");
  390. ]    puts(yes);
  391. ]    printf("\nFUNCTIONS NOT AVAILABLE:\n");
  392. ]    puts(no);
  393.  
  394.  
  395. ]    if(showfonts) {
  396. ]        printf("\nINSTALLED FONTS\n\n");
  397. ]        fmenumerate(puts);
  398. ]    }
  399. ]}
  400. ++ENDFILE++
  401. -- 
  402. -- 
  403. Stephen Samuel         (604)822-9248        samuel@cs.ubc.ca
  404. The first prerequisite to winning is playing the game.
  405.