home *** CD-ROM | disk | FTP | other *** search
/ Teach Yourself Game Programming in 21 Days / TYGAMES_R.ISO / source / day_08 / graph3.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-05  |  2.2 KB  |  68 lines

  1.  
  2. // Header file for first module of game library GRAPH3.C
  3.  
  4. // D E F I N E S /////////////////////////////////////////////////////////////
  5.  
  6. #define VGA256              0x13  // 320x200x256
  7. #define TEXT_MODE           0x03  // 80x25 text mode
  8.  
  9. #define PALETTE_MASK        0x3C6 // the bit mask register
  10. #define PALETTE_REGISTER_RD 0x3C7 // set read index at this I/O
  11. #define PALETTE_REGISTER_WR 0x3C8 // set write index at this I/O
  12. #define PALETTE_DATA        0x3C9 // the R/W data is here
  13.  
  14. #define ROM_CHAR_SET_SEG 0xF000   // segment of 8x8 ROM character set
  15. #define ROM_CHAR_SET_OFF 0xFA6E   // begining offset of 8x8 ROM character set
  16.  
  17. #define CHAR_WIDTH        8       // size of characters
  18. #define CHAR_HEIGHT       8
  19.  
  20. #define SCREEN_WIDTH      (unsigned int)320 // mode 13h screen dimensions
  21. #define SCREEN_HEIGHT     (unsigned int)200
  22.  
  23. // S T R U C T U R E S ///////////////////////////////////////////////////////
  24.  
  25. // this structure holds a RGB triple in three bytes
  26.  
  27. typedef struct RGB_color_typ
  28.         {
  29.  
  30.         unsigned char red;    // red   component of color 0-63
  31.         unsigned char green;  // green component of color 0-63
  32.         unsigned char blue;   // blue  component of color 0-63
  33.  
  34.         } RGB_color, *RGB_color_ptr;
  35.  
  36.  
  37. // P R O T O T Y P E S ///////////////////////////////////////////////////////
  38.  
  39. void H_Line_Fast(int x1,int x2,int y,unsigned int color);
  40.  
  41. void V_Line(int y1,int y2,int x,unsigned int color);
  42.  
  43. void H_Line_Fast(int x1,int x2,int y,unsigned int color);
  44.  
  45. void Set_Palette_Register(int index, RGB_color_ptr color);
  46.  
  47. void Get_Palette_Register(int index, RGB_color_ptr color);
  48.  
  49. void Blit_Char(int xc,int yc,char c,int color,int trans_flag);
  50.  
  51. void Blit_String(int x,int y,int color, char *string,int trans_flag);
  52.  
  53. void Plot_Pixel(int x,int y,unsigned char color);
  54.  
  55. void Plot_Pixel_Fast(int x,int y,unsigned char color);
  56.  
  57. void Set_Video_Mode(int mode);
  58.  
  59. void Delay(int clicks);
  60.  
  61. // G L O B A L S /////////////////////////////////////////////////////////////
  62.  
  63. extern unsigned char far *video_buffer;   // vram byte ptr
  64. extern unsigned int far *video_buffer_w;  // vram word ptr
  65. extern unsigned char far *rom_char_set;   // rom characters 8x8
  66.  
  67.  
  68.