home *** CD-ROM | disk | FTP | other *** search
/ Chestnut's Multimedia Mania / MM_MANIA.ISO / graphics / povsrc20 / extend.h < prev    next >
Text File  |  1992-03-24  |  13KB  |  249 lines

  1. /*-----------------------------------------------------------------------*/
  2. /*                                   TIGA                                */
  3. /*         Copyright (C) 1988-1990  Texas Instruments Incorporated.      */
  4. /*                           All Rights Reserved                         */
  5. /*-----------------------------------------------------------------------*/
  6. /*  TIGA 2-D Graphics Library include file                               */
  7. /*-----------------------------------------------------------------------*/
  8. /*                                                                       */
  9. /*  file            extend.h                                             */
  10. /*                                                                       */
  11. /*  description     This file contains references to functions contained */
  12. /*                  in the TIGA 2-D Graphics Library.  It must be        */
  13. /*                  included in any Microsoft 'C' application which      */
  14. /*                  calls a graphics library function.                   */
  15. /*                                                                       */
  16. /*                  Note that the tiga.h header file must be included    */
  17. /*                  before this header file.                             */
  18. /*                                                                       */
  19. /*-----------------------------------------------------------------------*/
  20.                                                                         
  21. /*----------------------------------------------------------------------*/
  22. /*  Extended function Command Numbers                                   */
  23. /*----------------------------------------------------------------------*/
  24. #define SET_DSTBM           EXT_CP( 0)
  25. #define SET_SRCBM           EXT_CP( 1)
  26. #define STYLED_LINE         EXT_CP( 2)
  27. #define SWAP_BM             EXT_CP( 3)
  28. #define DRAW_POLYLINE_A     EXT_CP( 4)
  29. #define FILL_CONVEX_A       EXT_CP( 5)
  30. #define FILL_POLYGON_A      EXT_CP( 6)
  31. #define PATNFILL_CONVEX_A   EXT_CP( 7)
  32. #define PATNFILL_POLYGON_A  EXT_CP( 8)
  33. #define PATNPEN_POLYLINE_A  EXT_CP( 9)
  34. #define PEN_POLYLINE_A      EXT_CP(10)
  35. #define BITBLT              EXT_DM(11)
  36. #define DRAW_LINE           EXT_DM(12)
  37. #define DRAW_OVAL           EXT_DM(13)
  38. #define DRAW_OVALARC        EXT_DM(14)
  39. #define DRAW_PIEARC         EXT_DM(15)
  40. #define DRAW_POINT          EXT_DM(16)
  41. #define DRAW_POLYLINE       EXT_DM(17)
  42. #define DRAW_RECT           EXT_DM(18)
  43. #define FILL_CONVEX         EXT_DM(19)
  44. #define FILL_OVAL           EXT_DM(20)
  45. #define FILL_PIEARC         EXT_DM(21)
  46. #define FILL_POLYGON        EXT_DM(22)
  47. #define FILL_RECT           EXT_DM(23)
  48. #define FRAME_OVAL          EXT_DM(24)
  49. #define FRAME_RECT          EXT_DM(25)
  50. #define GET_PIXEL           EXT_DM(26)
  51. #define PATNFILL_CONVEX     EXT_DM(27)
  52. #define PATNFILL_OVAL       EXT_DM(28)
  53. #define PATNFILL_PIEARC     EXT_DM(29)
  54. #define PATNFILL_POLYGON    EXT_DM(30)
  55. #define PATNFILL_RECT       EXT_DM(31)
  56. #define PATNFRAME_OVAL      EXT_DM(32)
  57. #define PATNFRAME_RECT      EXT_DM(33)
  58. #define PATNPEN_LINE        EXT_DM(34)
  59. #define PATNPEN_OVALARC     EXT_DM(35)
  60. #define PATNPEN_PIEARC      EXT_DM(36)
  61. #define PATNPEN_POINT       EXT_DM(37)
  62. #define PATNPEN_POLYLINE    EXT_DM(38)
  63. #define PEN_LINE            EXT_DM(39)
  64. #define PEN_OVALARC         EXT_DM(40)
  65. #define PEN_PIEARC          EXT_DM(41)
  66. #define PEN_POINT           EXT_DM(42)
  67. #define PEN_POLYLINE        EXT_DM(43)
  68. #define SEED_FILL           EXT_DM(44)
  69. #define SEED_PATNFILL       EXT_DM(45)
  70. #define SET_DRAW_ORIGIN     EXT_DM(46)
  71. #define SET_PENSIZE         EXT_DM(47)
  72. #define ZOOM_RECT           EXT_DM(48)
  73. #define SET_PATN            EXT_DM(49)
  74. #define INSTALL_FONT        EXT_CP(50)
  75. #define SELECT_FONT         EXT_CP(51)
  76. #define DELETE_FONT         EXT_CP(52)
  77. #define SET_TEXTATTR        EXT_CP(53)
  78. #define GET_TEXTATTR        EXT_CP(54)
  79. #define TEXT_WIDTH          EXT_CP(55)
  80. #define GET_ENV             EXT_CP(56)
  81. #define DECODE_RECT         EXT_CP(57)
  82. #define ENCODE_RECT         EXT_CP(58)
  83. #define MOVE_PIXEL          EXT_DM(59)
  84. #define PUT_PIXEL           EXT_DM(60)
  85. #define STYLED_OVAL         EXT_DM(61)
  86. #define STYLED_OVALARC      EXT_DM(62)
  87. #define STYLED_PIEARC       EXT_DM(63)
  88. #define IN_FONT             EXT_CP(64)
  89.                                      
  90. /*----------------------------------------------------------------------*/
  91. /*  C-Packet function definitions                                       */
  92. /*----------------------------------------------------------------------*/
  93. #define set_dstbm(a,b,c,d,e)        \
  94.         cp_cmd(SET_DSTBM,5,_DWORD(a),_WORD(b),_WORD(c),_WORD(d),_WORD(e))
  95. #define set_srcbm(a,b,c,d,e)        \
  96.         cp_cmd(SET_SRCBM,5,_DWORD(a),_WORD(b),_WORD(c),_WORD(d),_WORD(e))
  97. #define styled_line(a,b,c,d,e,f)    \
  98.         cp_cmd(STYLED_LINE,6,_SWORD(a),_SWORD(b),_SWORD(c),_SWORD(d),_DWORD(e),_WORD(f))
  99. #define swap_bm()                   \
  100.         cp_cmd(SWAP_BM,0)
  101. #define draw_polyline_a(a,b)        \
  102.         cp_cmd_a(DRAW_POLYLINE_A,2,_WORD(a),_WORD_PTR(2*(a),b))
  103. #define fill_convex_a(a,b)          \
  104.         cp_cmd_a(FILL_CONVEX_A,2,_WORD(a),_WORD_PTR(2*(a),b))
  105. #define fill_polygon_a(a,b)         \
  106.         cp_cmd_a(FILL_POLYGON_A,2,_WORD(a),_WORD_PTR(2*(a),b))
  107. #define patnfill_convex_a(a,b)      \
  108.         cp_cmd_a(PATNFILL_CONVEX_A,2,_WORD(a),_WORD_PTR(2*(a),b))
  109. #define patnfill_polygon_a(a,b)     \
  110.         cp_cmd_a(PATNFILL_POLYGON_A,2,_WORD(a),_WORD_PTR(2*(a),b))
  111. #define patnpen_polyline_a(a,b)     \
  112.         cp_cmd_a(PATNPEN_POLYLINE_A,2,_WORD(a),_WORD_PTR(2*(a),b))
  113. #define pen_polyline_a(a,b)         \
  114.         cp_cmd_a(PEN_POLYLINE_A,2,_WORD(a),_WORD_PTR(2*(a),b))
  115. #define install_font(a)             \
  116.         (short)cp_ret(INSTALL_FONT,1,_DWORD(a))
  117. #define select_font(a)              \
  118.         (short)cp_ret(SELECT_FONT,1,_WORD(a))
  119. #define delete_font(a)              \
  120.         (short)cp_ret(DELETE_FONT,1,_WORD(a))
  121. #define set_textattr(a,b,c)         \
  122.         (short)cp_ret(SET_TEXTATTR,3,_STRING(a),_WORD(b),_WORD_PTR(b,c))
  123. #define get_textattr(a,b,c)         \
  124.         (short)cp_alt(GET_TEXTATTR,3,_STRING(a),_WORD(b),_ALTWORD_PTR(b,c))
  125. #define text_width(a)               \
  126.         (short)cp_ret(TEXT_WIDTH,1,_STRING(a))
  127. #define get_env(a)                  \
  128.         (void)cp_alt(GET_ENV,1,_ALTBYTE_PTR(sizeof(ENVIRONMENT),a))
  129. #define decode_rect(a,b,c)          \
  130.         (short)cp_ret(DECODE_RECT,3,_WORD(a),_WORD(b),_DWORD(c))
  131. #define encode_rect(a,b,c,d,e,f,g)  \
  132.         cp_ret(ENCODE_RECT,7,_WORD(a),_WORD(b),_WORD(c),_WORD(d),   \
  133.                              _DWORD(e),_DWORD(f),_WORD(g))
  134. #define in_font(a,b)                \
  135.         (short)cp_ret(IN_FONT,2,_WORD(a),_WORD(b))
  136.  
  137. /*----------------------------------------------------------------------*/
  138. /*  Direct-Mode function defintions                                     */
  139. /*----------------------------------------------------------------------*/
  140. #define bitblt(a,b,c,d,e,f)         \
  141.         dm_cmd(BITBLT,6,(short)(a),(short)(b),(short)(c),\
  142.                              (short)(d),(short)(e),(short)(f))
  143. #define draw_line(a,b,c,d)          \
  144.         dm_cmd(DRAW_LINE,4,(short)(a),(short)(b),(short)(c),(short)(d))
  145. #define draw_oval(a,b,c,d)          \
  146.         dm_cmd(DRAW_OVAL,4,(short)(a),(short)(b),(short)(c),(short)(d))
  147. #define draw_ovalarc(a,b,c,d,e,f)   \
  148.         dm_cmd(DRAW_OVALARC,6,(short)(a),(short)(b),(short)(c), \
  149.                              (short)(d),(short)(e),(short)(f))
  150. #define draw_piearc(a,b,c,d,e,f)    \
  151.         dm_cmd(DRAW_PIEARC,6,(short)(a),(short)(b),(short)(c), \
  152.                              (short)(d),(short)(e),(short)(f))
  153. #define draw_point(a,b)             \
  154.         dm_cmd(DRAW_POINT,2,(short)(a),(short)(b))
  155. #define draw_polyline(a,b)          \
  156.         dm_psnd(DRAW_POLYLINE,(short)(4*(a)),(short far *)(b))
  157. #define draw_rect(a,b,c,d)          \
  158.         dm_cmd(DRAW_RECT,4,(short)(a),(short)(b),(short)(c),(short)(d))
  159. #define fill_convex(a,b)            \
  160.         dm_psnd(FILL_CONVEX,(short)(4*(a)),(short far *)b)
  161. #define fill_oval(a,b,c,d)          \
  162.         dm_cmd(FILL_OVAL,4,(short)(a),(short)(b),(short)(c),(short)(d))
  163. #define fill_piearc(a,b,c,d,e,f)    \
  164.         dm_cmd(FILL_PIEARC,6,(short)(a),(short)(b),(short)(c), \
  165.                              (short)(d),(short)(e),(short)(f))
  166. #define fill_polygon(a,b)           \
  167.         dm_psnd(FILL_POLYGON,(short)(4*(a)),(short far *)(b))
  168. #define fill_rect(a,b,c,d)          \
  169.         dm_cmd(FILL_RECT,4,(short)(a),(short)(b),(short)(c),(short)(d))
  170. #define frame_oval(a,b,c,d,e,f)     \
  171.         dm_cmd(FRAME_OVAL,6,(short)(a),(short)(b),(short)(c), \
  172.                              (short)(d),(short)(e),(short)(f))
  173. #define frame_rect(a,b,c,d,e,f)     \
  174.         dm_cmd(FRAME_RECT,6,(short)(a),(short)(b),(short)(c), \
  175.                              (short)(d),(short)(e),(short)(f))
  176. #define get_pixel(a,b)              \
  177.         dm_ret(GET_PIXEL,2,(short)(a),(short)(b))
  178. #define patnfill_convex(a,b)        \
  179.         dm_psnd(PATNFILL_CONVEX,4*(a),(short far *)b)
  180. #define patnfill_oval(a,b,c,d)      \
  181.         dm_cmd(PATNFILL_OVAL,4,(short)(a),(short)(b),(short)(c),(short)(d))
  182. #define patnfill_piearc(a,b,c,d,e,f)\
  183.         dm_cmd(PATNFILL_PIEARC,6,(short)(a),(short)(b),(short)(c), \
  184.                              (short)(d),(short)(e),(short)(f))
  185. #define patnfill_polygon(a,b)       \
  186.         dm_psnd(PATNFILL_POLYGON,(short)(4*(a)),(short far *)(b))
  187. #define patnfill_rect(a,b,c,d)      \
  188.         dm_cmd(PATNFILL_RECT,4,(short)(a),(short)(b),(short)(c),(short)(d))
  189. #define patnframe_oval(a,b,c,d,e,f) \
  190.         dm_cmd(PATNFRAME_OVAL,6,(short)(a),(short)(b),(short)(c), \
  191.                              (short)(d),(short)(e),(short)(f))
  192. #define patnframe_rect(a,b,c,d,e,f) \
  193.         dm_cmd(PATNFRAME_RECT,6,(short)(a),(short)(b),(short)(c), \
  194.                              (short)(d),(short)(e),(short)(f))
  195. #define patnpen_line(a,b,c,d)       \
  196.         dm_cmd(PATNPEN_LINE,4,(short)(a),(short)(b),(short)(c),(short)(d))
  197. #define patnpen_ovalarc(a,b,c,d,e,f)\
  198.         dm_cmd(PATNPEN_OVALARC,6,(short)(a),(short)(b),(short)(c), \
  199.                              (short)(d),(short)(e),(short)(f))
  200. #define patnpen_piearc(a,b,c,d,e,f) \
  201.         dm_cmd(PATNPEN_PIEARC,6,(short)(a),(short)(b),(short)(c), \
  202.                              (short)(d),(short)(e),(short)(f))
  203. #define patnpen_point(a,b)          \
  204.         dm_cmd(PATNPEN_POINT,2,(short)(a),(short)(b))
  205. #define patnpen_polyline(a,b)       \
  206.         dm_psnd(PATNPEN_POLYLINE,(short)(4*(a)),(short far *)(b))
  207. #define pen_line(a,b,c,d)           \
  208.         dm_cmd(PEN_LINE,4,(short)(a),(short)(b),(short)(c),(short)(d))
  209. #define pen_ovalarc(a,b,c,d,e,f)    \
  210.         dm_cmd(PEN_OVALARC,6,(short)(a),(short)(b),(short)(c), \
  211.                              (short)(d),(short)(e),(short)(f))
  212. #define pen_piearc(a,b,c,d,e,f)     \
  213.         dm_cmd(PEN_PIEARC,6,(short)(a),(short)(b),(short)(c), \
  214.                              (short)(d),(short)(e),(short)(f))
  215. #define pen_point(a,b)              \
  216.         dm_cmd(PEN_POINT,2,(short)(a),(short)(b))
  217. #define pen_polyline(a,b)           \
  218.         dm_psnd(PEN_POLYLINE,(short)(4*(a)),(short far *)(b))
  219. #define seed_fill(a,b,c,d)          \
  220.         dm_cmd(SEED_FILL,5,(short)(a),(short)(b),(long)(c),(short)(d))
  221. #define seed_patnfill(a,b,c,d)      \
  222.         dm_cmd(SEED_PATNFILL,5,(short)(a),(short)(b),(long)(c),(short)(d))
  223. #define set_draw_origin(a,b)        \
  224.         dm_cmd(SET_DRAW_ORIGIN,2,(short)(a),(short)(b))
  225. #define set_pensize(a,b)            \
  226.         dm_cmd(SET_PENSIZE,2,(short)(a),(short)(b))
  227. #define zoom_rect(a,b,c,d,e,f,g,h,i)\
  228.         dm_cmd(ZOOM_RECT,10,(short)(a),(short)(b),(short)(c), \
  229.                               (short)(d),(short)(e),(short)(f), \
  230.                               (short)(g),(short)(h),(long)(i))
  231. #define set_patn(a)                 \
  232.         dm_psnd(SET_PATN,(short)(sizeof(PATTERN)),(char far *)(a))
  233. #define move_pixel(a,b,c,d)         \
  234.         dm_cmd(MOVE_PIXEL,4,(short)(a),(short)(b),(short)(c),(short)(d))
  235. #define put_pixel(a,b,c)            \
  236.         dm_cmd(PUT_PIXEL,4,(unsigned long)(a),(short)(b),(short)(c))
  237. #define styled_oval(a,b,c,d,e,f)    \
  238.         dm_cmd(STYLED_OVAL,7,(short)(a),(short)(b),(short)(c),(short)(d), \
  239.                              (unsigned long)(e),(short)(f))
  240. #define styled_ovalarc(a,b,c,d,e,f,g,h) \
  241.         dm_cmd(STYLED_OVALARC,9,(short)(a),(short)(b),(short)(c),(short)(d), \
  242.                 (short)(e),(short)(f),(unsigned long)(g),(short)(h))
  243. #define styled_piearc(a,b,c,d,e,f,g,h)  \
  244.         dm_cmd(STYLED_PIEARC, 9,(short)(a),(short)(b),(short)(c),(short)(d), \
  245.                 (short)(e),(short)(f),(unsigned long)(g),(short)(h))
  246.  
  247.  
  248.  
  249.