home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.sgi
- Path: sparky!uunet!news.larc.nasa.gov!hal.larc.nasa.gov!alan
- From: alan@hal.larc.nasa.gov (alan dare)
- Subject: Visual distortion problem
- Message-ID: <BrwDx2.48y@news.larc.nasa.gov>
- Originator: alan@hal.larc.nasa.gov
- Sender: news@news.larc.nasa.gov (USENET Network News)
- Organization: NASA Langley Research Center, Hampton, VA USA
- Date: Fri, 24 Jul 1992 14:36:37 GMT
- Lines: 54
-
-
- This program creates a visual distortion. When the monitor updates at a rate
- twice as fast than the rate the program displays the graphic, one perceives
- two lines. When the rates of the monitor and program agree, one perceives a
- single line. Question: is this a problem with the hardware or the visual
- system?
-
- *-------------------CUT HERE------------------------------*
- #include <gl.h>
- main ()
-
- {
-
- static float line[2][2] = {
- {0.0,15.0},
- {0.0,-15.0}
- };
-
- float i;
-
- prefposition(0, 1279, 0, 1023);
- noborder();
- winopen("SHOW");
- RGBmode();
- doublebuffer();
- gconfig();
- swapinterval(2); /* Creates 30 Hz update rate */
-
- while ( TRUE ) {
- if (i > 20.0)
- i = -20.0;
- else
- i+=0.2;
-
- cpack(0x00);
- clear();
- ortho2(-20.0,20.0,-20.0,20.0);
- pushmatrix();
- cpack(0xFFFFFF);
- translate(i,0.0,0.0);
- bgnline();
- v2f(line[0]);
- v2f(line[1]);
- endline();
- popmatrix();
- swapbuffers();
- }
- }
- *-------------------CUT HERE------------------------------*
- --
-
- *********************************************************************
- Alan Dare | Internet : alan@hal.larc.nasa.gov
- NASA Langley Research Center |
-