Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cbmvax!uunet!contex!avinash From: avinash@contex.UUCP (Avinash Chopde) Newsgroups: comp.sys.sgi Subject: viewport (scrmask also) clipping problems with lrectwrite() Keywords: viewprt(), scrmask(), lrectwrite(), rectzoom() Message-ID: <989@contex.UUCP> Date: 24 Feb 90 20:13:35 GMT Distribution: usa Organization: Xyvision Design Systems, Wakefield MA Lines: 52 Help! I have this program segment which uses rectzoom(), sets a viewport(), and then uses lrectwrite(). It works correctly most of the time, but fails for the program given below -- it draws the clipped part correctly, but also draws the same stuff on 100 pixels on the left part of the screen (some sort of "folding" around). What makes matters worse, can't seem to figure out the condition under which it fails -- have exprimented a bit with it. Any help with regards to pointing out errors in the program, or description of known bugs in the case of lrectwrite() clipping would be greatly appreciated. (Program fails on IRIX 3.2.1 as well as 3.2) ----------------- cut here --------------------------------- #include main() { long lrect_buffer[XMAXSCREEN+1]; unsigned char uc[4]; int i; ginit(); RGBmode(); gconfig(); RGBcolor(0,0,0); clear(); uc[0] = 0; uc[1] = uc[2] = uc[3] = 128; for (i = 0; i <= XMAXSCREEN; i ++) { lrect_buffer[i] = *(long *)uc; } rectzoom(2.0, 2.0); viewport((Screencoord)(700), (Screencoord)(1100), /* x limits */ (Screencoord)(200), (Screencoord)(800)); /* y limits */ for (i = 799; i >= 200; i -= 2) { lrectwrite((Screencoord)(0), (Screencoord)(i), /* lower left */ (Screencoord)(599), (Screencoord)(i), /* upper right */ lrect_buffer); } gflush(); sleep(5); } ----------------- end of cut --------------------------------- -- --------------------------- Avinash Chopde home : 508 470 1190 contex!avinash@uunet.uu.net office : 617 245 9004 x5582