home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Programming / RTGMaster / includes / stormc / rtgmaster / rtgsublibs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-06-24  |  15.1 KB  |  505 lines

  1. /*
  2. **     $VER: rtgsublibs.h 1.009 (15 Jan 1998)
  3. */
  4.  
  5. #ifndef RTGSUBLIBS_H
  6. #define RTGSUBLIBS_H TRUE
  7.  
  8. #ifndef UTILITY_TAGITEM_H
  9. #include "utility/tagitem.h"
  10. #endif
  11.  
  12. #ifndef EXEC_TYPES_H
  13. #include "exec/types.h"
  14. #endif
  15.  
  16. #ifndef EXEC_NODES_H
  17. #include "exec/nodes.h"
  18. #endif
  19.  
  20. // The TagItem ID's (ti_Tag values) for OpenRtgScreen()
  21.  
  22. // Information like width, height, screenmode to use, depth and overscan
  23. // information is located in the ScreenReq structure which must be passed
  24. // to OpenRtgScreen().  The RtgScreenModeReq() function creates these
  25. // ScreenReq structures for you.
  26.  
  27. #define rtg_Dummy TAG_USER
  28.  
  29. #define rtg_Buffers (rtg_Dummy + 0x01)
  30.  
  31. // [1] You can use this tag to specify the number
  32. // of screen buffers for your screen.  Setting this
  33. // to 2 or 3 will allow you to do Double or Triple
  34. // buffering.  Valid values are 1, 2 or 3.
  35.  
  36. #define rtg_Interleaved (rtg_Dummy + 0x02)
  37.  
  38. // [FALSE] Specifying TRUE will cause bitmaps to
  39. // be allocated interleaved.  OpenRtgScreen will
  40. // fail if bitplanes cannot be allocated that way
  41. // unlike Intuition/OpenScreenTagList().
  42.  
  43. #define rtg_Draggable (rtg_Dummy + 0x03)
  44.  
  45. // [TRUE] Specifying FALSE will make the screen
  46. // non-draggable.  Do not use without good reason!
  47.  
  48. #define rtg_Exclusive (rtg_Dummy + 0x04)
  49.  
  50. // [FALSE] Allows screens which won't share the
  51. // display with other screens.  Use sparingly!
  52.  
  53. // #define rtg_ChunkySupport (rtg_Dummy + 0x05)
  54. //
  55. // [0] This LONG is used to indicate which
  56. // Chunky modes this application supports.  A
  57. // set bit means the mode is supported:
  58.  
  59. // ;    ;
  60. // ;    ;    | Pixels  | Pixel|Color| Pixel
  61. // ;    ; Bit|represent| size |space| layout
  62. // ;    ;------------------------------------------------------------------
  63. // ;    ;  0  TrueColor  LONG   RGB   %00000000 rrrrrrrr gggggggg bbbbbbbb  ARGB32
  64. // ;    ;  1  TrueColor 3 BYTE  RGB   %rrrrrrrr gggggggg bbbbbbbb           RGB24
  65. // ;    ;  2  TrueColor  WORD   RGB   %rrrrrggg gggbbbbb                    RGB16
  66. // ;    ;  3  TrueColor  WORD   RGB   %0rrrrrgg gggbbbbb                    RGB15
  67. // ;    ;  4  TrueColor  LONG   BGR   %00000000 bbbbbbbb gggggggg rrrrrrrr  ABGR32
  68. // ;    ;  5  TrueColor 3 BYTE  BGR   %bbbbbbbb gggggggg rrrrrrrr           BGR24
  69. // ;    ;  6  TrueColor  WORD   BGR   %bbbbbggg gggrrrrr                    BGR16
  70. // ;    ;  7  TrueColor  WORD   BGR   %0bbbbbgg gggrrrrr                    BGR15
  71. // ;    ;  8  TrueColor  LONG   RGB   %rrrrrrrr gggggggg bbbbbbbb 00000000  RGBA32
  72. // ;    ;  9  ColorMap   BYTE   -     -                                     LUT8
  73. // ;    ; 10  Graffiti   BYTE   -     - (Graffiti style chunky, very special)
  74. // ;    ; 11  TrueColor  WORD   RGB   %gggbbbbb 0rrrrrgg                    RGB15PC
  75. // ;    ; 12  TrueColor  WORD   BGR   %gggrrrrr 0bbbbbgg                    BGR15PC
  76. // ;    ; 13  TrueColor  WORD   RGB   %gggbbbbb rrrrrggg                    RGB16PC
  77. // ;    ; 14  TrueColor  WORD   BGR   %gggrrrrr bbbbbggg                    BGR16PC
  78. // ;    ; 15  TrueColor  LONG   BGR   %bbbbbbbb gggggggg rrrrrrrr 00000000  BGRA32
  79. //;
  80. //    ; This table is by no means complete.  There are probably more modes
  81. //    ; available on common Amiga graphic cards, but I have no information
  82. //    ; on them yet.  If you know about such modes please contact me.
  83. //
  84. //    ; Setting this LONG to zero means your application doesn't support
  85. //    ; any Chunky orientated display modes.
  86. //
  87. //    #define rtg_PlanarSupport (rtg_Dummy + 0x06)
  88. //                            ;[0] This LONG is used to indicate which
  89. //                            ;Planar modes this application supports.  A
  90. //                            ;set bit means the mode is supported:
  91. //    ; Bit 0: Indicates it supports 1 bitplane non-interleaved
  92. //    ; Bit 1: Indicates it supports 2 bitplanes non-interleaved
  93. //    ; (...)
  94. //    ; Bit 7: Indicates it supports 8 bitplanes non-interleaved
  95. //
  96. //    ; Bit 16: Indicates it supports 1 bitplane interleaved
  97. //    ; Bit 17: Indicates it supports 2 bitplanes interleaved
  98. //    ; (...)
  99. //    ; Bit 23: Indicates it supports 8 bitplanes interleaved
  100. //
  101. //    ; Bit 15: Indicates it supports EHB mode (6 bitplanes) non-interleaved
  102. //    ; Bit 31: Indicates it supports EHB mode (6 bitplanes) interleaved
  103. //
  104. //    ; Note that all planar modes are color-mapped.  Bits 8-14 and 24-30
  105. //    ; are unused for now, but could be used later to support planar modes
  106. //    ; with even higher number of bitplanes.
  107. //
  108. //    ; Setting this LONG to zero means your application doesn't support
  109. //    ; any Planar orientated display modes.
  110.  
  111.  
  112. #define ARGB32 1L
  113. #define RGB24  2L
  114. #define RGB16  4L
  115. #define RGB15  8L
  116. #define ABGR32 16L
  117. #define BGR24  32L
  118. #define BGR16  64L
  119. #define BGR15  128L
  120. #define RGBA32 256L
  121. #define LUT8   512L
  122. #define GRAFFITI 1024L
  123. #define RGB15PC  2048L
  124. #define BGR15PC  4096L
  125. #define RGB16PC  8192L
  126. #define BGR16PC  16384L
  127. #define BGRA32   32768L
  128. #define Planar1  1L
  129. #define Planar2  2L
  130. #define Planar3  4L
  131. #define Planar4  8L
  132. #define Planar5  16L
  133. #define Planar6  32L
  134. #define Planar7  64L
  135. #define Planar8  128L
  136. #define Planar1I 1<<16L
  137. #define Planar2I 1<<17L
  138. #define Planar3I 1<<18L
  139. #define Planar4I 1<<19L
  140. #define Planar5I 1<<20L
  141. #define Planar6I 1<<21L
  142. #define Planar7I 1<<22L
  143. #define Planar8I 1<<23L
  144. #define PlanarEHB 1<<15L
  145. #define PlanarEHBI 1<<31L
  146.  
  147. #define rtg_ZBuffer (rtg_Dummy + 0x07)
  148.  
  149. // Allocate a Z-Buffer. Only works with sublibraries that implement the rtgmaster 3D Extensions.
  150.  
  151. #define rtg_Use3D (rtg_Dummy + 0x08)
  152.  
  153. // Use the 3D Chips. (You can only do conventional Double/Triple-Buffering, if you do NOT use
  154. // them. If you use them, the Extra Buffers are used by the 3D Chips)
  155.  
  156. #define rtg_Workbench (rtg_Dummy + 0x09)
  157.  
  158. // Open a Window on the Workbench, instead of a Screen. This Tag takes the Colorformat
  159. // to use with CopyRtgBlit() as Parameter
  160.  
  161. // End of OpenRtgScreenTagList() enumeration ***
  162.  
  163. // This structure is private and for the internal use of RtgMaster.library
  164. // and its sub-libraries ONLY.  This structure will change in the future.
  165.  
  166. #define rtg_MouseMove (rtg_Dummy+ 0x0A)
  167.  
  168. // RtgGetMsg also returns IDCMP_MOUSEMOVE messages
  169.  
  170. #define rtg_DeltaMove (rtg_Dummy+ 0x0B)
  171.  
  172. // RtgGetMsg also returns IDCMP_MOUSEMOVE messages, and it returns Delta-Values,
  173. // not absolute values.
  174.  
  175. #define rtg_PubScreenName (rtg_Dummy+ 0x0C)
  176.  
  177. // Open a Window on a Public Screen with the provided Public Screen Name.
  178. // Note: This does not work with all Sublibraries. Some simply ignore this
  179. // (For example EGS...)
  180.  
  181. struct RtgDimensionInfo
  182. {
  183.     ULONG Width;
  184.     ULONG Height;
  185. };
  186.  
  187. // This structure is private and for the internal use of RtgMaster.library
  188. // and its sub-libraries ONLY.  This structure will change in the future.
  189.  
  190. struct ScreenMode
  191. {
  192.     struct MinNode ScrNode;
  193.  
  194.     // ln_Succ and ln_Pred from ListNode structure
  195.  
  196.     STRPTR Name;
  197.     STRPTR Description;
  198.  
  199.     // Description of the graphics board this mode
  200.     // requires.  For example: "Standard Amiga Chipset".
  201.     // Description should not be longer than 31
  202.     // characters including terminating NULL-byte.  This
  203.     // pointer might be zero so watch out.
  204.  
  205.     ULONG GraphicsBoard;
  206.  
  207.     // The graphics board this mode requires
  208.  
  209.     ULONG ModeID;
  210.  
  211.     // ModeID (depends on sm_GraphicsBoard)
  212.  
  213.     BYTE Reserved[8];
  214.  
  215.     // 8 bytes reserved space for use of the sub-library
  216.     // who creates this ScreenMode structure.  This is
  217.     // PRIVATE to the sub-library!
  218.  
  219.     ULONG MinWidth;
  220.  
  221.     // minimum width in pixels
  222.  
  223.     ULONG MaxWidth;
  224.  
  225.     // maximum width in pixels
  226.  
  227.     ULONG MinHeight;
  228.  
  229.     // Minimum height in pixels
  230.  
  231.     ULONG MaxHeight;
  232.  
  233.     // Maximum height in pixels
  234.  
  235.     struct RtgDimensionInfo Default;
  236.  
  237.     // Standard width and height of this ScreenMode
  238.  
  239.     struct RtgDimensionInfo TextOverscan;
  240.  
  241.     // Settable via preferences
  242.  
  243.     struct RtgDimensionInfo StandardOverscan;
  244.  
  245.     // Settable via preferences
  246.  
  247.     struct RtgDimensionInfo MaxOverscan;
  248.  
  249.     // Maximum width and height (without the
  250.     // need for AutoScrolling).  Hardware
  251.     // dependant.
  252.  
  253.     ULONG ChunkySupport;
  254.  
  255.     // This LONG is used to indicate which Chunky
  256.     // modes this ScreenMode supports.  A set bit
  257.     // means the mode is available.  See the
  258.     // rtg_ChunkySupport tag for more information.
  259.     // Note that the same ScreenMode may never
  260.     // use two different layouts (for example BGR
  261.     // and RGB)
  262.  
  263.     ULONG PlanarSupport;
  264.  
  265.     // This LONG is used to indicate which Planar
  266.     // modes this ScreenMode supports.  A set bit
  267.     // means the mode is available.  See the
  268.     // rtg_PlanarSupport tag for more information.
  269.     // Note that the same ScreenMode may never
  270.     // use both interleaved and non-interleaved
  271.     // layouts.
  272.  
  273.     ULONG PixelAspect;
  274.  
  275.     // For a PAL 320x256 screen you have to write
  276.     // this value here:  sm_PixelAspect =
  277.     // (320/4)/(256/3) * 65536
  278.     //
  279.     // This tells the relation between the height and
  280.     // the width of a single pixel on 4:3 screen.  For
  281.     // a 640x480 screen this value is 1*65536.
  282.  
  283.     ULONG VertScan;
  284.  
  285.     // Vertical scan rate of this screenmode
  286.     // (in Hz)
  287.  
  288.     ULONG HorScan;
  289.  
  290.     // Horizontal scan rate of this screenmode
  291.     // (in Hz)
  292.  
  293.     ULONG PixelClock;
  294.  
  295.     // Pixelclock rate (in Hz)
  296.  
  297.     ULONG VertBlank;
  298.  
  299.     // Vertical blank rate of this screenmode
  300.     // (in Hz)  (How often the VBlank interupt
  301.     // is triggered)
  302.  
  303.     ULONG Buffers;
  304.  
  305.     // The number of buffers this ScreenMode can
  306.     // can handle.  This should always be atleast
  307.     // 1, 2 if the Screen can do double-buffering
  308.     // and 3 if it can do triple-buffering.
  309.  
  310.     UWORD BitsRed;
  311.  
  312.     // The number of bits per gun for Red
  313.  
  314.     UWORD BitsGreen;
  315.  
  316.     // The number of bits per gun for Green
  317.  
  318.     UWORD BitsBlue;
  319.  
  320.     // The number of bits per gun for Blue
  321. };
  322.  
  323. // The TagItem ID's (ti_Tag values) for GetRtgScreenData()
  324.  
  325. // These tags are used to return data to the user about the RtgScreen
  326. // structure in a future compatible way.
  327.  
  328. #define grd_Dummy TAG_USER
  329.  
  330. #define grd_Width (grd_Dummy + 0x01)
  331.  
  332. // Gets you the Width in pixels of the screen
  333.  
  334. #define grd_Height (grd_Dummy + 0x02)
  335.  
  336. // Gets you the Height in pixels of the screen
  337.  
  338. #define grd_PixelLayout (grd_Dummy + 0x03)
  339.  
  340. // Gets you the pixellayout of the screen, see
  341. // defines below.  This also tells you whether
  342. // the screen is Chunky or Planar
  343.  
  344. #define grd_ColorSpace (grd_Dummy + 0x04)
  345.  
  346. // Gets you the colorspace of the screen, see
  347. // defines below
  348.  
  349. #define grd_Depth (grd_Dummy + 0x05)
  350.  
  351. // The number of colors LOG 2.  For Planar modes
  352. // this also tells you the number of bitplanes.
  353. // Don't rely on this number except to get the
  354. // number of colors for Chunky modes.
  355.  
  356. #define grd_PlaneSize (grd_Dummy + 0x06)
  357.  
  358. // Tells you the number of bytes to skip to get
  359. // to the next (bit)plane.  You can use this to
  360. // find the start addresses of the other (bit)planes
  361. // in Planar and in (BytePlane) Chunky modes
  362.  
  363. #define grd_BytesPerRow (grd_Dummy + 0x07)
  364.  
  365. // The number of bytes taken up by a row.  This
  366. // refers to one (bit/byte)plane only for modes
  367. // working with planes.
  368.  
  369. #define grd_MouseX (grd_Dummy + 0x08)
  370.  
  371. // Finds out the Mouse X position
  372.  
  373. #define grd_MouseY (grd_Dummy + 0x09)
  374.  
  375. // Finds out the Mouse Y position
  376.  
  377. // The TagItem ID's (ti_Tag values) for GetGfxCardData()
  378.  
  379. // These tags are used to return data to the user about the graphics card
  380. // which the RtgScreen uses.
  381.  
  382. #define grd_BusSystem (grd_Dummy + 0x0A)
  383.  
  384. #define grd_3DChipset (grd_Dummy + 0x0B)
  385.  
  386. // For usage with the rtgmaster 3D Extensions, will be ignored from sublibraries
  387. // that do not support the 3D Extensions.
  388.  
  389. #define grd_Z3 1 // Zorro III Bus
  390. #define grd_Z2 2 // Zorro II Bus
  391. #define grd_Custom 3 // Custom Chipset
  392. #define grd_RGBPort 4 // Board connected to RGB Port
  393. #define grd_GVP 5 // GVP "special" Bus of GVP Turbo Board (EGS110 GFX Board)
  394. #define grd_DDirect 6 // DraCo Direct Bus
  395.  
  396. // defines for grd_PixelLayout
  397.  
  398. #define grd_PLANAR     0 // Non interleaved planar layout [X bitplanes/pixel]
  399. #define grd_PLANATI    1 // Interleaved planar layout     [X bitplanes/pixel]
  400. #define grd_CHUNKY     2 // 8-bit Chunky layout           [BYTE/pixel]
  401. #define grd_HICOL15    3 // 15-bit Chunky layout          [WORD/pixel]
  402. #define grd_HICOL16    4 // 16-bit Chunky layout          [WORD/pixel]
  403. #define grd_TRUECOL24  5 // 24-bit Chunky layout          [3 BYTES/pixel]
  404. #define grd_TRUECOL24P 6 // 24-bit Chunky layout          [3 BYTEPLANES/pixel]
  405. #define grd_TRUECOL32  7 // 24-bit Chunky layout          [LONG/pixel]
  406. #define grd_GRAFFITI   8 // 8-bit Graffiti-type Chunky layout (very special...)
  407. #define grd_TRUECOL32B 9
  408.  
  409. // defines for grd_ColorSpace
  410.  
  411. #define grd_Palette 0 // Mode uses a Color Look-Up Table (CLUT)
  412. #define grd_RGB     1 // Standard RGB color space
  413. #define grd_BGR     2 // high-endian RGB color space, BGR
  414. #define grd_RGBPC   3 // RGB with lowbyte and highbyte swapped
  415. #define grd_BGRPC   4 // BGR with lowbyte and highbyte swapped
  416.  
  417. // End of GetRtgScreenData() enumeration ***
  418.  
  419.  
  420. // Information about the RtgScreenModeReq tags:
  421. //
  422. // Each tag specified for the RtgScreenModeReq() function limits in some
  423. // way the number of ScreenModes available to the user.  Sometimes this
  424. // means a screenmode is completely ommited, and sometimes this means
  425. // certain screenmodes can only be used if the user selects them to
  426. // be wide enough.  So for example, a ScreenMode which supports screens
  427. // of 300 to 400 pixels in width, could be filtered out completely by
  428. // setting smr_MinWidth to 401.  But if the smr_MinWidth is set to for
  429. // example 320 then the user is allowed to select a width of 320-400
  430. // pixels (for this ScreenMode, and if the smr_MaxWidth allows this).
  431. // If smr_MinWidth is 200 pixels then the ScreenMode is the limiting
  432. // factor which means the user can't select ScreenModes smaller than
  433. // 300 pixels.
  434. //
  435. // The PlanarSupport and ChunkySupport tags determine which ScreenModes
  436. // are available to the user depending on their layout and number of
  437. // colors.
  438. // This structure is private and for the internal use of RtgMaster.library
  439. // and its sub-libraries ONLY.  This structure will change in the future.
  440.  
  441. struct ScreenReq
  442. {
  443.     struct ScreenMode *ScreenMode;
  444.  
  445.     // Ptr to ScreenMode structure
  446.  
  447.     ULONG Width;
  448.  
  449.     // Must be within Tag specified limits
  450.  
  451.     ULONG Height;
  452.  
  453.     // The width and height which the user selected
  454.  
  455.     UWORD Depth;
  456.  
  457.     // Number of colors log2 which the user selected
  458.     UWORD Overscan;
  459.  
  460.     // 0 = No Overscan.  See defines below.
  461.  
  462.     UBYTE Flags; // For the meaning of the bits see below
  463. };
  464.  
  465. struct ScreenReqList
  466. {
  467.  struct MinNode SRNode;
  468.  struct ScreenReq *req;
  469. };
  470.  
  471. // Bits set in ScreenMode.Flags
  472.  
  473. #define sq_EHB          (1 << 0)   // EHB selected (sq_Depth = 6)
  474. #define sq_CHUNKYMODE   (1 << 1)   // Chunky Mode selected
  475. #define sq_DEFAULTX     (1 << 2)   // Default Width selected
  476. #define sq_DEFAULTY     (1 << 3)   // Default Height selected
  477.  
  478. // defines for Overscan
  479.  
  480. #define sq_NOOVERSCAN       0
  481. #define sq_TEXTOVERSCAN     1 // User settable, should be entirely visible
  482. #define sq_STANDARDOVERSCAN 2 // Standard overscan (just past edges)
  483. #define sq_MAXOVERSCAN      3 // Maximum overscan (as much as possible)
  484.  
  485. // This structure is private and for the internal use of RtgMaster.library
  486. // and its sub-libraries ONLY.  This structure will change in the future.
  487.  
  488. struct RtgScreen
  489. {
  490.     ULONG LibBase;
  491.     UWORD LibVersion;
  492.     UWORD Pad1;
  493.     ULONG GraphicsBoard;
  494.     BYTE  Reserved[20];
  495.     ULONG MouseX;
  496.     ULONG MouseY;
  497.     APTR  c2pcode;
  498.     APTR  c2pdata;
  499.     ULONG c2pcurr;
  500.     BYTE  c2pname[30];
  501. };
  502.  
  503. #endif
  504.  
  505.