home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / 2DBUMP.ZIP / GRX.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-06  |  1.9 KB  |  103 lines

  1. /*
  2.    NAME:    GRP.H
  3.    DESC:    Graphics header for true 3d-project
  4.     VER:    0.1
  5.      BY:    Aaru Koskensilta (Zaphod.B)
  6. */
  7.  
  8. #ifndef _GRP_H_
  9. #define _GRP_H_
  10.  
  11. /* Data defines */
  12. #define byte   unsigned char
  13. #define word   unsigned short
  14. #define dword  unsigned long
  15.  
  16.  
  17. /* Double buffer */
  18. extern byte dbuffer[64000];
  19.  
  20. /* RGB-colour structure */
  21. struct RGBcolor
  22. {
  23.    byte r,g,b;
  24. };
  25.  
  26. struct sprite
  27. {
  28.    int x,y;
  29.    byte*image;
  30. };
  31.  
  32. /* Current palette */
  33. extern RGBcolor current_palette[256]; 
  34.  
  35. /* Load PCX-pic from file */
  36. byte * load_pic_from_file(char*);
  37.  
  38. /* Load sprite from file */
  39. sprite * load_sprite_from_file(char*);
  40.  
  41. /* Set graphics mode */
  42. void gmode(short);
  43.  
  44. /* Load palette from PCX-file */
  45. RGBcolor * load_pal_from_file(char*);
  46.  
  47. /* Set palette */
  48. void setpal(RGBcolor*);
  49.  
  50. /* Plot a pixel */
  51. void plot(short,short,byte);
  52.  
  53. /* Copy doublebuffer to screen */
  54. void update_screen();
  55.  
  56. /* Draw a line */
  57. void line(int,int,int,int,char);
  58.  
  59. /* Place sprite on screen */
  60. void place_sprite(int,int,sprite*);
  61.  
  62. /* Place sprite as 1 colored on screen. Usefull for fonts and that kind o'
  63.    stuff */
  64. void place_sprite_1cl(int,int,sprite*,byte);
  65.  
  66. /* Place sprite as 1 colored and inverted on screen. */
  67. void place_sprite_inv(int,int,sprite*,byte);
  68.  
  69. /* Draw a horizontal line */
  70. void horiz_line(int,int,int,byte);
  71.  
  72. /* Draw a vertical line */
  73. void vert_line(int,int,int,byte,int,int);
  74.  
  75. /* Draw a rectangle */
  76. void rect(int,int,int,int,byte);
  77.  
  78. /* Draw a window (Embosed) */
  79. void DrawWindow(int,int,int,int,byte clr=7);
  80. /* PCX-header */
  81. struct PCXheader
  82. {
  83.    char mfacturer;
  84.    char version;
  85.    char encoding;
  86.    char bit_per_pixel;
  87.    short Xmin;
  88.    short Ymin;
  89.    short Xmax;
  90.    short Ymax;
  91.    short Hres;
  92.    short Vres;
  93.    char hpalette[48];
  94.    char reserved;
  95.    char planes;
  96.    short bpline;
  97.    short headerpal;
  98.    char filler[58];
  99. };
  100.  
  101.  
  102. #endif
  103.