home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / CSAPE32.ARJ / SOURCE / OWLSCR / WINCLIP.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-09-24  |  1.2 KB  |  43 lines

  1. /*
  2.     winclip.c    3/9/88
  3.  
  4.     % window clipping routines.
  5.     by Ted.
  6.  
  7.     OWL 1.2
  8.     Copyright (c) 1988, by Oakland Group, Inc.
  9.     ALL RIGHTS RESERVED.
  10.  
  11.     Revision History:
  12.     -----------------
  13.      3/28/90 jmd    ansi-fied
  14. */
  15.  
  16. /* -------------------------------------------------------------------------- */
  17. #include "oakhead.h"
  18. #include "disppriv.h"
  19. /* -------------------------------------------------------------------------- */
  20.  
  21. unsigned win_clipbox(win_type win, opbox *boxp)
  22. /*
  23.     Return Sutherland clip code for box in window: 0 if box is completely
  24.     out of window; otherwise bits saying which side(s) it was clipped on:
  25.     1, 2, 4, 8 for right, top, left, bottom; 16 for coming through at all.
  26. */
  27. {
  28.     return(opwh_clipbox((odim) win_GetPixWidth(win),
  29.                         (odim) win_GetPixHeight(win), boxp));
  30. }
  31. /* -------------------------------------------------------------------------- */
  32. unsigned win_clippoint(win_type win, opcoord *xp, opcoord *yp)
  33. /*
  34.     Return Sutherland clip code for point in display: 0 if point is
  35.     in window; otherwise bits saying which side it's out on.
  36. */
  37. {
  38.     return(opwh_clippoint((odim) win_GetPixWidth(win),
  39.                           (odim) win_GetPixHeight(win), xp, yp));
  40. }
  41. /* -------------------------------------------------------------------------- */
  42.  
  43.