Graphics library examples

Thant Tessman thant at horus.esd.sgi.com
Sat Mar 10 01:47:03 AEST 1990


In article <9003082054.aa06458 at VMB.BRL.MIL>, butler at BRL.MIL ("Lee A.
Butler") writes:
> This evening I sat down at the IRIS to start learning to use the graphics
> library. On page 1-5 of the "Graphics Library Programming Guide" is the
> program "red.c" which I typed in verbatim:
> 
> #include <gl/gl.h>
> 
> main()
> {
>         prefposition(100, 500, 200, 600);
>         shademodel(FLAT);
>         winopen("red");
>         color(RED);
>         clear();
>         sleep(5);
> }
> 
...
> 
> I noticed that if you leave out the call to "shademodel" the program works
> as advertised.
> 
> Lee A. Butler
> SLCBR-VL-V					Internet: butler at brl.mil
> Ballistic Research Laboratory			   Phone: (301) 278-8740
> Aberdeen Proving Grounds, MD 21005-5066

There is an error in the program.  The 'winopen' needs to happen
befor the 'shademodel' command.  I think (hope) the manual has been 
fixed by now. 

Some commands (like prefposition) are hints, and go before the
winopen.  All the rest need to happen after the graphics have 
been initialized.

thant



More information about the Comp.sys.sgi mailing list