home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / VECTBAL2.ZIP / WXLIB.H < prev    next >
C/C++ Source or Header  |  1994-07-15  |  6KB  |  168 lines

  1. /*----------------------------------------------------------------------
  2. ;
  3. ; XLIB - header file
  4. ;
  5. ;
  6. ;
  7. ; ****** XLIB - Mode X graphics library                ****************
  8. ; ******                                               ****************
  9. ; ****** Written By Themie Gouthas                     ****************
  10. ;
  11. ; egg@dstos3.dsto.gov.au
  12. ; teg@bart.dsto.gov.au
  13. ;
  14. ; Header file contributed by Darren Lyon (darren@nicky.DIALix.oz.au)
  15. ;
  16. ;
  17. ;  Terminology & notes:
  18. ;         VRAM ==   Video RAM
  19. ;         SRAM ==   System RAM
  20. ;         X coordinates are in pixels unless explicitly stated
  21. ;
  22. ;----------------------------------------------------------------------*/
  23.  
  24. #ifndef _XLIB_H_
  25. #define _XLIB_H_
  26.  
  27. //#define BYTE unsigned char
  28. //#define WORD unsigned int
  29.  
  30.  
  31. #define X_MODE_320x200  0
  32. #define X_MODE_320x240  1
  33. #define X_MODE_360x200  2
  34. #define X_MODE_360x240  3
  35. #define X_MODE_376x282  4
  36. #define X_MODE_320x400  5
  37. #define X_MODE_320x480  6
  38. #define X_MODE_360x400  7
  39. #define X_MODE_360x480  8
  40. #define X_MODE_360x360  9
  41. #define X_MODE_376x308  10
  42. #define X_MODE_376x564  11
  43. #define X_MODE_256x400  12
  44. #define X_MODE_256x480  13
  45.  
  46.  
  47. #define BACKWARD 0
  48. #define FORWARD  1
  49.  
  50. #define X_MODE_INVALID  -1
  51.  
  52. #ifdef ERROR
  53. #undef ERROR
  54. #endif
  55.  
  56. #define ERROR            1
  57. #define OK               0
  58.  
  59. /* FUNCTIONS =========================================================== */
  60.  
  61. #ifdef __cplusplus
  62. extern "C" {
  63. #endif
  64.  
  65.  WORD x_set_mode(
  66.         WORD mode,                /* Initialize x mode           */
  67.         WORD WidthInPixels);
  68.  
  69.   void x_select_default_plane( /*Enables Read/Write access to a    */
  70.         BYTE plane);   /* a specified plane                */
  71.  
  72.  void x_set_splitscreen(            /* set the split screen start  */
  73.         WORD line);         /*scan line (initialize)       */
  74.  
  75.  void x_set_start_addr(
  76.         WORD X,             /* Set the screen start        */
  77.         WORD Y);            /* address in video ram        */
  78.  
  79.  void x_hide_splitscreen(void); /* Disable the split screen (Split */
  80.                 /* Screen RAM remains reserved)    */
  81.  
  82.  void x_show_splitscreen(void); /* Enable the split screen (given it */
  83.                 /* was previously "hidden")          */
  84.  
  85.  
  86.  void x_adjust_splitscreen(   /* Adjust the start scan line of the */
  87.         WORD line);   /* split screen                      */
  88.  
  89.  
  90.  WORD x_set_doublebuffer(         /* Enable double buffering with a    */
  91.         WORD PageHeight); /* specified page height             */
  92.  
  93.  WORD x_set_tripplebuffer(         /* Enable tripple buffering with a    */
  94.                 WORD PageHeight); /* specified page height             */
  95.  
  96.  
  97.  void x_page_flip(        /* Swap visible page (only when double   */
  98.         WORD X,   /* buffering is active) & sets virt start*/
  99.         WORD Y);
  100.  
  101.  void x_set_cliprect(      /* Define the clipping rectangle */
  102.         WORD left, /* NOTE: left and right are in bytes */
  103.         WORD top,
  104.         WORD righ,
  105.         WORD bottom);
  106.  
  107.  void x_text_mode(void);   /* return to text mode */
  108.  void x_wait_vsync(void);  /* wait for vsync */
  109.  
  110. #ifdef __cplusplus
  111. }
  112. #endif
  113.  
  114.  
  115. /* VARIABLES =========================================================== */
  116.  
  117. extern BYTE InGraphics;             /* non zero if in X graphics mode      */
  118. extern WORD CurrXMode;              /* contains current X graphics mode id */
  119. extern WORD ScrnPhysicalByteWidth;  /* Physical screen width in bytes      */
  120. extern WORD ScrnPhysicalPixelWidth; /* Physical screen width in pixels     */
  121. extern WORD ScrnPhysicalHeight;     /* Physical screen height in pixels    */
  122. extern WORD ErrorValue;             /* Error return value                  */
  123. extern WORD SplitScrnOffs;          /* Offset in VRAM  of split screen     */
  124. extern WORD SplitScrnScanLine;      /* Scan line split screen starts at    */
  125.                     /* initially. Resizing the split scrn  */
  126.                     /* using the other functions does not  */
  127.                     /* change this value                   */
  128. extern WORD SplitScrnVisibleHeight; /* Height of the visible portion of the*/
  129.                     /* split screen.                       */
  130. extern WORD Page0_Offs;             /* Offset in VRAM of main virt. screen */
  131. extern WORD Page1_Offs;             /* Offset in VRAM of 2nd virt. screen  */
  132. extern WORD Page2_Offs;             /* Offset in VRAM of 3rd virt. screen  */
  133. extern WORD ScrnLogicalByteWidth;   /* Virtual screen width in bytes       */
  134. extern WORD ScrnLogicalPixelWidth;  /* Virtual screen width in pixels      */
  135. extern WORD ScrnLogicalHeight;      /* Virtual screen height in pixels     */
  136. extern WORD MaxScrollX;             /* Max X position of physical screen   */
  137.                     /*  within virtual screen              */
  138. extern WORD MaxScrollY;             /* Max Y position of physical screen   */
  139.                     /*  within virtual screen              */
  140. extern WORD DoubleBufferActive;     /* Indicates whether double buffering  */
  141.                                     /* is active                           */
  142. extern WORD TrippleBufferActive;    /* Indicates whether tripple           */
  143.                     /* buffering is active                 */
  144. extern WORD VisiblePageIdx;         /* Index number of visible page 0 or 1 */
  145. extern WORD HiddenPageOffs;         /* Offset of Hidden Pg | only valid    */
  146. extern WORD VisiblePageOffs;        /* Offset of Visible Pg| for D.B. mode */
  147. extern WORD WaitingPageOffs;        /* Offset of Waiting Pg| for T.B. mode */
  148. extern WORD NonVisual_Offs;         /* Offset of first non-visible VRAM    */
  149.  
  150. extern WORD StartAddressFlag;
  151.  
  152. extern WORD TopClip;                /* Clipping rectangle                  */
  153. extern WORD BottomClip;
  154. extern WORD LeftClip;
  155. extern WORD RightClip;
  156.  
  157. extern WORD PhysicalStartPixelX;    /* Coordinates of physical (visible) */
  158. extern WORD PhysicalStartByteX;     /* screen relative to the virtual    */
  159. extern WORD PhysicalStartY;         /* screen's U.L. corner              */
  160.  
  161. extern char* VsyncPaletteBuffer;
  162.  
  163. extern WORD SCREEN_SEG;
  164.  
  165. #endif
  166.  
  167.  
  168.