home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / video / 10 / 10_16.c < prev    next >
Encoding:
Text File  |  1988-08-11  |  467 b   |  18 lines

  1. SetPixel( x, y )
  2. int    x,y;        /* pixel coordinates */
  3. {
  4.     int    CharCode;
  5.     int    CharScanLine;
  6.     int    BitMask;
  7.     int    CharDefOffset;
  8.  
  9.  
  10.         /* the window is 32 characters across */
  11.     CharCode = StartCharCode + (y/Points)*32 + x/8;
  12.     CharScanLine = y % Points;        /* y MOD Points */
  13.     BitMask = 0x80 >> (x % 8);        /* 10000000b SHR (x MOD 8) */
  14.  
  15.         CharDefOffset = CharCode*2 + CharScanLine*512 + 1;
  16.     CharDefTable[CharDefOffset] |= BitMask;    /* OR the pixel */
  17. }
  18.