Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1747 lines
70 KiB

  1. /*
  2. File: RAVE.h
  3. Contains: Interface for RAVE (Renderer Acceleration Virtual Engine)
  4. Version: Technology: Quickdraw 3D 1.6
  5. Release: QuickTime 7.3
  6. Copyright: (c) 2007 (c) 1995-1999 by Apple Computer, Inc., all rights reserved.
  7. Bugs?: For bug reports, consult the following page on
  8. the World Wide Web:
  9. http://developer.apple.com/bugreporter/
  10. */
  11. #ifndef __RAVE__
  12. #define __RAVE__
  13. #ifndef __CONDITIONALMACROS__
  14. #include <ConditionalMacros.h>
  15. #endif
  16. #if TARGET_OS_MAC
  17. #ifndef __MACTYPES__
  18. #include <MacTypes.h>
  19. #endif
  20. #ifndef __QUICKDRAW__
  21. #include <Quickdraw.h>
  22. #endif
  23. #ifndef __QDOFFSCREEN__
  24. #include <QDOffscreen.h>
  25. #endif
  26. #endif /* TARGET_OS_MAC */
  27. #if TARGET_OS_WIN32
  28. #include <windows.h>
  29. #ifndef RAVE_NO_DIRECTDRAW
  30. #include <ddraw.h>
  31. #endif /* !defined(RAVE_NO_DIRECTDRAW) */
  32. #endif /* TARGET_OS_WIN32 */
  33. #if PRAGMA_ONCE
  34. #pragma once
  35. #endif
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif
  39. #if PRAGMA_IMPORT
  40. #pragma import on
  41. #endif
  42. #if PRAGMA_STRUCT_ALIGN
  43. #pragma options align=power
  44. #elif PRAGMA_STRUCT_PACKPUSH
  45. #pragma pack(push, 2)
  46. #elif PRAGMA_STRUCT_PACK
  47. #pragma pack(2)
  48. #endif
  49. #if PRAGMA_ENUM_ALWAYSINT
  50. #if defined(__fourbyteints__) && !__fourbyteints__
  51. #define __RAVE__RESTORE_TWOBYTEINTS
  52. #pragma fourbyteints on
  53. #endif
  54. #pragma enumsalwaysint on
  55. #elif PRAGMA_ENUM_OPTIONS
  56. #pragma option enum=int
  57. #elif PRAGMA_ENUM_PACK
  58. #if __option(pack_enums)
  59. #define __RAVE__RESTORE_PACKED_ENUMS
  60. #pragma options(!pack_enums)
  61. #endif
  62. #endif
  63. #define RAVE_OBSOLETE 0
  64. /******************************************************************************
  65. *
  66. * Platform macros.
  67. * This sets kQAPlatform to one of kQAMacOS, kQAWin32, or kQAGeneric.
  68. * kQAPlatform controls platform-specific compilation switches and types.
  69. *
  70. *****************************************************************************/
  71. #if !defined(kQAMacOS)
  72. #define kQAMacOS 1 /* Target is MacOS */
  73. #endif
  74. #if !defined(kQAGeneric)
  75. #define kQAGeneric 2 /* Target is generic platform */
  76. #endif
  77. #if !defined(kQAWin32)
  78. #define kQAWin32 3 /* Target is Win32 */
  79. #endif
  80. #if defined(_WIN32) || defined(_WINDOWS)
  81. #define kQAPlatform kQAWin32
  82. #elif !defined(kQAPlatform)
  83. #define kQAPlatform kQAMacOS
  84. #endif
  85. /******************************************************************************
  86. *
  87. * Export Control
  88. *
  89. *****************************************************************************/
  90. #if defined(_MSC_VER)
  91. /* Microsoft Visual C */
  92. #if defined(WIN32_RAVEEXPORTING)
  93. /* define when building DLL */
  94. #define RAVE_EXPORT __declspec( dllexport )
  95. #define RAVE_CALL
  96. #define RAVE_CALLBACK
  97. #else
  98. #define RAVE_EXPORT __declspec( dllimport )
  99. #define RAVE_CALL __cdecl
  100. #define RAVE_CALLBACK __cdecl
  101. #endif
  102. /* WIN32_RAVEEXPORTING */
  103. #else
  104. #define RAVE_EXPORT
  105. #define RAVE_CALL
  106. #define RAVE_CALLBACK
  107. #endif
  108. /* _MSC_VER */
  109. /******************************************************************************
  110. *
  111. * Platform dependent datatypes: TQAImagePixelType, TQADevice, TQAClip, and TQARect.
  112. *
  113. *****************************************************************************/
  114. enum TQAImagePixelType {
  115. kQAPixel_Alpha1 = 0, /* 1 bit/pixel alpha */
  116. kQAPixel_RGB16 = 1, /* 16 bits/pixel, R=14:10, G=9:5, B=4:0 */
  117. kQAPixel_ARGB16 = 2, /* 16 bits/pixel, A=15, R=14:10, G=9:5, B=4:0 */
  118. kQAPixel_RGB32 = 3, /* 32 bits/pixel, R=23:16, G=15:8, B=7:0 */
  119. kQAPixel_ARGB32 = 4, /* 32 bits/pixel, A=31:24, R=23:16, G=15:8, B=7:0 */
  120. kQAPixel_CL4 = 5, /* 4 bit color look up table, always big endian, ie high 4 bits effect left pixel */
  121. kQAPixel_CL8 = 6, /* 8 bit color look up table */
  122. kQAPixel_RGB16_565 = 7, /* Win32 ONLY 16 bits/pixel, no alpha, R:5, G:6, B:5 */
  123. kQAPixel_RGB24 = 8, /* Win32 ONLY 24 bits/pixel, no alpha, R:8, G:8, B:8 */
  124. kQAPixel_RGB8_332 = 9, /* 8 bits/pixel, R=7:5, G = 4:2, B = 1:0 */
  125. kQAPixel_ARGB16_4444 = 10, /* 16 bits/pixel, A=15:12, R=11:8, G=7:4, B=3:0 */
  126. kQAPixel_ACL16_88 = 11, /* 16 bits/pixel, A=15:8, CL=7:0, 8 bit alpha + 8 bit color lookup */
  127. kQAPixel_I8 = 12, /* 8 bits/pixel, I=7:0, intensity map (grayscale) */
  128. kQAPixel_AI16_88 = 13, /* 16 bits/pixel, A=15:8, I=7:0, intensity map (grayscale) */
  129. kQAPixel_YUVS = 14, /* 16 bits/pixel, QD's kYUVSPixelFormat (4:2:2, YUYV ordering, unsigned UV) */
  130. kQAPixel_YUVU = 15, /* 16 bits/pixel, QD's kYUVUPixelFormat (4:2:2, YUYV ordering, signed UV) */
  131. kQAPixel_YVYU422 = 16, /* 16 bits/pixel, QD's kYVYU422PixelFormat (4:2:2, YVYU ordering, unsigned UV) */
  132. kQAPixel_UYVY422 = 17 /* 16 bits/pixel, QD's kUYVY422PixelFormat (4:2:2, UYVY ordering, unsigned UV) */
  133. };
  134. typedef enum TQAImagePixelType TQAImagePixelType;
  135. enum TQAColorTableType {
  136. kQAColorTable_CL8_RGB32 = 0, /* 256 entry, 32 bit/pixel, R=23:16, G=15:8, B=7:0 */
  137. kQAColorTable_CL4_RGB32 = 1 /* 16 entry, 32 bit/pixel, R=23:16, G=15:8, B=7:0 */
  138. };
  139. typedef enum TQAColorTableType TQAColorTableType;
  140. /* Selects target device type */
  141. enum TQADeviceType {
  142. kQADeviceMemory = 0, /* Memory draw context */
  143. kQADeviceGDevice = 1, /* Macintosh GDevice draw context */
  144. kQADeviceWin32DC = 2, /* Win32 DC */
  145. kQADeviceDDSurface = 3 /* Win32 DirectDraw Surface */
  146. };
  147. typedef enum TQADeviceType TQADeviceType;
  148. /* Generic memory pixmap device */
  149. struct TQADeviceMemory {
  150. long rowBytes; /* Rowbytes */
  151. TQAImagePixelType pixelType; /* Depth, color space, etc. */
  152. long width; /* Width in pixels */
  153. long height; /* Height in pixels */
  154. void * baseAddr; /* Base address of pixmap */
  155. };
  156. typedef struct TQADeviceMemory TQADeviceMemory;
  157. /* Offscreen Device */
  158. struct TQADeviceOffscreen {
  159. TQAImagePixelType pixelType; /* Depth, color space, etc. */
  160. };
  161. typedef struct TQADeviceOffscreen TQADeviceOffscreen;
  162. /* Selects target clip type */
  163. enum TQAClipType {
  164. kQAClipRgn = 0, /* Macintosh clipRgn with serial number */
  165. kQAClipWin32Rgn = 1 /* Win32 clip region */
  166. };
  167. typedef enum TQAClipType TQAClipType;
  168. struct TQARect {
  169. long left;
  170. long right;
  171. long top;
  172. long bottom;
  173. };
  174. typedef struct TQARect TQARect;
  175. #if TARGET_OS_MAC
  176. union TQAPlatformDevice {
  177. TQADeviceMemory memoryDevice;
  178. GDHandle gDevice;
  179. };
  180. typedef union TQAPlatformDevice TQAPlatformDevice;
  181. union TQAPlatformClip {
  182. RgnHandle clipRgn;
  183. };
  184. typedef union TQAPlatformClip TQAPlatformClip;
  185. typedef CALLBACK_API( void , TQADrawNotificationProcPtr )(short left, short top, short right, short bottom, long refCon);
  186. typedef long TQADrawNotificationProcRefNum;
  187. /* used to unregister your proc */
  188. #elif TARGET_OS_WIN32
  189. #if !defined(RAVE_NO_DIRECTDRAW)
  190. enum TQADirectDrawObjectSelector
  191. {
  192. kQADirectDrawObject = 1,
  193. kQADirectDrawObject2 = 2
  194. };
  195. typedef enum TQADirectDrawObjectSelector TQADirectDrawObjectSelector;
  196. enum TQADirectDrawSurfaceSelector
  197. {
  198. kQADirectDrawSurface = 1,
  199. kQADirectDrawSurface2 = 2
  200. };
  201. typedef enum TQADirectDrawSurfaceSelector TQADirectDrawSurfaceSelector;
  202. #endif /* !RAVE_NO_DIRECTDRAW */
  203. union TQAPlatformDevice
  204. {
  205. TQADeviceMemory memoryDevice;
  206. HDC hdc;
  207. #if !defined(RAVE_NO_DIRECTDRAW)
  208. struct
  209. {
  210. TQADirectDrawObjectSelector objectSelector;
  211. union
  212. {
  213. LPDIRECTDRAW lpDirectDraw;
  214. LPDIRECTDRAW2 lpDirectDraw2;
  215. };
  216. TQADirectDrawSurfaceSelector surfaceSelector;
  217. union
  218. {
  219. LPDIRECTDRAWSURFACE lpDirectDrawSurface;
  220. LPDIRECTDRAWSURFACE2 lpDirectDrawSurface2;
  221. };
  222. };
  223. #endif /* RAVE_NO_DIRECTDRAW */
  224. };
  225. typedef union TQAPlatformDevice TQAPlatformDevice;
  226. union TQAPlatformClip
  227. {
  228. HRGN clipRgn;
  229. };
  230. typedef union TQAPlatformClip TQAPlatformClip;
  231. #else
  232. /*
  233. * Generic platform supports memory device only. TQARect is generic. TQAClip is ???.
  234. */
  235. union TQAPlatformDevice {
  236. TQADeviceMemory memoryDevice;
  237. };
  238. typedef union TQAPlatformDevice TQAPlatformDevice;
  239. union TQAPlatformClip {
  240. void * region; /* ??? */
  241. };
  242. typedef union TQAPlatformClip TQAPlatformClip;
  243. #endif /* */
  244. struct TQADevice {
  245. TQADeviceType deviceType;
  246. TQAPlatformDevice device;
  247. };
  248. typedef struct TQADevice TQADevice;
  249. struct TQAClip {
  250. TQAClipType clipType;
  251. TQAPlatformClip clip;
  252. };
  253. typedef struct TQAClip TQAClip;
  254. /******************************************************************************
  255. *
  256. * Basic data types.
  257. *
  258. *****************************************************************************/
  259. /* Pointer to a drawing engine */
  260. typedef struct TQAEngine TQAEngine;
  261. /* Pointer to an allocated texture */
  262. typedef struct TQATexture TQATexture;
  263. /* Pointer to an allocated bitmap */
  264. typedef struct TQABitmap TQABitmap;
  265. /* Engine's private draw context pointer */
  266. typedef struct TQADrawPrivate TQADrawPrivate;
  267. /* An engine specific color table structure */
  268. typedef struct TQAColorTable TQAColorTable;
  269. /* A single triangle element for QADrawTriMesh */
  270. struct TQAIndexedTriangle {
  271. unsigned long triangleFlags; /* Triangle flags, see kQATriFlags_ */
  272. unsigned long vertices[3]; /* Indices into a vertex array */
  273. };
  274. typedef struct TQAIndexedTriangle TQAIndexedTriangle;
  275. /* An image for use as texture or bitmap */
  276. struct TQAImage {
  277. long width; /* Width of pixmap */
  278. long height; /* Height of pixmap */
  279. long rowBytes; /* Rowbytes of pixmap */
  280. void * pixmap; /* Pixmap */
  281. };
  282. typedef struct TQAImage TQAImage;
  283. /* a pixel buffer */
  284. typedef TQADeviceMemory TQAPixelBuffer;
  285. /* a zbuffer */
  286. struct TQAZBuffer {
  287. long width; /* Width of pixmap */
  288. long height; /* Height of pixmap */
  289. long rowBytes; /* Rowbytes of pixmap */
  290. void * zbuffer; /* pointer to the zbuffer data */
  291. long zDepth; /* bit depth of zbuffer (16,24,32...) */
  292. long isBigEndian; /* true if zbuffer values are in big-endian format, false if little-endian */
  293. };
  294. typedef struct TQAZBuffer TQAZBuffer;
  295. /* Standard error type */
  296. enum TQAError {
  297. kQANoErr = 0, /* No error */
  298. kQAError = 1, /* Generic error flag */
  299. kQAOutOfMemory = 2, /* Insufficient memory */
  300. kQANotSupported = 3, /* Requested feature is not supported */
  301. kQAOutOfDate = 4, /* A newer drawing engine was registered */
  302. kQAParamErr = 5, /* Error in passed parameters */
  303. kQAGestaltUnknown = 6, /* Requested gestalt type isn't available */
  304. kQADisplayModeUnsupported = 7, /* Engine cannot render to the display in its current , */
  305. /* mode, but could if it were in some other mode */
  306. kQAOutOfVideoMemory = 8 /* There is not enough VRAM to support the desired context dimensions */
  307. };
  308. typedef enum TQAError TQAError;
  309. /* TQABoolean */
  310. typedef unsigned char TQABoolean;
  311. /************************************************************************************************
  312. *
  313. * Vertex data types.
  314. *
  315. ***********************************************************************************************/
  316. /*
  317. * TQAVGouraud is used for Gouraud shading. Each vertex specifies position, color and Z.
  318. *
  319. * Alpha is always treated as indicating transparency. Drawing engines which don't
  320. * support Z-sorted rendering use the back-to-front transparency blending functions
  321. * shown below. (ARGBsrc are the source (new) values, ARGBdest are the destination
  322. * (previous) pixel values.)
  323. *
  324. * Premultiplied Interpolated
  325. *
  326. * A = 1 - (1 - Asrc) * (1 - Adest) A = 1 - (1 - Asrc) * (1 - Adest)
  327. * R = (1 - Asrc) * Rdest + Rsrc R = (1 - Asrc) * Rdest + Asrc * Rsrc
  328. * G = (1 - Asrc) * Gdest + Gsrc G = (1 - Asrc) * Gdest + Asrc * Gsrc
  329. * B = (1 - Asrc) * Bdest + Bsrc B = (1 - Asrc) * Bdest + Asrc * Bsrc
  330. *
  331. * Note that the use of other blending modes to implement antialiasing is performed
  332. * automatically by the drawing engine when the kQATag_Antialias variable !=
  333. * kQAAntiAlias_Fast. The driving software should continue to use the alpha fields
  334. * for transparency even when antialiasing is being used (the drawing engine will
  335. * resolve the multiple blending requirements as best as it can).
  336. *
  337. * Drawing engines which perform front-to-back Z-sorted rendering should replace
  338. * the blending function shown above with the equivalent front-to-back formula.
  339. */
  340. struct TQAVGouraud {
  341. float x; /* X pixel coordinate, 0.0 <= x < width */
  342. float y; /* Y pixel coordinate, 0.0 <= y < height */
  343. float z; /* Z coordinate, 0.0 <= z <= 1.0 */
  344. float invW; /* 1 / w; required only when kQAPerspectiveZ_On is set */
  345. float r; /* Red, 0.0 <= r <= 1.0 */
  346. float g; /* Green, 0.0 <= g <= 1.0 */
  347. float b; /* Blue, 0.0 <= b <= 1.0 */
  348. float a; /* Alpha, 0.0 <= a <= 1.0, 1.0 is opaque */
  349. };
  350. typedef struct TQAVGouraud TQAVGouraud;
  351. /*
  352. * TQAVTexture is used for texture mapping. The texture mapping operation
  353. * is controlled by the kQATag_TextureOp variable, which is a mask of
  354. * kQATextureOp_None/Modulate/Highlight/Decal. Below is pseudo-code for the
  355. * texture shading operation:
  356. *
  357. * texPix = TextureLookup (uq/q, vq/q);
  358. * if (kQATextureOp_Decal)
  359. * {
  360. * texPix.r = texPix.a * texPix.r + (1 - texPix.a) * r;
  361. * texPix.g = texPix.a * texPix.g + (1 - texPix.a) * g;
  362. * texPix.b = texPix.a * texPix.b + (1 - texPix.a) * b;
  363. * texPix.a = a;
  364. * }
  365. * else
  366. * {
  367. * texPix.a = texPix.a * a;
  368. * }
  369. * if (kQATextureOp_Modulate)
  370. * {
  371. * texPix.r *= kd_r; // Clamped to prevent overflow
  372. * texPix.g *= kd_g; // Clamped to prevent overflow
  373. * texPix.b *= kd_b; // Clamped to prevent overflow
  374. * }
  375. * if (kQATextureOp_Highlight)
  376. * {
  377. * texPix.r += ks_r; // Clamped to prevent overflow
  378. * texPix.g += ks_g; // Clamped to prevent overflow
  379. * texPix.b += ks_b; // Clamped to prevent overflow
  380. * }
  381. *
  382. * After computation of texPix, transparency blending (as shown
  383. * above for TQAVGouraud) is performed.
  384. */
  385. struct TQAVTexture {
  386. float x; /* X pixel coordinate, 0.0 <= x < width */
  387. float y; /* Y pixel coordinate, 0.0 <= y < height */
  388. float z; /* Z coordinate, 0.0 <= z <= 1.0 */
  389. float invW; /* 1 / w (always required) */
  390. /* rgb are used only when kQATextureOp_Decal is set. a is always required */
  391. float r; /* Red, 0.0 <= r <= 1.0 */
  392. float g; /* Green, 0.0 <= g <= 1.0 */
  393. float b; /* Blue, 0.0 <= b <= 1.0 */
  394. float a; /* Alpha, 0.0 <= a <= 1.0, 1.0 is opaque */
  395. /* uOverW and vOverW are required by all modes */
  396. float uOverW; /* u / w */
  397. float vOverW; /* v / w */
  398. /* kd_r/g/b are used only when kQATextureOp_Modulate is set */
  399. float kd_r; /* Scale factor for texture red, 0.0 <= kd_r */
  400. float kd_g; /* Scale factor for texture green, 0.0 <= kd_g */
  401. float kd_b; /* Scale factor for texture blue, 0.0 <= kd_b */
  402. /* ks_r/g/b are used only when kQATextureOp_Highlight is set */
  403. float ks_r; /* Red specular highlight, 0.0 <= ks_r <= 1.0 */
  404. float ks_g; /* Green specular highlight, 0.0 <= ks_g <= 1.0 */
  405. float ks_b; /* Blue specular highlight, 0.0 <= ks_b <= 1.0 */
  406. };
  407. typedef struct TQAVTexture TQAVTexture;
  408. /*
  409. * TQAVMultiTexture allows you to specify the uv and invW values
  410. * for secondary textures. This data is submitted with the
  411. * QASubmitMultiTextureParams() call.
  412. */
  413. struct TQAVMultiTexture {
  414. float invW;
  415. float uOverW;
  416. float vOverW;
  417. };
  418. typedef struct TQAVMultiTexture TQAVMultiTexture;
  419. /************************************************************************************************
  420. *
  421. * Constants used for the state variables.
  422. *
  423. ***********************************************************************************************/
  424. /*
  425. * kQATag_xxx is used to select a state variable when calling QASetFloat(), QASetInt(),
  426. * QAGetFloat() and QAGetInt(). The kQATag values are split into three separate enumerated
  427. * types: TQATagInt, TQATagPtr and TQATagFloat. TQATagInt is used for the QASet/GetInt()
  428. * functions, TQATagPtr is used for the QASet/GetPtr() functions, and TQATagFloat is used for
  429. * the QASet/GetFloat() functions. (This is so that a compiler that typechecks enums can flag
  430. * a float/int tag mismatch during compile.)
  431. *
  432. * -=- All tag values must be unique even across all three types. -=-
  433. *
  434. * These variables are required by all drawing engines:
  435. * kQATag_ZFunction (Int) One of kQAZFunction_xxx
  436. * kQATag_ColorBG_a (Float) Background color alpha
  437. * kQATag_ColorBG_r (Float) Background color red
  438. * kQATag_ColorBG_g (Float) Background color green
  439. * kQATag_ColorBG_b (Float) Background color blue
  440. * kQATag_Width (Float) Line and point width (pixels)
  441. * kQATag_ZMinOffset (Float) Min offset to Z to guarantee visibility (Read only!)
  442. * kQATag_ZMinScale (Float) Min scale to Z to guarantee visibility (Read only!)
  443. * These variables are used for optional features:
  444. * kQATag_Antialias (Int) One of kQAAntiAlias_xxx
  445. * kQATag_Blend (Int) One of kQABlend_xxx
  446. * kQATag_PerspectiveZ (Int) One of kQAPerspectiveZ_xxx
  447. * kQATag_TextureFilter (Int) One of kQATextureFilter_xxx
  448. * kQATag_TextureOp (Int) Mask of kQATextureOp_xxx
  449. * kQATag_Texture (Ptr) Pointer to current TQATexture
  450. * kQATag_CSGTag (Int) One of kQACSGTag_xxx
  451. * kQATag_CSGEquation (Int) 32 bit CSG truth table
  452. * kQATag_FogMode (Int) One of kQAFogMode_xxxx
  453. * kQATag_FogColor_a (Float) Fog color alpha
  454. * kQATag_FogColor_r (Float) Fog color red
  455. * kQATag_FogColor_g (Float) Fog color green
  456. * kQATag_FogColor_b (Float) Fog color blue
  457. * kQATag_FogStart (Float) Fog start
  458. * kQATag_FogEnd (Float) Fog end
  459. * kQATag_FogDensity (Float) Fog density
  460. * kQATag_FogMaxDepth (Float) Maximun value for 1.0 / invW
  461. * kQATag_MipmapBias (Float) The mipmap page bias factor
  462. * kQATag_ChannelMask (Int) one of kQAChannelMask_xxx
  463. * kQATag_ZBufferMask (Int) one of kQAZBufferMask_xxx
  464. * kQATag_ZSortedHint (Int) 1 = depth sort transparent triangles, 0 = do not sort.
  465. * kQATag_Chromakey_r (Float) chroma key red
  466. * kQATag_Chromakey_g (Float) chroma key green
  467. * kQATag_Chromakey_b (Float) chroma key blue
  468. * kQATag_ChromakeyEnable (Int) 1 = enable chroma keying, 0 = disable chroma keying
  469. * kQATag_AlphaTestFunc (Int) one of kQAAlphaTest_xxx
  470. * kQATag_AlphaTestRef (Float) from 0 to 1
  471. * kQATag_DontSwap (Int) 1 = dont swap buffers during QARenderEnd, 0 = do swap buffers during QARenderEnd.
  472. * kQATag_MultiTextureOp (Int) One of kQAMultiTexture_xxx
  473. * kQATag_MultiTextureFilter (Int) One of kQATextureFilter_xxx
  474. * kQATag_MultiTextureCurrent (Int) which multitexture layer to use for all other multitexture funcs
  475. * kQATag_MultiTextureEnable (Int) how many multitexture layers to use (0 = no multitexturing).
  476. * kQATag_MultiTextureWrapU (Int)
  477. * kQATag_MultiTextureWrapV (Int)
  478. * kQATag_MultiTextureMagFilter (Int)
  479. * kQATag_MultiTextureMinFilter (Int)
  480. * kQATag_MultiTextureBorder_a (Float)
  481. * kQATag_MultiTextureBorder_r (Float)
  482. * kQATag_MultiTextureBorder_g (Float)
  483. * kQATag_MultiTextureBorder_b (Float)
  484. * kQATag_MultiTextureMipmapBias (Float)
  485. * kQATag_MultiTextureFactor (Float) used with kQAMultiTexture_Fixed to determine blending factor
  486. *
  487. * These variables are used for OpenGL(tm) support:
  488. * kQATagGL_DrawBuffer (Int) Mask of kQAGL_DrawBuffer_xxx
  489. * kQATagGL_TextureWrapU (Int) kQAGL_Clamp or kQAGL_Repeat
  490. * kQATagGL_TextureWrapV (Int) kQAGL_Clamp or kQAGL_Repeat
  491. * kQATagGL_TextureMagFilter (Int) kQAGL_Nearest or kQAGL_Linear
  492. * kQATagGL_TextureMinFilter (Int) kQAGL_Nearest, etc.
  493. * kQATagGL_ScissorXMin (Int) Minimum X value for scissor rectangle
  494. * kQATagGL_ScissorYMin (Int) Minimum Y value for scissor rectangle
  495. * kQATagGL_ScissorXMax (Int) Maximum X value for scissor rectangle
  496. * kQATagGL_ScissorYMax (Int) Maximum Y value for scissor rectangle
  497. * kQATagGL_BlendSrc (Int) Source blending operation
  498. * kQATagGL_BlendDst (Int) Destination blending operation
  499. * kQATagGL_LinePattern (Int) Line rasterization pattern
  500. * kQATagGL_AreaPattern0 (Int) First of 32 area pattern registers
  501. * kQATagGL_AreaPattern31 (Int) Last of 32 area pattern registers
  502. *
  503. * kQATagGL_DepthBG (Float) Background Z
  504. * kQATagGL_TextureBorder_a (Float) Texture border color alpha
  505. * kQATagGL_TextureBorder_r (Float) Texture border color red
  506. * kQATagGL_TextureBorder_g (Float) Texture border color green
  507. * kQATagGL_TextureBorder_b (Float) Texture border color blue
  508. *
  509. * Tags >= kQATag_EngineSpecific_Minimum may be assigned by the vendor for use as
  510. * engine-specific variables. NOTE: These should be used only in exceptional circumstances,
  511. * as functions performed by these variables won't be generally accessible. All other tag
  512. * values are reserved.
  513. *
  514. * kQATag_EngineSpecific_Minimum Minimum tag value for drawing-engine specific variables
  515. */
  516. enum TQATagInt {
  517. kQATag_ZFunction = 0,
  518. kQATag_Antialias = 8,
  519. kQATag_Blend = 9,
  520. kQATag_PerspectiveZ = 10,
  521. kQATag_TextureFilter = 11,
  522. kQATag_TextureOp = 12,
  523. kQATag_CSGTag = 14,
  524. kQATag_CSGEquation = 15,
  525. kQATag_BufferComposite = 16,
  526. kQATag_FogMode = 17,
  527. kQATag_ChannelMask = 27,
  528. kQATag_ZBufferMask = 28,
  529. kQATag_ZSortedHint = 29,
  530. kQATag_ChromakeyEnable = 30,
  531. kQATag_AlphaTestFunc = 31,
  532. kQATag_DontSwap = 32,
  533. kQATag_MultiTextureEnable = 33,
  534. kQATag_MultiTextureCurrent = 34,
  535. kQATag_MultiTextureOp = 35,
  536. kQATag_MultiTextureFilter = 36,
  537. kQATag_MultiTextureWrapU = 37,
  538. kQATag_MultiTextureWrapV = 38,
  539. kQATag_MultiTextureMagFilter = 39,
  540. kQATag_MultiTextureMinFilter = 40,
  541. kQATag_BitmapFilter = 54, /* filter to use while scaling bitmaps, one of kQAFilter_xxx */
  542. kQATag_DrawContextFilter = 55, /* filter to use while scaling draw contexts, one of kQAFilter_xxx */
  543. kQATagGL_DrawBuffer = 100,
  544. kQATagGL_TextureWrapU = 101,
  545. kQATagGL_TextureWrapV = 102,
  546. kQATagGL_TextureMagFilter = 103,
  547. kQATagGL_TextureMinFilter = 104,
  548. kQATagGL_ScissorXMin = 105,
  549. kQATagGL_ScissorYMin = 106,
  550. kQATagGL_ScissorXMax = 107,
  551. kQATagGL_ScissorYMax = 108,
  552. kQATagGL_BlendSrc = 109,
  553. kQATagGL_BlendDst = 110,
  554. kQATagGL_LinePattern = 111,
  555. kQATagGL_AreaPattern0 = 117, /* ...kQATagGL_AreaPattern1-30 */
  556. kQATagGL_AreaPattern31 = 148,
  557. kQATagGL_LinePatternFactor = 149, /* equivalent to GL_LINE_STIPPLE_REPEAT */
  558. kQATag_EngineSpecific_Minimum = 1000
  559. };
  560. typedef enum TQATagInt TQATagInt;
  561. enum TQATagPtr {
  562. kQATag_Texture = 13,
  563. kQATag_MultiTexture = 26
  564. };
  565. typedef enum TQATagPtr TQATagPtr;
  566. enum TQATagFloat {
  567. kQATag_ColorBG_a = 1,
  568. kQATag_ColorBG_r = 2,
  569. kQATag_ColorBG_g = 3,
  570. kQATag_ColorBG_b = 4,
  571. kQATag_Width = 5,
  572. kQATag_ZMinOffset = 6,
  573. kQATag_ZMinScale = 7,
  574. kQATag_FogColor_a = 18,
  575. kQATag_FogColor_r = 19,
  576. kQATag_FogColor_g = 20,
  577. kQATag_FogColor_b = 21,
  578. kQATag_FogStart = 22,
  579. kQATag_FogEnd = 23,
  580. kQATag_FogDensity = 24,
  581. kQATag_FogMaxDepth = 25,
  582. kQATag_MipmapBias = 41,
  583. kQATag_MultiTextureMipmapBias = 42,
  584. kQATag_Chromakey_r = 43,
  585. kQATag_Chromakey_g = 44,
  586. kQATag_Chromakey_b = 45,
  587. kQATag_AlphaTestRef = 46,
  588. kQATag_MultiTextureBorder_a = 47,
  589. kQATag_MultiTextureBorder_r = 48,
  590. kQATag_MultiTextureBorder_g = 49,
  591. kQATag_MultiTextureBorder_b = 50,
  592. kQATag_MultiTextureFactor = 51,
  593. kQATag_BitmapScale_x = 52, /* horizontal bitmap scale factor, default value is 1.0 */
  594. kQATag_BitmapScale_y = 53, /* vertical bitmap scale factor, default value is 1.0 */
  595. kQATag_MultiTextureEnvColor_a = 56,
  596. kQATag_MultiTextureEnvColor_r = 57,
  597. kQATag_MultiTextureEnvColor_g = 58,
  598. kQATag_MultiTextureEnvColor_b = 59,
  599. kQATagGL_DepthBG = 112,
  600. kQATagGL_TextureBorder_a = 113,
  601. kQATagGL_TextureBorder_r = 114,
  602. kQATagGL_TextureBorder_g = 115,
  603. kQATagGL_TextureBorder_b = 116,
  604. kQATagGL_TextureEnvColor_a = 150,
  605. kQATagGL_TextureEnvColor_r = 151,
  606. kQATagGL_TextureEnvColor_g = 152,
  607. kQATagGL_TextureEnvColor_b = 153
  608. };
  609. typedef enum TQATagFloat TQATagFloat;
  610. /* kQATag_ZFunction */
  611. enum {
  612. kQAZFunction_None = 0, /* Z is neither tested nor written (same as no Z buffer) */
  613. kQAZFunction_LT = 1, /* Znew < Zbuffer is visible */
  614. kQAZFunction_EQ = 2, /* Znew == Zbuffer is visible */
  615. kQAZFunction_LE = 3, /* Znew <= Zbuffer is visible */
  616. kQAZFunction_GT = 4, /* Znew > Zbuffer is visible */
  617. kQAZFunction_NE = 5, /* Znew != Zbuffer is visible */
  618. kQAZFunction_GE = 6, /* Znew >= Zbuffer is visible */
  619. kQAZFunction_True = 7, /* Znew is always visible */
  620. kQAZFunction_False = 8 /* Znew is never visible */
  621. };
  622. /* kQATag_Width */
  623. #define kQAMaxWidth 128.0
  624. /* kQATag_Antialias */
  625. enum {
  626. kQAAntiAlias_Off = 0,
  627. kQAAntiAlias_Fast = 1,
  628. kQAAntiAlias_Mid = 2,
  629. kQAAntiAlias_Best = 3
  630. };
  631. /* kQATag_Blend */
  632. enum {
  633. kQABlend_PreMultiply = 0,
  634. kQABlend_Interpolate = 1,
  635. kQABlend_OpenGL = 2
  636. };
  637. /* kQATag_BufferComposite */
  638. enum {
  639. kQABufferComposite_None = 0, /* Default: New pixels overwrite initial buffer contents */
  640. kQABufferComposite_PreMultiply = 1, /* New pixels are blended with initial buffer contents via PreMultiply */
  641. kQABufferComposite_Interpolate = 2 /* New pixels are blended with initial buffer contents via Interpolate */
  642. };
  643. /* kQATag_PerspectiveZ */
  644. enum {
  645. kQAPerspectiveZ_Off = 0, /* Use Z for hidden surface removal */
  646. kQAPerspectiveZ_On = 1 /* Use InvW for hidden surface removal */
  647. };
  648. /* kQATag_TextureFilter */
  649. enum {
  650. /* suggested meanings of these values */
  651. kQATextureFilter_Fast = 0, /* No filtering, pick nearest */
  652. kQATextureFilter_Mid = 1, /* Fastest method that does some filtering */
  653. kQATextureFilter_Best = 2 /* Highest quality renderer can do */
  654. };
  655. /* filter tag values */
  656. enum {
  657. /* suggested meanings of these values */
  658. kQAFilter_Fast = 0, /* No filtering, pick nearest */
  659. kQAFilter_Mid = 1, /* Fastest method that does some filtering */
  660. kQAFilter_Best = 2 /* Highest quality renderer can do */
  661. };
  662. /* kQATag_TextureOp (mask of one or more) */
  663. enum {
  664. kQATextureOp_None = 0, /* Default texture mapping mode */
  665. kQATextureOp_Modulate = (1 << 0), /* Modulate texture color with kd_r/g/b */
  666. kQATextureOp_Highlight = (1 << 1), /* Add highlight value ks_r/g/b */
  667. kQATextureOp_Decal = (1 << 2), /* When texture alpha == 0, use rgb instead */
  668. kQATextureOp_Shrink = (1 << 3), /* This is a non-wrapping texture, so the ??? */
  669. kQATextureOp_Blend = (1 << 4) /* Same as GL_TEXTURE_ENV_MODE GL_BLEND */
  670. };
  671. /* kQATag_MultiTextureOp */
  672. enum {
  673. kQAMultiTexture_Add = 0, /* texels are added to form final pixel */
  674. kQAMultiTexture_Modulate = 1, /* texels are multiplied to form final pixel */
  675. kQAMultiTexture_BlendAlpha = 2, /* texels are blended according to 2nd texel's alpha */
  676. kQAMultiTexture_Fixed = 3 /* texels are blended by a fixed factor via kQATag_MultiTextureFactor */
  677. };
  678. /* kQATag_CSGTag */
  679. #define kQACSGTag_None 0xffffffffUL
  680. enum {
  681. kQACSGTag_0 = 0, /* Submitted tris have CSG ID 0 */
  682. kQACSGTag_1 = 1, /* Submitted tris have CSG ID 1 */
  683. kQACSGTag_2 = 2, /* Submitted tris have CSG ID 2 */
  684. kQACSGTag_3 = 3, /* Submitted tris have CSG ID 3 */
  685. kQACSGTag_4 = 4 /* Submitted tris have CSG ID 4 */
  686. };
  687. /* kQATagGL_TextureWrapU/V */
  688. enum {
  689. kQAGL_Repeat = 0,
  690. kQAGL_Clamp = 1
  691. };
  692. /* kQATagGL_BlendSrc */
  693. enum {
  694. kQAGL_SourceBlend_XXX = 0
  695. };
  696. /* kQATagGL_BlendDst */
  697. enum {
  698. kQAGL_DestBlend_XXX = 0
  699. };
  700. /* kQATagGL_DrawBuffer (mask of one or more) */
  701. enum {
  702. kQAGL_DrawBuffer_None = 0,
  703. kQAGL_DrawBuffer_FrontLeft = (1 << 0),
  704. kQAGL_DrawBuffer_FrontRight = (1 << 1),
  705. kQAGL_DrawBuffer_BackLeft = (1 << 2),
  706. kQAGL_DrawBuffer_BackRight = (1 << 3),
  707. kQAGL_DrawBuffer_Front = (kQAGL_DrawBuffer_FrontLeft | kQAGL_DrawBuffer_FrontRight),
  708. kQAGL_DrawBuffer_Back = (kQAGL_DrawBuffer_BackLeft | kQAGL_DrawBuffer_BackRight)
  709. };
  710. /* kQATag_FogMode */
  711. enum {
  712. kQAFogMode_None = 0, /* no fog */
  713. kQAFogMode_Alpha = 1, /* fog value is alpha */
  714. kQAFogMode_Linear = 2, /* fog = (end - z) / (end - start) */
  715. kQAFogMode_Exponential = 3, /* fog = exp(-density * z) */
  716. kQAFogMode_ExponentialSquared = 4 /* fog = exp(-density * z * density * z) */
  717. };
  718. /* kQATag_ChannelMask */
  719. enum {
  720. kQAChannelMask_r = (1 << 0),
  721. kQAChannelMask_g = (1 << 1),
  722. kQAChannelMask_b = (1 << 2),
  723. kQAChannelMask_a = (1 << 3)
  724. };
  725. /* kQATag_ZBufferMask */
  726. enum {
  727. kQAZBufferMask_Disable = 0,
  728. kQAZBufferMask_Enable = 1
  729. };
  730. /* kQATag_AlphaTestFunc */
  731. enum {
  732. kQAAlphaTest_None = 0,
  733. kQAAlphaTest_LT = 1,
  734. kQAAlphaTest_EQ = 2,
  735. kQAAlphaTest_LE = 3,
  736. kQAAlphaTest_GT = 4,
  737. kQAAlphaTest_NE = 5,
  738. kQAAlphaTest_GE = 6,
  739. kQAAlphaTest_True = 7
  740. };
  741. /* flags for QAAccess__xxx */
  742. enum {
  743. kQANoCopyNeeded = (1 << 0)
  744. };
  745. /************************************************************************************************
  746. *
  747. * Constants used as function parameters.
  748. *
  749. ***********************************************************************************************/
  750. /*
  751. * TQAVertexMode is a parameter to QADrawVGouraud() and QADrawVTexture() that specifies how
  752. * to interpret and draw the vertex array.
  753. */
  754. enum TQAVertexMode {
  755. kQAVertexMode_Point = 0, /* Draw nVertices points */
  756. kQAVertexMode_Line = 1, /* Draw nVertices/2 line segments */
  757. kQAVertexMode_Polyline = 2, /* Draw nVertices-1 connected line segments */
  758. kQAVertexMode_Tri = 3, /* Draw nVertices/3 triangles */
  759. kQAVertexMode_Strip = 4, /* Draw nVertices-2 triangles as a strip */
  760. kQAVertexMode_Fan = 5, /* Draw nVertices-2 triangles as a fan from v0 */
  761. kQAVertexMode_NumModes = 6
  762. };
  763. typedef enum TQAVertexMode TQAVertexMode;
  764. /*
  765. * TQAGestaltSelector is a parameter to QAEngineGestalt(). It selects which gestalt
  766. * parameter will be copied into 'response'.
  767. */
  768. enum TQAGestaltSelector {
  769. kQAGestalt_OptionalFeatures = 0, /* Mask of one or more kQAOptional_xxx */
  770. kQAGestalt_FastFeatures = 1, /* Mask of one or more kQAFast_xxx */
  771. kQAGestalt_VendorID = 2, /* Vendor ID */
  772. kQAGestalt_EngineID = 3, /* Engine ID */
  773. kQAGestalt_Revision = 4, /* Revision number of this engine */
  774. kQAGestalt_ASCIINameLength = 5, /* strlen (asciiName) */
  775. kQAGestalt_ASCIIName = 6, /* Causes strcpy (response, asciiName) */
  776. kQAGestalt_TextureMemory = 7, /* amount of texture RAM currently available */
  777. kQAGestalt_FastTextureMemory = 8, /* amount of texture RAM currently available */
  778. kQAGestalt_DrawContextPixelTypesAllowed = 9, /* returns all the draw context pixel types supported by the RAVE engine */
  779. kQAGestalt_DrawContextPixelTypesPreferred = 10, /* returns all the draw context pixel types that are preferred by the RAVE engine. */
  780. kQAGestalt_TexturePixelTypesAllowed = 11, /* returns all the texture pixel types that are supported by the RAVE engine */
  781. kQAGestalt_TexturePixelTypesPreferred = 12, /* returns all the texture pixel types that are preferred by the RAVE engine.*/
  782. kQAGestalt_BitmapPixelTypesAllowed = 13, /* returns all the bitmap pixel types that are supported by the RAVE engine. */
  783. kQAGestalt_BitmapPixelTypesPreferred = 14, /* returns all the bitmap pixel types that are preferred by the RAVE engine. */
  784. kQAGestalt_OptionalFeatures2 = 15, /* Mask of one or more kQAOptional2_xxx */
  785. kQAGestalt_MultiTextureMax = 16, /* max number of multi textures supported by this engine */
  786. kQAGestalt_NumSelectors = 17,
  787. kQAGestalt_EngineSpecific_Minimum = 1000 /* all gestalts here and above are for engine specific purposes */
  788. };
  789. typedef enum TQAGestaltSelector TQAGestaltSelector;
  790. /*
  791. * TQAMethodSelector is a parameter to QASetNoticeMethod to select the notice method
  792. */
  793. #if RAVE_OBSOLETE
  794. enum TQAMethodSelector {
  795. kQAMethod_RenderCompletion = 0, /* Called when rendering has completed and buffers swapped */
  796. kQAMethod_DisplayModeChanged = 1, /* Called when a display mode has changed */
  797. kQAMethod_ReloadTextures = 2, /* Called when texture memory has been invalidated */
  798. kQAMethod_BufferInitialize = 3, /* Called when a buffer needs to be initialized */
  799. kQAMethod_BufferComposite = 4, /* Called when rendering is finished and its safe to composite */
  800. kQAMethod_NumSelectors = 5
  801. };
  802. typedef enum TQAMethodSelector TQAMethodSelector;
  803. #else
  804. enum TQAMethodSelector {
  805. kQAMethod_RenderCompletion = 0, /* Called when rendering has completed and buffers swapped */
  806. kQAMethod_DisplayModeChanged = 1, /* Called when a display mode has changed */
  807. kQAMethod_ReloadTextures = 2, /* Called when texture memory has been invalidated */
  808. kQAMethod_ImageBufferInitialize = 3, /* Called when a buffer needs to be initialized */
  809. kQAMethod_ImageBuffer2DComposite = 4, /* Called when rendering is finished and its safe to composite */
  810. kQAMethod_NumSelectors = 5
  811. };
  812. typedef enum TQAMethodSelector TQAMethodSelector;
  813. #endif /* RAVE_OBSOLETE */
  814. /*
  815. * kQATriFlags_xxx are ORed together to generate the 'flags' parameter
  816. * to QADrawTriGouraud() and QADrawTriTexture().
  817. */
  818. enum {
  819. kQATriFlags_None = 0, /* No flags (triangle is front-facing or don't care) */
  820. kQATriFlags_Backfacing = (1 << 0) /* Triangle is back-facing */
  821. };
  822. /*
  823. * kQATexture_xxx are ORed together to generate the 'flags' parameter to QATextureNew().
  824. */
  825. enum {
  826. kQATexture_None = 0, /* No flags */
  827. kQATexture_Lock = (1 << 0), /* Don't swap this texture out */
  828. kQATexture_Mipmap = (1 << 1), /* This texture is mipmapped */
  829. kQATexture_NoCompression = (1 << 2), /* Do not compress this texture */
  830. kQATexture_HighCompression = (1 << 3), /* Compress texture, even if it takes a while */
  831. kQATexture_NonRelocatable = (1 << 4), /* Image buffer in VRAM should be non-relocatable */
  832. kQATexture_NoCopy = (1 << 5), /* Don't copy image to VRAM when creating it */
  833. kQATexture_FlipOrigin = (1 << 6), /* The image(s) is(are) in a bottom-up format. (The image(s) is(are) flipped vertically.) */
  834. kQATexture_PriorityBits = (1 << 31) | (1 << 30) | (1 << 29) | (1 << 28) /* Texture priority: 4 upper bits for 16 levels of priority */
  835. };
  836. /*
  837. * kQABitmap_xxx are ORed together to generate the 'flags' parameter to QABitmapNew().
  838. */
  839. enum {
  840. kQABitmap_None = 0, /* No flags */
  841. kQABitmap_Lock = (1 << 1), /* Don't swap this bitmap out */
  842. kQABitmap_NoCompression = (1 << 2), /* Do not compress this bitmap */
  843. kQABitmap_HighCompression = (1 << 3), /* Compress bitmap, even if it takes a while */
  844. kQABitmap_NonRelocatable = (1 << 4), /* Image buffer in VRAM should be non-relocatable */
  845. kQABitmap_NoCopy = (1 << 5), /* Don't copy image to VRAM when creating it */
  846. kQABitmap_FlipOrigin = (1 << 6), /* The image is in a bottom-up format. (The image is flipped vertically.) */
  847. kQABitmap_PriorityBits = (1 << 31) | (1 << 30) | (1 << 29) | (1 << 28) /* Bitmap priority: 4 upper bits for 16 levels of priority */
  848. };
  849. /*
  850. * kQAContext_xxx are ORed together to generate the 'flags' parameter for QADrawContextNew().
  851. */
  852. enum {
  853. kQAContext_None = 0, /* No flags */
  854. kQAContext_NoZBuffer = (1 << 0), /* No hidden surface removal */
  855. kQAContext_DeepZ = (1 << 1), /* Hidden surface precision >= 24 bits */
  856. kQAContext_DoubleBuffer = (1 << 2), /* Double buffered window */
  857. kQAContext_Cache = (1 << 3), /* This is a cache context */
  858. kQAContext_NoDither = (1 << 4), /* No dithering, straight color banding */
  859. kQAContext_Scale = (1 << 5), /* The draw context is to be scaled. The front buffer is a different size than the back buffer. */
  860. kQAContext_NonRelocatable = (1 << 6), /* The back buffer and the z buffer must not move in memory */
  861. kQAContext_EngineSpecific1 = (1 << 28), /* engine specific flag # 1 */
  862. kQAContext_EngineSpecific2 = (1 << 29), /* engine specific flag # 2 */
  863. kQAContext_EngineSpecific3 = (1 << 30), /* engine specific flag # 3 */
  864. kQAContext_EngineSpecific4 = (1 << 31) /* engine specific flag # 4 */
  865. };
  866. /*
  867. * kQAOptional_xxx are ORed together to generate the kQAGestalt_OptionalFeatures response
  868. * from QAEngineGestalt().
  869. */
  870. enum {
  871. kQAOptional_None = 0, /* No optional features */
  872. kQAOptional_DeepZ = (1 << 0), /* Hidden surface precision >= 24 bits */
  873. kQAOptional_Texture = (1 << 1), /* Texture mapping */
  874. kQAOptional_TextureHQ = (1 << 2), /* High quality texture (tri-linear mip or better) */
  875. kQAOptional_TextureColor = (1 << 3), /* Full color modulation and highlight of textures */
  876. kQAOptional_Blend = (1 << 4), /* Transparency blending of RGB */
  877. kQAOptional_BlendAlpha = (1 << 5), /* Transparency blending includes alpha channel */
  878. kQAOptional_Antialias = (1 << 6), /* Antialiased rendering */
  879. kQAOptional_ZSorted = (1 << 7), /* Z sorted rendering (for transparency, etc.) */
  880. kQAOptional_PerspectiveZ = (1 << 8), /* Hidden surface removal using InvW instead of Z */
  881. kQAOptional_OpenGL = (1 << 9), /* Extended rasterization features for OpenGL(tm) */
  882. kQAOptional_NoClear = (1 << 10), /* This drawing engine doesn't clear before drawing */
  883. kQAOptional_CSG = (1 << 11), /* kQATag_CSGxxx are implemented */
  884. kQAOptional_BoundToDevice = (1 << 12), /* This engine is tightly bound to GDevice */
  885. kQAOptional_CL4 = (1 << 13), /* This engine suports kQAPixel_CL4 */
  886. kQAOptional_CL8 = (1 << 14), /* This engine suports kQAPixel_CL8 */
  887. kQAOptional_BufferComposite = (1 << 15), /* This engine can composite with initial buffer contents */
  888. kQAOptional_NoDither = (1 << 16), /* This engine can draw with no dithering */
  889. kQAOptional_FogAlpha = (1 << 17), /* This engine suports alpha based fog */
  890. kQAOptional_FogDepth = (1 << 18), /* This engine suports depth based fog */
  891. kQAOptional_MultiTextures = (1 << 19), /* This bit set if engine supports texture compositing */
  892. kQAOptional_MipmapBias = (1 << 20), /* This bit is set if the engine supports mipmap selection bias */
  893. kQAOptional_ChannelMask = (1 << 21),
  894. kQAOptional_ZBufferMask = (1 << 22),
  895. kQAOptional_AlphaTest = (1 << 23), /* this engine supports alpha testing */
  896. kQAOptional_AccessTexture = (1 << 24), /* if engine supports access to texture */
  897. kQAOptional_AccessBitmap = (1 << 25), /* if engine supports access to bitmaps */
  898. kQAOptional_AccessDrawBuffer = (1 << 26), /* if engine supports access to draw buffer */
  899. kQAOptional_AccessZBuffer = (1 << 27), /* if engine supports access to zbuffer */
  900. kQAOptional_ClearDrawBuffer = (1 << 28), /* if engine supports QAClearDrawBuffer() */
  901. kQAOptional_ClearZBuffer = (1 << 29), /* if engine supports QAClearZBuffer() */
  902. kQAOptional_OffscreenDrawContexts = (1 << 30) /* if engine supports TQADeviceOffscreen */
  903. };
  904. /*
  905. * kQAOptional2_xxx are ORed together to generate the kQAGestalt_OptionalFeatures2 response
  906. * from QAEngineGestalt().
  907. */
  908. enum {
  909. kQAOptional2_None = 0,
  910. kQAOptional2_TextureDrawContexts = (1 << 1), /* if engine supports QATextureNewFromDrawContext() */
  911. kQAOptional2_BitmapDrawContexts = (1 << 2), /* if engine supports QABitmapNewFromDrawContext() */
  912. kQAOptional2_Busy = (1 << 3), /* if engine supports QABusy() */
  913. kQAOptional2_SwapBuffers = (1 << 4), /* if engine supports QASwapBuffers() */
  914. kQAOptional2_Chromakey = (1 << 5), /* if engine supports chromakeying via kQATag_Chromakey_xxx */
  915. kQAOptional2_NonRelocatable = (1 << 6), /* if engine supports nonrelocatable texture & bitmap image buffers in VRAM */
  916. kQAOptional2_NoCopy = (1 << 7), /* if engine supports ability to not copy texture & bitmap image to VRAM */
  917. kQAOptional2_PriorityBits = (1 << 8), /* if engine supports texture & bitmap priority levels */
  918. kQAOptional2_FlipOrigin = (1 << 9), /* if engine supports textures & bitmaps that are vertically flipped */
  919. kQAOptional2_BitmapScale = (1 << 10), /* if engine supports scaled bitmap drawing */
  920. kQAOptional2_DrawContextScale = (1 << 11), /* if engine supports scaled draw contexts */
  921. kQAOptional2_DrawContextNonRelocatable = (1 << 12) /* if engine supports draw contexts with non relocatable buffers */
  922. };
  923. /*
  924. * kQAFast_xxx are ORed together to generate the kQAGestalt_FastFeatures response
  925. * from QAEngineGestalt().
  926. */
  927. enum {
  928. kQAFast_None = 0, /* No accelerated features */
  929. kQAFast_Line = (1 << 0), /* Line drawing */
  930. kQAFast_Gouraud = (1 << 1), /* Gouraud shaded triangles */
  931. kQAFast_Texture = (1 << 2), /* Texture mapped triangles */
  932. kQAFast_TextureHQ = (1 << 3), /* High quality texture (tri-linear mip or better) */
  933. kQAFast_Blend = (1 << 4), /* Transparency blending */
  934. kQAFast_Antialiasing = (1 << 5), /* Antialiased rendering */
  935. kQAFast_ZSorted = (1 << 6), /* Z sorted rendering of non-opaque objects */
  936. kQAFast_CL4 = (1 << 7), /* This engine accelerates kQAPixel_CL4 */
  937. kQAFast_CL8 = (1 << 8), /* This engine accelerates kQAPixel_CL8 */
  938. kQAFast_FogAlpha = (1 << 9), /* This engine accelerates alpha based fog */
  939. kQAFast_FogDepth = (1 << 10), /* This engine accelerates depth based fog */
  940. kQAFast_MultiTextures = (1 << 11), /* This engine accelerates texture compositing */
  941. kQAFast_BitmapScale = (1 << 12), /* This engine accelerates scaled bitmap drawing */
  942. kQAFast_DrawContextScale = (1 << 13) /* This engine accelerates scaled draw contexts */
  943. };
  944. /************************************************************************************************
  945. *
  946. * Macro definition for easily setting the texture priority bits in the flags field of
  947. * QATextureNew(), and QABitMapNew().
  948. *
  949. * The priority value must be a number between 0 and 15. 0 is top priority, and 15 is lowest
  950. * priority. Note that this is different than OpenGL which uses floats from 0.0 to 1.0 where
  951. * 1.0 is top priority. In RAVE, this system is more like texture ranking, thus 0 is top rank,
  952. * and 15 is the last ranking.
  953. *
  954. * Texture prioritization is mainly used for systems which support AGP memory. This allows the
  955. * hardware driver to determine which textures to put into faster VRAM and which to put into
  956. * slower AGP RAM. If you dont care about texture priority, then you dont need to worry about
  957. * this macro or the priority bits since the default will always be top priority when all 4 bits
  958. * of this flag field are 0's.
  959. *
  960. * To upload a texture with high priority, do the following:
  961. *
  962. * unsigned long flags = kQATexture_Mipmap; // Initialize flags
  963. *
  964. * flags |= QACalculatePriorityBits(0); // Setting top priority (this actually does
  965. * // nothing since the bits are still 0000)
  966. * QATextureNew(myEngine, flags, pixelType, image, &raveTexture);
  967. *
  968. *
  969. * To do a texture with a middle priority of 8, do the following:
  970. *
  971. * unsigned long flags = kQATexture_HighCompression; // Initialize flags
  972. *
  973. * flags |= QACalculatePriorityBits(8); // Setting middle priority
  974. *
  975. * QATextureNew(myEngine, flags, pixelType, image, &raveTexture);
  976. *
  977. ***********************************************************************************************/
  978. #define QACalculatePriorityBits(_priority) (((unsigned long) (_priority)) << 28)
  979. /************************************************************************************************
  980. *
  981. * Macro definitions for the drawing engine methods included in TQADrawContext. These
  982. * macros are the recommended means of accessing the engine's draw methods, e.g:
  983. *
  984. * TQADrawContext *drawContext;
  985. * TQAVTexture vertices[3];
  986. *
  987. * drawContext = QADrawContextNew (rect, gdevice, engine, kQAContext_ZBuffer);
  988. * ...
  989. * QASetInt (drawContext, kQATag_ZFunction, kQAZFunction_LT);
  990. * QADrawTriGouraud (drawContext, &vertices[0], &vertices[1], &vertices[2], kQATriFlags_None);
  991. *
  992. * Note that QARenderStart(), QARenderEnd(), QAFlush() and QASync() have real function
  993. * definitions instead of macros. This is because these functions can afford the extra
  994. * per-call overhead of a function layer (which makes application code a little smaller),
  995. * and to allow a cleaner implementation of handling NULL parameters to QARenderStart().
  996. *
  997. ***********************************************************************************************/
  998. #define QASetFloat(drawContext,tag,newValue) \
  999. (drawContext)->setFloat (drawContext,tag,newValue)
  1000. #define QASetInt(drawContext,tag,newValue) \
  1001. (drawContext)->setInt (drawContext,tag,newValue)
  1002. #define QASetPtr(drawContext,tag,newValue) \
  1003. (drawContext)->setPtr (drawContext,tag,newValue)
  1004. #define QAGetFloat(drawContext,tag) \
  1005. (drawContext)->getFloat (drawContext,tag)
  1006. #define QAGetInt(drawContext,tag) \
  1007. (drawContext)->getInt (drawContext,tag)
  1008. #define QAGetPtr(drawContext,tag) \
  1009. (drawContext)->getPtr (drawContext,tag)
  1010. #define QADrawPoint(drawContext,v) \
  1011. (drawContext)->drawPoint (drawContext,v)
  1012. #define QADrawLine(drawContext,v0,v1) \
  1013. (drawContext)->drawLine (drawContext,v0,v1)
  1014. #define QADrawTriGouraud(drawContext,v0,v1,v2,flags) \
  1015. (drawContext)->drawTriGouraud (drawContext,v0,v1,v2,flags)
  1016. #define QADrawTriTexture(drawContext,v0,v1,v2,flags) \
  1017. (drawContext)->drawTriTexture (drawContext,v0,v1,v2,flags)
  1018. #define QASubmitVerticesGouraud(drawContext,nVertices,vertices) \
  1019. (drawContext)->submitVerticesGouraud(drawContext,nVertices,vertices)
  1020. #define QASubmitVerticesTexture(drawContext,nVertices,vertices) \
  1021. (drawContext)->submitVerticesTexture(drawContext,nVertices,vertices)
  1022. #define QASubmitMultiTextureParams(drawContext,nParams,params) \
  1023. (drawContext)->submitMultiTextureParams(drawContext,nParams,params)
  1024. #define QADrawTriMeshGouraud(drawContext,nTriangle,triangles) \
  1025. (drawContext)->drawTriMeshGouraud (drawContext,nTriangle,triangles)
  1026. #define QADrawTriMeshTexture(drawContext,nTriangle,triangles) \
  1027. (drawContext)->drawTriMeshTexture (drawContext,nTriangle,triangles)
  1028. #define QADrawVGouraud(drawContext,nVertices,vertexMode,vertices,flags) \
  1029. (drawContext)->drawVGouraud (drawContext,nVertices,vertexMode,vertices,flags)
  1030. #define QADrawVTexture(drawContext,nVertices,vertexMode,vertices,flags) \
  1031. (drawContext)->drawVTexture (drawContext,nVertices,vertexMode,vertices,flags)
  1032. #define QADrawBitmap(drawContext,v,bitmap) \
  1033. (drawContext)->drawBitmap (drawContext,v,bitmap)
  1034. #define QARenderStart(drawContext,dirtyRect,initialContext) \
  1035. (drawContext)->renderStart (drawContext,dirtyRect,initialContext)
  1036. #define QARenderEnd(drawContext,modifiedRect) \
  1037. (drawContext)->renderEnd (drawContext,modifiedRect)
  1038. #define QARenderAbort(drawContext) \
  1039. (drawContext)->renderAbort (drawContext)
  1040. #define QAFlush(drawContext) \
  1041. (drawContext)->flush (drawContext)
  1042. #define QASync(drawContext) \
  1043. (drawContext)->sync (drawContext)
  1044. #define QASetNoticeMethod(drawContext, method, completionCallBack, refCon) \
  1045. (drawContext)->setNoticeMethod (drawContext, method, completionCallBack, refCon)
  1046. #define QAGetNoticeMethod(drawContext, method, completionCallBack, refCon) \
  1047. (drawContext)->getNoticeMethod (drawContext, method, completionCallBack, refCon)
  1048. #define QAAccessDrawBuffer(drawContext, pixelBuffer) \
  1049. (drawContext)->accessDrawBuffer(drawContext, pixelBuffer)
  1050. #define QAAccessDrawBufferEnd(drawContext, dirtyRect) \
  1051. (drawContext)->accessDrawBufferEnd(drawContext, dirtyRect)
  1052. #define QAAccessZBuffer(drawContext, zBuffer) \
  1053. (drawContext)->accessZBuffer(drawContext, zBuffer)
  1054. #define QAAccessZBufferEnd(drawContext, dirtyRect) \
  1055. (drawContext)->accessZBufferEnd(drawContext, dirtyRect)
  1056. #define QAClearDrawBuffer(drawContext, rect, initialContext) \
  1057. (drawContext)->clearDrawBuffer(drawContext, rect, initialContext)
  1058. #define QAClearZBuffer(drawContext, rect, initialContext) \
  1059. (drawContext)->clearZBuffer(drawContext, rect, initialContext)
  1060. #define QATextureNewFromDrawContext(drawContext, flags, newTexture) \
  1061. (drawContext)->textureFromContext(drawContext, flags, newTexture)
  1062. #define QABitmapNewFromDrawContext(drawContext, flags, newBitmap) \
  1063. (drawContext)->bitmapFromContext(drawContext, flags, newBitmap)
  1064. #define QABusy(drawContext) \
  1065. (drawContext)->busy(drawContext)
  1066. #define QASwapBuffers(drawContext, dirtyRect) \
  1067. (drawContext)->swapBuffers(drawContext, dirtyRect)
  1068. /********************************************************************
  1069. * TQAVersion sets the TQADrawContext 'version' field. It is set by
  1070. * the manager to indicate the version of the TQADrawContext structure.
  1071. *******************************************************************/
  1072. enum TQAVersion {
  1073. kQAVersion_Prerelease = 0,
  1074. kQAVersion_1_0 = 1,
  1075. kQAVersion_1_0_5 = 2, /* Added tri mesh functions, color tables */
  1076. kQAVersion_1_5 = 3, /* Added call backs, texture compression, and new error return code */
  1077. kQAVersion_1_6 = 4 /* Added QAAccess_xxx, fog, _Options2, Clear_xxx, etc. */
  1078. };
  1079. typedef enum TQAVersion TQAVersion;
  1080. /***********************************************************************
  1081. * TQADrawContext structure holds method pointers.
  1082. * This is a forward refrence. The structure is defined later.
  1083. **********************************************************************/
  1084. typedef struct TQADrawContext TQADrawContext;
  1085. /************************************************************************************************
  1086. *
  1087. * Typedefs of draw method functions provided by the drawing engine. One function pointer
  1088. * for each of these function types in stored in the TQADrawContext public data structure.
  1089. *
  1090. * These functions should be accessed through the QA<function>(context,...) macros,
  1091. * defined above.
  1092. *
  1093. ***********************************************************************************************/
  1094. typedef CALLBACK_API_C( void , TQAStandardNoticeMethod )(const TQADrawContext *drawContext, void *refCon);
  1095. typedef CALLBACK_API_C( void , TQABufferNoticeMethod )(const TQADrawContext *drawContext, const TQADevice *buffer, const TQARect *dirtyRect, void *refCon);
  1096. union TQANoticeMethod {
  1097. TQAStandardNoticeMethod standardNoticeMethod; /* Used for non-buffer related methods */
  1098. TQABufferNoticeMethod bufferNoticeMethod; /* Used for buffer handling methods */
  1099. };
  1100. typedef union TQANoticeMethod TQANoticeMethod;
  1101. typedef CALLBACK_API_C( void , TQASetFloat )(TQADrawContext *drawContext, TQATagFloat tag, float newValue);
  1102. typedef CALLBACK_API_C( void , TQASetInt )(TQADrawContext *drawContext, TQATagInt tag, unsigned long newValue);
  1103. typedef CALLBACK_API_C( void , TQASetPtr )(TQADrawContext *drawContext, TQATagPtr tag, const void *newValue);
  1104. typedef CALLBACK_API_C( float , TQAGetFloat )(const TQADrawContext *drawContext, TQATagFloat tag);
  1105. typedef CALLBACK_API_C( unsigned long , TQAGetInt )(const TQADrawContext *drawContext, TQATagInt tag);
  1106. typedef CALLBACK_API_C( void *, TQAGetPtr )(const TQADrawContext *drawContext, TQATagPtr tag);
  1107. typedef CALLBACK_API_C( void , TQADrawPoint )(const TQADrawContext *drawContext, const TQAVGouraud *v);
  1108. typedef CALLBACK_API_C( void , TQADrawLine )(const TQADrawContext *drawContext, const TQAVGouraud *v0, const TQAVGouraud *v1);
  1109. typedef CALLBACK_API_C( void , TQADrawTriGouraud )(const TQADrawContext *drawContext, const TQAVGouraud *v0, const TQAVGouraud *v1, const TQAVGouraud *v2, unsigned long flags);
  1110. typedef CALLBACK_API_C( void , TQADrawTriTexture )(const TQADrawContext *drawContext, const TQAVTexture *v0, const TQAVTexture *v1, const TQAVTexture *v2, unsigned long flags);
  1111. typedef CALLBACK_API_C( void , TQASubmitVerticesGouraud )(const TQADrawContext *drawContext, unsigned long nVertices, const TQAVGouraud *vertices);
  1112. typedef CALLBACK_API_C( void , TQASubmitVerticesTexture )(const TQADrawContext *drawContext, unsigned long nVertices, const TQAVTexture *vertices);
  1113. typedef CALLBACK_API_C( void , TQADrawTriMeshGouraud )(const TQADrawContext *drawContext, unsigned long nTriangles, const TQAIndexedTriangle *triangles);
  1114. typedef CALLBACK_API_C( void , TQADrawTriMeshTexture )(const TQADrawContext *drawContext, unsigned long nTriangles, const TQAIndexedTriangle *triangles);
  1115. typedef CALLBACK_API_C( void , TQADrawVGouraud )(const TQADrawContext *drawContext, unsigned long nVertices, TQAVertexMode vertexMode, const TQAVGouraud vertices[], const unsigned long flags[]);
  1116. typedef CALLBACK_API_C( void , TQADrawVTexture )(const TQADrawContext *drawContext, unsigned long nVertices, TQAVertexMode vertexMode, const TQAVTexture vertices[], const unsigned long flags[]);
  1117. typedef CALLBACK_API_C( void , TQADrawBitmap )(const TQADrawContext *drawContext, const TQAVGouraud *v, TQABitmap *bitmap);
  1118. typedef CALLBACK_API_C( void , TQARenderStart )(const TQADrawContext *drawContext, const TQARect *dirtyRect, const TQADrawContext *initialContext);
  1119. typedef CALLBACK_API_C( TQAError , TQARenderEnd )(const TQADrawContext *drawContext, const TQARect *modifiedRect);
  1120. typedef CALLBACK_API_C( TQAError , TQARenderAbort )(const TQADrawContext * drawContext);
  1121. typedef CALLBACK_API_C( TQAError , TQAFlush )(const TQADrawContext * drawContext);
  1122. typedef CALLBACK_API_C( TQAError , TQASync )(const TQADrawContext * drawContext);
  1123. typedef CALLBACK_API_C( TQAError , TQASetNoticeMethod )(const TQADrawContext *drawContext, TQAMethodSelector method, TQANoticeMethod completionCallBack, void *refCon);
  1124. typedef CALLBACK_API_C( TQAError , TQAGetNoticeMethod )(const TQADrawContext *drawContext, TQAMethodSelector method, TQANoticeMethod *completionCallBack, void **refCon);
  1125. typedef CALLBACK_API_C( void , TQASubmitMultiTextureParams )(const TQADrawContext *drawContext, unsigned long nParams, const TQAVMultiTexture *params);
  1126. typedef CALLBACK_API_C( TQAError , TQAAccessDrawBuffer )(const TQADrawContext *drawContext, TQAPixelBuffer *buffer);
  1127. typedef CALLBACK_API_C( TQAError , TQAAccessDrawBufferEnd )(const TQADrawContext *drawContext, const TQARect *dirtyRect);
  1128. typedef CALLBACK_API_C( TQAError , TQAAccessZBuffer )(const TQADrawContext *drawContext, TQAZBuffer *buffer);
  1129. typedef CALLBACK_API_C( TQAError , TQAAccessZBufferEnd )(const TQADrawContext *drawContext, const TQARect *dirtyRect);
  1130. typedef CALLBACK_API_C( TQAError , TQAClearDrawBuffer )(const TQADrawContext *drawContext, const TQARect *rect, const TQADrawContext *initialContext);
  1131. typedef CALLBACK_API_C( TQAError , TQAClearZBuffer )(const TQADrawContext *drawContext, const TQARect *rect, const TQADrawContext *initialContext);
  1132. typedef CALLBACK_API_C( TQAError , TQATextureNewFromDrawContext )(const TQADrawContext *drawContext, unsigned long flags, TQATexture **newTexture);
  1133. typedef CALLBACK_API_C( TQAError , TQABitmapNewFromDrawContext )(const TQADrawContext *drawContext, unsigned long flags, TQABitmap **newBitmap);
  1134. typedef CALLBACK_API_C( TQABoolean , TQABusy )(const TQADrawContext * drawContext);
  1135. typedef CALLBACK_API_C( TQAError , TQASwapBuffers )(const TQADrawContext *drawContext, const TQARect *dirtyRect);
  1136. /************************************************************************************************
  1137. *
  1138. * Public TQADrawContext structure. This contains function pointers for the chosen
  1139. * drawing engine.
  1140. *
  1141. ***********************************************************************************************/
  1142. struct TQADrawContext {
  1143. TQADrawPrivate * drawPrivate; /* Engine's private data for this context */
  1144. TQAVersion version; /* Version number */
  1145. TQASetFloat setFloat; /* Method: Set a float state variable */
  1146. TQASetInt setInt; /* Method: Set an unsigned long state variable */
  1147. TQASetPtr setPtr; /* Method: Set an unsigned long state variable */
  1148. TQAGetFloat getFloat; /* Method: Get a float state variable */
  1149. TQAGetInt getInt; /* Method: Get an unsigned long state variable */
  1150. TQAGetPtr getPtr; /* Method: Get an pointer state variable */
  1151. TQADrawPoint drawPoint; /* Method: Draw a point */
  1152. TQADrawLine drawLine; /* Method: Draw a line */
  1153. TQADrawTriGouraud drawTriGouraud; /* Method: Draw a Gouraud shaded triangle */
  1154. TQADrawTriTexture drawTriTexture; /* Method: Draw a texture mapped triangle */
  1155. TQADrawVGouraud drawVGouraud; /* Method: Draw Gouraud vertices */
  1156. TQADrawVTexture drawVTexture; /* Method: Draw texture vertices */
  1157. TQADrawBitmap drawBitmap; /* Method: Draw a bitmap */
  1158. TQARenderStart renderStart; /* Method: Initialize for rendering */
  1159. TQARenderEnd renderEnd; /* Method: Complete rendering and display */
  1160. TQARenderAbort renderAbort; /* Method: Abort any outstanding rendering (blocking) */
  1161. TQAFlush flush; /* Method: Start render of any queued commands (non-blocking) */
  1162. TQASync sync; /* Method: Wait for completion of all rendering (blocking) */
  1163. TQASubmitVerticesGouraud submitVerticesGouraud; /* Method: Submit Gouraud vertices for trimesh */
  1164. TQASubmitVerticesTexture submitVerticesTexture; /* Method: Submit Texture vertices for trimesh */
  1165. TQADrawTriMeshGouraud drawTriMeshGouraud; /* Method: Draw a Gouraud triangle mesh */
  1166. TQADrawTriMeshTexture drawTriMeshTexture; /* Method: Draw a Texture triangle mesh */
  1167. TQASetNoticeMethod setNoticeMethod; /* Method: Set a notice method */
  1168. TQAGetNoticeMethod getNoticeMethod; /* Method: Get a notice method */
  1169. TQASubmitMultiTextureParams submitMultiTextureParams; /* Method: Submit Secondary texture params */
  1170. TQAAccessDrawBuffer accessDrawBuffer;
  1171. TQAAccessDrawBufferEnd accessDrawBufferEnd;
  1172. TQAAccessZBuffer accessZBuffer;
  1173. TQAAccessZBufferEnd accessZBufferEnd;
  1174. TQAClearDrawBuffer clearDrawBuffer;
  1175. TQAClearZBuffer clearZBuffer;
  1176. TQATextureNewFromDrawContext textureFromContext;
  1177. TQABitmapNewFromDrawContext bitmapFromContext;
  1178. TQABusy busy;
  1179. TQASwapBuffers swapBuffers;
  1180. };
  1181. /************************************************************************************************
  1182. *
  1183. * Acceleration manager function prototypes.
  1184. *
  1185. ***********************************************************************************************/
  1186. #if CALL_NOT_IN_CARBON
  1187. /*
  1188. * QADrawContextNew()
  1189. *
  1190. * Availability:
  1191. * Non-Carbon CFM: not available
  1192. * CarbonLib: not available
  1193. * Mac OS X: not available
  1194. */
  1195. EXTERN_API_C( TQAError )
  1196. QADrawContextNew(
  1197. const TQADevice * device,
  1198. const TQARect * rect,
  1199. const TQAClip * clip,
  1200. const TQAEngine * engine,
  1201. unsigned long flags,
  1202. TQADrawContext ** newDrawContext);
  1203. /*
  1204. * QADrawContextDelete()
  1205. *
  1206. * Availability:
  1207. * Non-Carbon CFM: not available
  1208. * CarbonLib: not available
  1209. * Mac OS X: not available
  1210. */
  1211. EXTERN_API_C( void )
  1212. QADrawContextDelete(TQADrawContext * drawContext);
  1213. /*
  1214. * QAColorTableNew()
  1215. *
  1216. * Availability:
  1217. * Non-Carbon CFM: not available
  1218. * CarbonLib: not available
  1219. * Mac OS X: not available
  1220. */
  1221. EXTERN_API_C( TQAError )
  1222. QAColorTableNew(
  1223. const TQAEngine * engine,
  1224. TQAColorTableType tableType,
  1225. void * pixelData,
  1226. long transparentIndexFlag,
  1227. TQAColorTable ** newTable);
  1228. /*
  1229. * QAColorTableDelete()
  1230. *
  1231. * Availability:
  1232. * Non-Carbon CFM: not available
  1233. * CarbonLib: not available
  1234. * Mac OS X: not available
  1235. */
  1236. EXTERN_API_C( void )
  1237. QAColorTableDelete(
  1238. const TQAEngine * engine,
  1239. TQAColorTable * colorTable);
  1240. /*
  1241. * QATextureNew()
  1242. *
  1243. * Availability:
  1244. * Non-Carbon CFM: not available
  1245. * CarbonLib: not available
  1246. * Mac OS X: not available
  1247. */
  1248. EXTERN_API_C( TQAError )
  1249. QATextureNew(
  1250. const TQAEngine * engine,
  1251. unsigned long flags,
  1252. TQAImagePixelType pixelType,
  1253. const TQAImage images[],
  1254. TQATexture ** newTexture);
  1255. /*
  1256. * QATextureDetach()
  1257. *
  1258. * Availability:
  1259. * Non-Carbon CFM: not available
  1260. * CarbonLib: not available
  1261. * Mac OS X: not available
  1262. */
  1263. EXTERN_API_C( TQAError )
  1264. QATextureDetach(
  1265. const TQAEngine * engine,
  1266. TQATexture * texture);
  1267. /*
  1268. * QATextureDelete()
  1269. *
  1270. * Availability:
  1271. * Non-Carbon CFM: not available
  1272. * CarbonLib: not available
  1273. * Mac OS X: not available
  1274. */
  1275. EXTERN_API_C( void )
  1276. QATextureDelete(
  1277. const TQAEngine * engine,
  1278. TQATexture * texture);
  1279. /*
  1280. * QATextureBindColorTable()
  1281. *
  1282. * Availability:
  1283. * Non-Carbon CFM: not available
  1284. * CarbonLib: not available
  1285. * Mac OS X: not available
  1286. */
  1287. EXTERN_API_C( TQAError )
  1288. QATextureBindColorTable(
  1289. const TQAEngine * engine,
  1290. TQATexture * texture,
  1291. TQAColorTable * colorTable);
  1292. /*
  1293. * QABitmapNew()
  1294. *
  1295. * Availability:
  1296. * Non-Carbon CFM: not available
  1297. * CarbonLib: not available
  1298. * Mac OS X: not available
  1299. */
  1300. EXTERN_API_C( TQAError )
  1301. QABitmapNew(
  1302. const TQAEngine * engine,
  1303. unsigned long flags,
  1304. TQAImagePixelType pixelType,
  1305. const TQAImage * image,
  1306. TQABitmap ** newBitmap);
  1307. /*
  1308. * QABitmapDetach()
  1309. *
  1310. * Availability:
  1311. * Non-Carbon CFM: not available
  1312. * CarbonLib: not available
  1313. * Mac OS X: not available
  1314. */
  1315. EXTERN_API_C( TQAError )
  1316. QABitmapDetach(
  1317. const TQAEngine * engine,
  1318. TQABitmap * bitmap);
  1319. /*
  1320. * QABitmapDelete()
  1321. *
  1322. * Availability:
  1323. * Non-Carbon CFM: not available
  1324. * CarbonLib: not available
  1325. * Mac OS X: not available
  1326. */
  1327. EXTERN_API_C( void )
  1328. QABitmapDelete(
  1329. const TQAEngine * engine,
  1330. TQABitmap * bitmap);
  1331. /*
  1332. * QABitmapBindColorTable()
  1333. *
  1334. * Availability:
  1335. * Non-Carbon CFM: not available
  1336. * CarbonLib: not available
  1337. * Mac OS X: not available
  1338. */
  1339. EXTERN_API_C( TQAError )
  1340. QABitmapBindColorTable(
  1341. const TQAEngine * engine,
  1342. TQABitmap * bitmap,
  1343. TQAColorTable * colorTable);
  1344. /*
  1345. * QADeviceGetFirstEngine()
  1346. *
  1347. * Availability:
  1348. * Non-Carbon CFM: not available
  1349. * CarbonLib: not available
  1350. * Mac OS X: not available
  1351. */
  1352. EXTERN_API_C( TQAEngine * )
  1353. QADeviceGetFirstEngine(const TQADevice * device);
  1354. /*
  1355. * QADeviceGetNextEngine()
  1356. *
  1357. * Availability:
  1358. * Non-Carbon CFM: not available
  1359. * CarbonLib: not available
  1360. * Mac OS X: not available
  1361. */
  1362. EXTERN_API_C( TQAEngine * )
  1363. QADeviceGetNextEngine(
  1364. const TQADevice * device,
  1365. const TQAEngine * currentEngine);
  1366. /*
  1367. * QAEngineCheckDevice()
  1368. *
  1369. * Availability:
  1370. * Non-Carbon CFM: not available
  1371. * CarbonLib: not available
  1372. * Mac OS X: not available
  1373. */
  1374. EXTERN_API_C( TQAError )
  1375. QAEngineCheckDevice(
  1376. const TQAEngine * engine,
  1377. const TQADevice * device);
  1378. /*
  1379. * QAEngineGestalt()
  1380. *
  1381. * Availability:
  1382. * Non-Carbon CFM: not available
  1383. * CarbonLib: not available
  1384. * Mac OS X: not available
  1385. */
  1386. EXTERN_API_C( TQAError )
  1387. QAEngineGestalt(
  1388. const TQAEngine * engine,
  1389. TQAGestaltSelector selector,
  1390. void * response);
  1391. /*
  1392. * QAEngineEnable()
  1393. *
  1394. * Availability:
  1395. * Non-Carbon CFM: not available
  1396. * CarbonLib: not available
  1397. * Mac OS X: not available
  1398. */
  1399. EXTERN_API_C( TQAError )
  1400. QAEngineEnable(
  1401. long vendorID,
  1402. long engineID);
  1403. /*
  1404. * QAEngineDisable()
  1405. *
  1406. * Availability:
  1407. * Non-Carbon CFM: not available
  1408. * CarbonLib: not available
  1409. * Mac OS X: not available
  1410. */
  1411. EXTERN_API_C( TQAError )
  1412. QAEngineDisable(
  1413. long vendorID,
  1414. long engineID);
  1415. /*
  1416. * QAAccessTexture()
  1417. *
  1418. * Availability:
  1419. * Non-Carbon CFM: not available
  1420. * CarbonLib: not available
  1421. * Mac OS X: not available
  1422. */
  1423. EXTERN_API_C( TQAError )
  1424. QAAccessTexture(
  1425. const TQAEngine * engine,
  1426. TQATexture * texture,
  1427. long mipmapLevel,
  1428. long flags,
  1429. TQAPixelBuffer * buffer);
  1430. /*
  1431. * QAAccessTextureEnd()
  1432. *
  1433. * Availability:
  1434. * Non-Carbon CFM: not available
  1435. * CarbonLib: not available
  1436. * Mac OS X: not available
  1437. */
  1438. EXTERN_API_C( TQAError )
  1439. QAAccessTextureEnd(
  1440. const TQAEngine * engine,
  1441. TQATexture * texture,
  1442. const TQARect * dirtyRect);
  1443. /*
  1444. * QAAccessBitmap()
  1445. *
  1446. * Availability:
  1447. * Non-Carbon CFM: not available
  1448. * CarbonLib: not available
  1449. * Mac OS X: not available
  1450. */
  1451. EXTERN_API_C( TQAError )
  1452. QAAccessBitmap(
  1453. const TQAEngine * engine,
  1454. TQABitmap * bitmap,
  1455. long flags,
  1456. TQAPixelBuffer * buffer);
  1457. /*
  1458. * QAAccessBitmapEnd()
  1459. *
  1460. * Availability:
  1461. * Non-Carbon CFM: not available
  1462. * CarbonLib: not available
  1463. * Mac OS X: not available
  1464. */
  1465. EXTERN_API_C( TQAError )
  1466. QAAccessBitmapEnd(
  1467. const TQAEngine * engine,
  1468. TQABitmap * bitmap,
  1469. const TQARect * dirtyRect);
  1470. #endif /* CALL_NOT_IN_CARBON */
  1471. #if TARGET_OS_MAC
  1472. #if CALL_NOT_IN_CARBON
  1473. /*
  1474. * QARegisterDrawNotificationProc()
  1475. *
  1476. * Availability:
  1477. * Non-Carbon CFM: not available
  1478. * CarbonLib: not available
  1479. * Mac OS X: not available
  1480. */
  1481. EXTERN_API_C( TQAError )
  1482. QARegisterDrawNotificationProc(
  1483. Rect * globalRect,
  1484. TQADrawNotificationProcPtr proc,
  1485. long refCon,
  1486. TQADrawNotificationProcRefNum * refNum);
  1487. /*
  1488. * QAUnregisterDrawNotificationProc()
  1489. *
  1490. * Availability:
  1491. * Non-Carbon CFM: not available
  1492. * CarbonLib: not available
  1493. * Mac OS X: not available
  1494. */
  1495. EXTERN_API_C( TQAError )
  1496. QAUnregisterDrawNotificationProc(TQADrawNotificationProcRefNum refNum);
  1497. #endif /* CALL_NOT_IN_CARBON */
  1498. #endif /* TARGET_OS_MAC */
  1499. #if PRAGMA_ENUM_ALWAYSINT
  1500. #pragma enumsalwaysint reset
  1501. #ifdef __RAVE__RESTORE_TWOBYTEINTS
  1502. #pragma fourbyteints off
  1503. #endif
  1504. #elif PRAGMA_ENUM_OPTIONS
  1505. #pragma option enum=reset
  1506. #elif defined(__RAVE__RESTORE_PACKED_ENUMS)
  1507. #pragma options(pack_enums)
  1508. #endif
  1509. #if PRAGMA_STRUCT_ALIGN
  1510. #pragma options align=reset
  1511. #elif PRAGMA_STRUCT_PACKPUSH
  1512. #pragma pack(pop)
  1513. #elif PRAGMA_STRUCT_PACK
  1514. #pragma pack()
  1515. #endif
  1516. #ifdef PRAGMA_IMPORT_OFF
  1517. #pragma import off
  1518. #elif PRAGMA_IMPORT
  1519. #pragma import reset
  1520. #endif
  1521. #ifdef __cplusplus
  1522. }
  1523. #endif
  1524. #endif /* __RAVE__ */