Mac OS 9
RAVESystem.h
Go to the documentation of this file.
1 
19 #ifndef __RAVESYSTEM__
20 #define __RAVESYSTEM__
21 
22 #ifndef __CONDITIONALMACROS__
23 #include <ConditionalMacros.h>
24 #endif
25 
26 #ifndef __RAVE__
27 #include <RAVE.h>
28 #endif
29 
30 #if PRAGMA_ONCE
31 #pragma once
32 #endif
33 
34 #ifdef __cplusplus
35 extern "C"
36 {
37 #endif
38 
39 #if PRAGMA_IMPORT
40 #pragma import on
41 #endif
42 
43 #if PRAGMA_STRUCT_ALIGN
44 #pragma options align = power
45 #elif PRAGMA_STRUCT_PACKPUSH
46 #pragma pack(push, 2)
47 #elif PRAGMA_STRUCT_PACK
48 #pragma pack(2)
49 #endif
50 
51 #if PRAGMA_ENUM_ALWAYSINT
52 #if defined(__fourbyteints__) && !__fourbyteints__
53 #define __RAVESYSTEM__RESTORE_TWOBYTEINTS
54 #pragma fourbyteints on
55 #endif
56 #pragma enumsalwaysint on
57 #elif PRAGMA_ENUM_OPTIONS
58 #pragma option enum =int
59 #elif PRAGMA_ENUM_PACK
60 #if __option(pack_enums)
61 #define __RAVESYSTEM__RESTORE_PACKED_ENUMS
62 #pragma options(!pack_enums)
63 #endif
64 #endif
65 
66  /*************************************************************************************************
67  *
68  * Typedefs of texture/bitmap method functions provided by the drawing engine.
69  *
70  ***********************************************************************************************/
79  typedef CALLBACK_API_C(TQAError, TQAColorTableNew)(TQAColorTableType pixelType,
80  void *pixelData,
81  long transparentIndex,
82  TQAColorTable **newTable);
86  typedef CALLBACK_API_C(void, TQAColorTableDelete)(TQAColorTable *colorTable);
93  typedef CALLBACK_API_C(TQAError, TQATextureNew)(unsigned long flags,
94  TQAImagePixelType pixelType,
95  const TQAImage images[],
96  TQATexture **newTexture);
100  typedef CALLBACK_API_C(TQAError, TQATextureDetach)(TQATexture *texture);
104  typedef CALLBACK_API_C(void, TQATextureDelete)(TQATexture *texture);
110  typedef CALLBACK_API_C(TQAError,
111  TQATextureBindColorTable)(TQATexture *texture,
112  TQAColorTable *colorTable);
119  typedef CALLBACK_API_C(TQAError, TQABitmapNew)(unsigned long flags,
120  TQAImagePixelType pixelType,
121  const TQAImage *image,
122  TQABitmap **newBitmap);
126  typedef CALLBACK_API_C(TQAError, TQABitmapDetach)(TQABitmap *bitmap);
130  typedef CALLBACK_API_C(void, TQABitmapDelete)(TQABitmap *bitmap);
136  typedef CALLBACK_API_C(TQAError,
137  TQABitmapBindColorTable)(TQABitmap *bitmap,
138  TQAColorTable *colorTable);
139  /*************************************************************************************************
140  *
141  * Typedefs of private (system-only) functions provided by the drawing engine.
142  *
143  * The TQADrawPrivateNew function returns a TQADrawPrivate *, which points to
144  *the engine-specific private data created for the context. (TQADrawPrivate is a
145  *dummy type which is then cast to the correct engine-specific datatype by the
146  *engine code.)
147  *
148  * The TQADrawPrivateDelete function deletes the engine-specific private data.
149  *
150  * TQAStorePrivateNew and TQAStorePrivateDelete provide the same function as
151  *QADrawPrivateNew and TQADrawPrivateDelete, but for the texture and bitmap
152  *storage context.
153  *
154  * TQADrawMethodGet and TQAStoreMethodGet are called by the RAVE manager to
155  *retrieve the method pointers for a drawing engine.
156  *
157  * The TQAEngineCheckDevice function returns TRUE if the engine can render to
158  *the indicated GDevice.
159  *
160  ***********************************************************************************************/
168  typedef CALLBACK_API_C(TQAError, TQADrawPrivateNew)(
169  TQADrawContext *newDrawContext, const TQADevice *device,
170  const TQARect *rect, const TQAClip *clip, unsigned long flags);
173  typedef CALLBACK_API_C(void, TQADrawPrivateDelete)(TQADrawPrivate *drawPrivate);
176  typedef CALLBACK_API_C(TQAError, TQAEngineCheckDevice)(const TQADevice *device);
181  typedef CALLBACK_API_C(TQAError, TQAEngineGestalt)(TQAGestaltSelector selector,
182  void *response);
183 
185  typedef CALLBACK_API_C(TQAError, TQAAccessTexture)(TQATexture *texture,
186  long mipmapLevel, long flags,
187  TQAPixelBuffer *buffer);
188  typedef CALLBACK_API_C(TQAError, TQAAccessTextureEnd)(TQATexture *texture,
189  const TQARect *dirtyRect);
190  typedef CALLBACK_API_C(TQAError, TQAAccessBitmap)(TQABitmap *bitmap, long flags,
191  TQAPixelBuffer *buffer);
192  typedef CALLBACK_API_C(TQAError, TQAAccessBitmapEnd)(TQABitmap *bitmap,
193  const TQARect *dirtyRect);
194  /*************************************************************************************************
195  *
196  * The TQAEngineMethod union is used to represent a single engine method (it's a
197  * parameter to QAEngineGetMethod). TQAEngineMethodTag identifies which method
198  *is being requested.
199  *
200  ***********************************************************************************************/
202  {
203  TQADrawPrivateNew drawPrivateNew;
204  TQADrawPrivateDelete
206  TQAEngineCheckDevice
208  TQAEngineGestalt engineGestalt;
209  TQATextureNew
211  TQATextureDetach
213  TQATextureDelete textureDelete;
214  TQABitmapNew bitmapNew;
215  TQABitmapDetach
217  TQABitmapDelete bitmapDelete;
218  TQAColorTableNew colorTableNew;
219  TQAColorTableDelete colorTableDelete;
220  TQATextureBindColorTable
222  TQABitmapBindColorTable
224  TQAAccessTexture accessTexture;
225  TQAAccessTextureEnd accessTextureEnd;
226  TQAAccessBitmap accessBitmap;
227  TQAAccessBitmapEnd accessBitmapEnd;
228  };
229  typedef union TQAEngineMethod TQAEngineMethod;
230  enum TQAEngineMethodTag
231  {
232  kQADrawPrivateNew = 0,
233  kQADrawPrivateDelete = 1,
234  kQAEngineCheckDevice = 2,
235  kQAEngineGestalt = 3,
236  kQATextureNew = 4,
237  kQATextureDetach = 5,
238  kQATextureDelete = 6,
239  kQABitmapNew = 7,
240  kQABitmapDetach = 8,
241  kQABitmapDelete = 9,
242  kQAColorTableNew = 10,
243  kQAColorTableDelete = 11,
244  kQATextureBindColorTable = 12,
245  kQABitmapBindColorTable = 13,
246  kQAAccessTexture = 14,
247  kQAAccessTextureEnd = 15,
248  kQAAccessBitmap = 16,
249  kQAAccessBitmapEnd = 17
250  };
251  typedef enum TQAEngineMethodTag TQAEngineMethodTag;
252 
253  /*************************************************************************************************
254  *
255  * QARegisterEngine() registers a new engine. This is called at boot time by the
256  *drawing engine initialization code to register itself with the system. This
257  *call takes only one parameter, the engine's function that allows the manager
258  *to request the other methods.
259  *
260  ***********************************************************************************************/
264  typedef CALLBACK_API_C(TQAError,
265  TQAEngineGetMethod)(TQAEngineMethodTag methodTag,
269 #if CALL_NOT_IN_CARBON
278  TQAError
279  QARegisterEngine(TQAEngineGetMethod engineGetMethod);
280 
292  TQAError
293  QARegisterEngineWithRefCon(TQAEngineGetMethod engineGetMethod, long refCon);
294 
304  long
306 
307 /*************************************************************************************************
308  *
309  * The TQADrawMethod union is used to represent a single draw context method
310  *(it's a parameter to QARegisterDrawMethod). TQADrawMethodTag identifies which
311  *method is being passed.
312  *
313  ***********************************************************************************************/
314 #endif
317  {
318  TQASetFloat setFloat;
319  TQASetInt setInt;
320  TQASetPtr setPtr;
321  TQAGetFloat getFloat;
322  TQAGetInt getInt;
323  TQAGetPtr getPtr;
324  TQADrawPoint drawPoint;
325  TQADrawLine drawLine;
326  TQADrawTriGouraud
328  TQADrawTriTexture
330  TQADrawVGouraud drawVGouraud;
331  TQADrawVTexture drawVTexture;
332  TQADrawBitmap drawBitmap;
333  TQARenderStart renderStart;
334  TQARenderEnd renderEnd;
335  TQARenderAbort
337  TQAFlush
339  TQASync sync;
340  TQASubmitVerticesGouraud
342  TQASubmitVerticesTexture
344  TQADrawTriMeshGouraud
346  TQADrawTriMeshTexture
348  TQASetNoticeMethod setNoticeMethod;
349  TQAGetNoticeMethod getNoticeMethod;
352  TQASubmitMultiTextureParams
354  TQAAccessDrawBuffer accessDrawBuffer;
355  TQAAccessDrawBufferEnd accessDrawBufferEnd;
356  TQAAccessZBuffer accessZBuffer;
357  TQAAccessZBufferEnd accessZBufferEnd;
358  TQAClearDrawBuffer clearDrawBuffer;
359  TQAClearZBuffer clearZBuffer;
360  TQATextureNewFromDrawContext textureFromContext;
361  TQABitmapNewFromDrawContext bitmapFromContext;
362  TQABusy busy;
363  TQASwapBuffers swapBuffers;
364  };
365  typedef union TQADrawMethod TQADrawMethod;
366  enum TQADrawMethodTag
367  {
368  kQASetFloat = 0,
369  kQASetInt = 1,
370  kQASetPtr = 2,
371  kQAGetFloat = 3,
372  kQAGetInt = 4,
373  kQAGetPtr = 5,
374  kQADrawPoint = 6,
375  kQADrawLine = 7,
376  kQADrawTriGouraud = 8,
377  kQADrawTriTexture = 9,
378  kQADrawVGouraud = 10,
379  kQADrawVTexture = 11,
380  kQADrawBitmap = 12,
381  kQARenderStart = 13,
382  kQARenderEnd = 14,
383  kQARenderAbort = 15,
384  kQAFlush = 16,
385  kQASync = 17,
386  kQASubmitVerticesGouraud = 18,
387  kQASubmitVerticesTexture = 19,
388  kQADrawTriMeshGouraud = 20,
389  kQADrawTriMeshTexture = 21,
390  kQASetNoticeMethod = 22,
391  kQAGetNoticeMethod = 23,
392  kQSubmitMultiTextureParams = 24,
393  kQAccessDrawBuffer = 25,
394  kQAccessDrawBufferEnd = 26,
395  kQAccessZBuffer = 27,
396  kQAccessZBufferEnd = 28,
397  kQClearDrawBuffer = 29,
398  kQClearZBuffer = 30,
399  kQTextureNewFromDrawContext = 31,
400  kQBitmapNewFromDrawContext = 32,
401  kQBusy = 33,
402  kQSwapBuffers = 34
403  };
404  typedef enum TQADrawMethodTag TQADrawMethodTag;
405 
406 /*************************************************************************************************
407  *
408  * System call to register a new method for an engine. This is called during the
409  *engine's draw private new functions (to set the initial value of the draw
410  *methods), and possibly at other times when the engine needs to change a draw
411  *method.
412  *
413  ***********************************************************************************************/
419 #if CALL_NOT_IN_CARBON
428  TQAError
429  QARegisterDrawMethod(TQADrawContext *drawContext, TQADrawMethodTag methodTag,
431 
432 #endif
434 #if PRAGMA_ENUM_ALWAYSINT
435 #pragma enumsalwaysint reset
436 #ifdef __RAVESYSTEM__RESTORE_TWOBYTEINTS
437 #pragma fourbyteints off
438 #endif
439 #elif PRAGMA_ENUM_OPTIONS
440 #pragma option enum =reset
441 #elif defined(__RAVESYSTEM__RESTORE_PACKED_ENUMS)
442 #pragma options(pack_enums)
443 #endif
444 
445 #if PRAGMA_STRUCT_ALIGN
446 #pragma options align = reset
447 #elif PRAGMA_STRUCT_PACKPUSH
448 #pragma pack(pop)
449 #elif PRAGMA_STRUCT_PACK
450 #pragma pack()
451 #endif
452 
453 #ifdef PRAGMA_IMPORT_OFF
454 #pragma import off
455 #elif PRAGMA_IMPORT
456 #pragma import reset
457 #endif
458 
459 #ifdef __cplusplus
460 }
461 #endif
462 
463 #endif
Set up for compiler independent conditionals.
TQAError QARegisterDrawMethod(TQADrawContext *drawContext, TQADrawMethodTag methodTag, TQADrawMethod method)
typedef CALLBACK_API_C(TQAError, TQAColorTableNew)(TQAColorTableType pixelType
long QAGetCurrentEngineRefCon(void)
TQAError QARegisterEngineWithRefCon(TQAEngineGetMethod engineGetMethod, long refCon)
TQAError QARegisterEngine(TQAEngineGetMethod engineGetMethod)
Interface for RAVE (Renderer Acceleration Virtual Engine)
TQAMethodSelector
Definition: RAVE.h:1009
TQAGestaltSelector
Definition: RAVE.h:949
Definition: RAVE.h:320
Definition: RAVE.h:196
Definition: RAVE.h:314
Definition: RAVE.h:1541
Definition: RAVE.h:350
Definition: RAVE.h:219
Definition: RAVESystem.h:317
TQARenderEnd renderEnd
Definition: RAVESystem.h:334
TQADrawLine drawLine
Definition: RAVESystem.h:325
TQAGetNoticeMethod getNoticeMethod
Definition: RAVESystem.h:349
TQADrawTriMeshTexture drawTriMeshTexture
Definition: RAVESystem.h:347
TQADrawPoint drawPoint
Definition: RAVESystem.h:324
TQAAccessDrawBuffer accessDrawBuffer
Definition: RAVESystem.h:354
TQAGetFloat getFloat
Definition: RAVESystem.h:321
TQADrawVGouraud drawVGouraud
Definition: RAVESystem.h:330
TQARenderStart renderStart
Definition: RAVESystem.h:333
TQADrawBitmap drawBitmap
Definition: RAVESystem.h:332
TQASetInt setInt
Definition: RAVESystem.h:319
TQASetPtr setPtr
Definition: RAVESystem.h:320
TQAGetInt getInt
Definition: RAVESystem.h:322
TQASubmitVerticesGouraud submitVerticesGouraud
Definition: RAVESystem.h:341
TQAFlush flush
Definition: RAVESystem.h:338
TQADrawTriTexture drawTriTexture
Definition: RAVESystem.h:329
TQASubmitMultiTextureParams submitMultiTextureParams
Definition: RAVESystem.h:353
TQASubmitVerticesTexture submitVerticesTexture
Definition: RAVESystem.h:343
TQADrawTriMeshGouraud drawTriMeshGouraud
Definition: RAVESystem.h:345
TQASetNoticeMethod setNoticeMethod
Definition: RAVESystem.h:348
TQADrawVTexture drawVTexture
Definition: RAVESystem.h:331
TQASync sync
Definition: RAVESystem.h:339
TQAGetPtr getPtr
Definition: RAVESystem.h:323
TQADrawTriGouraud drawTriGouraud
Definition: RAVESystem.h:327
TQARenderAbort renderAbort
Definition: RAVESystem.h:336
Definition: RAVESystem.h:202
TQABitmapDelete bitmapDelete
Definition: RAVESystem.h:217
TQAColorTableDelete colorTableDelete
Definition: RAVESystem.h:219
TQABitmapBindColorTable bitmapBindColorTable
Definition: RAVESystem.h:223
TQAEngineCheckDevice engineCheckDevice
Definition: RAVESystem.h:207
TQAEngineGestalt engineGestalt
Definition: RAVESystem.h:208
TQAAccessTexture accessTexture
Definition: RAVESystem.h:224
TQABitmapNew bitmapNew
Definition: RAVESystem.h:214
TQATextureBindColorTable textureBindColorTable
Definition: RAVESystem.h:221
TQAColorTableNew colorTableNew
Definition: RAVESystem.h:218
TQATextureNew textureNew
Definition: RAVESystem.h:210
TQATextureDetach textureDetach
Definition: RAVESystem.h:212
TQADrawPrivateDelete drawPrivateDelete
Definition: RAVESystem.h:205
TQABitmapDetach bitmapDetach
Definition: RAVESystem.h:216
TQATextureDelete textureDelete
Definition: RAVESystem.h:213