1 /*! @header QuesaDrawContext.h
2         Declares the Quesa draw context objects.
3  */
4 /*  NAME:
5         QuesaDrawContext.h
6 
7     DESCRIPTION:
8         Quesa public header.
9 
10     COPYRIGHT:
11         Copyright (c) 1999-2004, Quesa Developers. All rights reserved.
12 
13         For the current release of Quesa, please see:
14 
15             <http://www.quesa.org/>
16 
17         Redistribution and use in source and binary forms, with or without
18         modification, are permitted provided that the following conditions
19         are met:
20 
21             o Redistributions of source code must retain the above copyright
22               notice, this list of conditions and the following disclaimer.
23 
24             o Redistributions in binary form must reproduce the above
25               copyright notice, this list of conditions and the following
26               disclaimer in the documentation and/or other materials provided
27               with the distribution.
28 
29             o Neither the name of Quesa nor the names of its contributors
30               may be used to endorse or promote products derived from this
31               software without specific prior written permission.
32 
33         THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
34         "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
35         LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
36         A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
37         OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
38         SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
39         TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
40         PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
41         LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
42         NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
43         SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44     ___________________________________________________________________________
45 */
46 #ifndef QUESA_DRAWCONTEXT_HDR
47 #define QUESA_DRAWCONTEXT_HDR
48 //=============================================================================
49 //      Include files
50 //-----------------------------------------------------------------------------
51 #include "Quesa.h"
52 
53 // Disable QD3D header
54 #if defined(__QD3DDRAWCONTEXT__)
55 #error
56 #endif
57 
58 #define __QD3DDRAWCONTEXT__
59 
60 
61 
62 
63 
64 //=============================================================================
65 //      Platform specific includes
66 //-----------------------------------------------------------------------------
67 #if QUESA_OS_MACINTOSH
68     #if QUESA_UH_IN_FRAMEWORKS
69         #include <Carbon/Carbon.h>
70     #else
71         #include <MacWindows.h>
72     #endif
73 #endif // QUESA_OS_MACINTOSH
74 
75 #if QUESA_OS_WIN32
76     #include <Windows.h>
77 
78     #if !defined(QD3D_NO_DIRECTDRAW)
79         #include <ddraw.h>
80     #endif
81 
82 #endif // QUESA_OS_WIN32
83 
84 #if QUESA_OS_UNIX
85     #include <X11/Xlib.h>
86     #include <X11/Xutil.h>
87 #endif // QUESA_OS_UNIX
88 
89 
90 
91 
92 
93 //=============================================================================
94 //      C++ preamble
95 //-----------------------------------------------------------------------------
96 #ifdef __cplusplus
97 extern "C" {
98 #endif
99 
100 
101 
102 
103 
104 //=============================================================================
105 //      Constants
106 //-----------------------------------------------------------------------------
107 /*!
108  *	@enum
109  *		Draw context property types
110  *	@discussion
111  *		Property types that may be assigned to a draw context, for instance to
112  *		request special rendering behavior.  Such requests may be ignored by some
113  *		renderers.  If a particular property has not been set, it will be treated
114  *		as having the default value.
115  *
116  *	@constant	kQ3DrawContextPropertyClearDepthBufferFlag	Whether to clear the depth buffer before
117  *															rendering.
118  *															Data type: TQ3Boolean.
119  *															Default: kQ3True
120  *	@constant	kQ3DrawContextPropertyClearDepthBufferValue	Value to fill the depth buffer with if
121  *															it is cleared.
122  *															Data type: TQ3Float64
123  *															Default: 1.0
124  *	@constant	kQ3DrawContextPropertyWritableDepthBuffer	Whether the depth buffer is initially
125  *															writable.  (See glDepthMask)
126  *															Data type: TQ3Boolean
127  *															Default: kQ3True
128  *	@constant	kQ3DrawContextPropertyGLDepthFunc			Initial value for glDepthFunc.
129  *															Data type: TQ3Uns32
130  *															Default: GL_LESS
131  *  @constant	kQ3DrawContextPropertyGLTextureSharing		If true, requests that an OpenGL
132  *															context should share textures with a
133  *															previously-created OpenGL context, if
134  *															possible.
135  *															Data type: TQ3Boolean.
136  *															Default: kQ3True
137  *	@constant	kQ3DrawContextPropertySwapBufferInEndPass	If true, requests that the renderer
138  *															swap buffers in its EndPass method.
139  *															Only relevant to double-buffered contexts.
140  *															Data type: TQ3Boolean.
141  *															Default: kQ3True.
142  */
143 enum {
144 	kQ3DrawContextPropertyClearDepthBufferFlag		= Q3_METHOD_TYPE('c', 'l', 'd', 'b'),
145 	kQ3DrawContextPropertyClearDepthBufferValue		= Q3_METHOD_TYPE('c', 'l', 'd', 'v'),
146 	kQ3DrawContextPropertyWritableDepthBuffer		= Q3_METHOD_TYPE('w', 'r', 'd', 'b'),
147 	kQ3DrawContextPropertyGLDepthFunc				= Q3_METHOD_TYPE('g', 'l', 'd', 'f'),
148 	kQ3DrawContextPropertyGLTextureSharing			= Q3_METHOD_TYPE('g', 'l', 't', 's'),
149 	kQ3DrawContextPropertySwapBufferInEndPass		= Q3_METHOD_TYPE('s', 'b', 'e', 'p'),
150 	kQ3DrawContextPropertyTypeSize32				= 0xFFFFFFFF
151 };
152 
153 /*!
154  *  @enum
155  *      TQ3DrawContextClearImageMethod
156  *  @discussion
157  *      Clear method.
158  *
159  *  @constant kQ3ClearMethodNone        Do not clear the draw context before rendering.
160  *  @constant kQ3ClearMethodWithColor   Clear the draw context to the clear colour before rendering.
161  */
162 typedef enum {
163     kQ3ClearMethodNone                          = 0,
164     kQ3ClearMethodWithColor                     = 1,
165     kQ3ClearMethodSize32                        = 0xFFFFFFFF
166 } TQ3DrawContextClearImageMethod;
167 
168 
169 /*!
170  *  @enum
171  *      TQ3MacDrawContext2DLibrary
172  *  @discussion
173  *      Mac draw context variants. These are legacy constants from QD3D, and for Quesa
174  *      the library field should be set to kQ3Mac2DLibraryNone.
175  *
176  *  @constant kQ3Mac2DLibraryNone          Unspecified method should be used.
177  *  @constant kQ3Mac2DLibraryQuickDraw     Renderers should use QuickDraw in the final stage of rendering.
178  *  @constant kQ3Mac2DLibraryQuickDrawGX   Renderers should use QuickDraw GX in the final stage of rendering.
179  */
180 typedef enum {
181     kQ3Mac2DLibraryNone                         = 0,
182     kQ3Mac2DLibraryQuickDraw                    = 1,
183     kQ3Mac2DLibraryQuickDrawGX                  = 2,
184     kQ3Mac2DLibrarySize32                       = 0xFFFFFFFF
185 } TQ3MacDrawContext2DLibrary;
186 
187 
188 /*!
189  *  @enum
190  *      TQ3DirectDrawObjectSelector
191  *  @discussion
192  *      Windows DirectDraw interface selectors.
193  *
194  *  @constant kQ3DirectDrawObject          A DIRECTDRAW  interface has been supplied.
195  *  @constant kQ3DirectDrawObject2         A DIRECTDRAW2 interface has been supplied.
196  */
197 typedef enum {
198     kQ3DirectDrawObject                         = 1,
199     kQ3DirectDrawObject2                        = 2,
200     kQ3DirectDrawObjectSize32                   = 0xFFFFFFFF
201 } TQ3DirectDrawObjectSelector;
202 
203 
204 /*!
205  *  @enum
206  *      TQ3DirectDrawObjectSelector
207  *  @discussion
208  *      Windows DirectDraw surface selectors.
209  *
210  *  @constant kQ3DirectDrawSurface         A DIRECTDRAWSURFACE  interface has been supplied.
211  *  @constant kQ3DirectDrawSurface2        A DIRECTDRAWSURFACE2 interface has been supplied.
212  */
213 typedef enum {
214     kQ3DirectDrawSurface                        = 1,
215     kQ3DirectDrawSurface2                       = 2,
216     kQ3DirectDrawSurfaceSize32                  = 0xFFFFFFFF
217 } TQ3DirectDrawSurfaceSelector;
218 
219 
220 
221 
222 
223 //=============================================================================
224 //      Types
225 //-----------------------------------------------------------------------------
226 /*!
227  *  @struct
228  *      TQ3DrawContextData
229  *  @discussion
230  *      Describes the common state for a draw context.
231  *
232  *      If paneState is false, the draw context has an implicit pane which fills
233  *      the entire window/destination surface. Under Quesa, querying a draw
234  *      context object with Q3DrawContext_GetPane will return this implicit pane
235  *      if not pane has been assigned (this feature is not available in QD3D).
236  *
237  *      The mask and maskState fields are currently ignored by Quesa's interactive
238  *      renderers.
239  *
240  *  @field clearImageMethod     How the draw context should be cleared on each frame.
241  *  @field clearImageColor      The clear colour to use if clearImageMethod is kQ3ClearMethodWithColor.
242  *  @field pane                 The area within the draw context which will be rendered to.
243  *  @field paneState            Indicates if the pane field is used.
244  *  @field mask                 The clipping mask to be applied for rendering.
245  *  @field maskState            indicates if the clipping mask is used.
246  *  @field doubleBufferState    Indicates if rendering will be double-buffered.
247  */
248 typedef struct TQ3DrawContextData {
249     TQ3DrawContextClearImageMethod              clearImageMethod;
250     TQ3ColorARGB                                clearImageColor;
251     TQ3Area                                     pane;
252     TQ3Boolean                                  paneState;
253     TQ3Bitmap                                   mask;
254     TQ3Boolean                                  maskState;
255     TQ3Boolean                                  doubleBufferState;
256 } TQ3DrawContextData;
257 
258 
259 /*!
260  *  @struct
261  *      TQ3PixmapDrawContextData
262  *  @discussion
263  *      Describes the state for a pixmap draw context.
264  *
265  *  @field drawContextData  The common state for the draw context.
266  *  @field pixmap           The pixmap to render to.
267  */
268 typedef struct TQ3PixmapDrawContextData {
269     TQ3DrawContextData                          drawContextData;
270     TQ3Pixmap                                   pixmap;
271 } TQ3PixmapDrawContextData;
272 
273 
274 
275 
276 
277 //=============================================================================
278 //      Mac OS types
279 //-----------------------------------------------------------------------------
280 #if QUESA_OS_MACINTOSH
281 
282 // QuickDraw GX type
283 #if !defined(__GXTYPES__)
284     typedef struct OpaquegxViewPort             *gxViewPort;
285 #endif
286 
287 
288 /*!
289  *  @struct
290  *      TQ3MacDrawContextData
291  *  @discussion
292  *      Describes the state for a Mac OS draw context.
293  *
294  *      The library and viewPort fields are not supported by Quesa.
295  *
296  *      To render to the screen, either the window or grafPort fields must be
297  *      valid. Rendering to an off-screen buffer (e.g., a GWorld) should be
298  *      achieved by rendering to a suitably constructed Pixmap draw context.
299  *
300  *      If a window is supplied, its port will be obtained internally by Quesa
301  *      and the grafPort field should be NULL. When rendering to a port which
302  *      does not correspond to a valid WindowRef (e.g., a QD port constructed
303  *      from a CoreGraphics context), the window field should be NULL and the
304  *      port to render to supplied in the grafPort field.
305  *
306  *  @field drawContextData  The common state for the draw context.
307  *  @field window           The window to render to.
308  *  @field library          The library to use for rendering. Should be kQ3Mac2DLibraryNone.
309  *  @field viewPort         The QuickDraw GX port to render to. Should be NULL.
310  *  @field grafPort         The QuickDraw port to render to.
311  */
312 typedef struct TQ3MacDrawContextData {
313     TQ3DrawContextData                          drawContextData;
314     CWindowPtr                                  window;
315     TQ3MacDrawContext2DLibrary                  library;
316     gxViewPort                                  viewPort;
317     CGrafPtr                                    grafPort;
318 } TQ3MacDrawContextData;
319 
320 #endif // QUESA_OS_MACINTOSH
321 
322 
323 
324 
325 
326 //=============================================================================
327 //      Windows types
328 //-----------------------------------------------------------------------------
329 #if QUESA_OS_WIN32
330 
331 /*!
332  *  @struct
333  *      TQ3Win32DCDrawContextData
334  *  @discussion
335  *      Describes the state for a Windows HDC draw context.
336  *
337  *  @field drawContextData  The common state for the draw context.
338  *  @field hdc              The HDC to render to.
339  */
340 typedef struct TQ3Win32DCDrawContextData {
341     TQ3DrawContextData                          drawContextData;
342     HDC                                         hdc;
343 } TQ3Win32DCDrawContextData;
344 
345 
346 // Windows DD draw context data
347 #if !defined(QD3D_NO_DIRECTDRAW)
348 
349 /*!
350  *  @struct
351  *      TQ3DDSurfaceDescriptor
352  *  @discussion
353  *      Describes the type of DirectDraw objects to be used for rendering.
354  *
355  *  @field objectSelector          Indicates the type of interface which has been supplied.
356  *  @field lpDirectDraw            A DIRECTDRAW interface object.
357  *  @field lpDirectDraw2           A DIRECTDRAW2 interface object.
358  *  @field lpDirectDrawSurface     A DIRECTDRAWSURFACE interface object.
359  *  @field lpDirectDrawSurface2    A DIRECTDRAWSURFACE2 interface object.
360  */
361 typedef struct TQ3DDSurfaceDescriptor {
362     TQ3DirectDrawObjectSelector                 objectSelector;
363 
364     union {
365         LPDIRECTDRAW                            lpDirectDraw;
366         LPDIRECTDRAW2                           lpDirectDraw2;
367     };
368 
369     union {
370         LPDIRECTDRAWSURFACE                     lpDirectDrawSurface;
371         LPDIRECTDRAWSURFACE2                    lpDirectDrawSurface2;
372     };
373 } TQ3DDSurfaceDescriptor;
374 
375 
376 /*!
377  *  @struct
378  *      TQ3DDSurfaceDrawContextData
379  *  @discussion
380  *      Describes the state for a Windows DirectDraw draw context.
381  *
382  *  @field drawContextData        The common state for the draw context.
383  *  @field ddSurfaceDescriptor    Describes the DirectDraw surface to render to.
384  */
385 typedef struct TQ3DDSurfaceDrawContextData {
386     TQ3DrawContextData                          drawContextData;
387     TQ3DDSurfaceDescriptor                      ddSurfaceDescriptor;
388 } TQ3DDSurfaceDrawContextData;
389 
390 #endif // QD3D_NO_DIRECTDRAW
391 
392 #endif // QUESA_OS_WIN32
393 
394 
395 
396 
397 
398 //=============================================================================
399 //      Unix types
400 //-----------------------------------------------------------------------------
401 #if QUESA_OS_UNIX
402 
403 // X11 buffer object
404 typedef struct OpaqueTQ3XBufferObject           *TQ3XBufferObject;
405 
406 
407 /*!
408  *  @struct
409  *      TQ3XColormapData
410  *  @discussion
411  *      The colormap entry for an X11 draw context.
412  *
413  *      Note - no QD3D documentation could be found for this type. The purpose
414  *      of the fields have been assumed.
415  *
416  *  @field baseEntry        The base entry.
417  *  @field maxRed           The maximum red value.
418  *  @field maxGreen         The maximum green value.
419  *  @field maxBlue          The maximum blue value.
420  *  @field multRed          The red multiplier value.
421  *  @field multGreen        The green multiplier value.
422  *  @field multBlue         The blue multiplier value.
423  */
424 typedef struct TQ3XColormapData {
425     TQ3Int32                                    baseEntry;
426     TQ3Int32                                    maxRed;
427     TQ3Int32                                    maxGreen;
428     TQ3Int32                                    maxBlue;
429     TQ3Int32                                    multRed;
430     TQ3Int32                                    multGreen;
431     TQ3Int32                                    multBlue;
432 } TQ3XColormapData;
433 
434 
435 /*!
436  *  @struct
437  *      TQ3XDrawContextData
438  *  @discussion
439  *      Describes the state for an X11 DirectDraw draw context.
440  *
441  *      Note - no QD3D documentation could be found for this type. The purpose
442  *      of the fields have been assumed.
443  *
444  *  @field drawContextData  The common state for the draw context.
445  *  @field display          The X11 Display.
446  *  @field drawable         The X11 Drawable.
447  *  @field visual           The X11 Visual.
448  *  @field cmap             The X11 color map.
449  *  @field colorMapData     The X11 color map data.
450  */
451 typedef struct TQ3XDrawContextData {
452     TQ3DrawContextData                          contextData;
453     Display                                     *display;
454     Drawable                                    drawable;
455     Visual                                      *visual;
456     Colormap                                    cmap;
457     TQ3XColormapData                            *colorMapData;
458 } TQ3XDrawContextData;
459 
460 #endif // QUESA_OS_UNIX
461 
462 
463 
464 
465 
466 //=============================================================================
467 //      Be OS types
468 //-----------------------------------------------------------------------------
469 #if QUESA_OS_BE
470 
471 /*!
472  *  @struct
473  *      TQ3BeDrawContextData
474  *  @discussion
475  *      Describes the state for a Be draw context.
476  *
477  *  @field drawContextData  The common state for the draw context.
478  *  @field theView          The BView to render to.
479  */
480 typedef struct TQ3BeDrawContextData {
481     TQ3DrawContextData                          drawContextData;
482     BView                                       *theView;
483 } TQ3BeDrawContextData;
484 
485 #endif // QUESA_OS_BE
486 
487 
488 
489 
490 
491 //=============================================================================
492 //      Cocoa types
493 //-----------------------------------------------------------------------------
494 #if QUESA_OS_COCOA
495 
496 /*!
497  *  @struct
498  *      TQ3CocoaDrawContextData
499  *  @discussion
500  *      Describes the state for a Cocoa draw context.
501  *
502  *  @field drawContextData  The common state for the draw context.
503  *  @field nsView           The NSView to render to.
504  */
505 typedef struct TQ3CocoaDrawContextData {
506     TQ3DrawContextData                          drawContextData;
507     void                                        *nsView;
508 } TQ3CocoaDrawContextData;
509 
510 #endif // QUESA_OS_COCOA
511 
512 
513 
514 
515 
516 //=============================================================================
517 //      Function prototypes
518 //-----------------------------------------------------------------------------
519 /*!
520  *  @function
521  *      Q3DrawContext_GetType
522  *  @discussion
523  *      Get the type of a draw context.
524  *
525  *      Returns kQ3ObjectTypeInvalid if the draw context type is unknown.
526  *
527  *  @param drawContext      The draw context to query.
528  *  @result                 The type of the draw context object.
529  */
530 Q3_EXTERN_API_C ( TQ3ObjectType  )
531 Q3DrawContext_GetType (
532     TQ3DrawContextObject          drawContext
533 );
534 
535 
536 
537 /*!
538  *  @function
539  *      Q3DrawContext_SetData
540  *  @discussion
541  *      Set the common state for a draw context.
542  *
543  *  @param context          The draw context to update.
544  *  @param contextData      The new common state for the draw context.
545  *  @result                 Success or failure of the operation.
546  */
547 Q3_EXTERN_API_C ( TQ3Status  )
548 Q3DrawContext_SetData (
549     TQ3DrawContextObject          context,
550     const TQ3DrawContextData      *contextData
551 );
552 
553 
554 
555 /*!
556  *  @function
557  *      Q3DrawContext_GetData
558  *  @discussion
559  *      Get the common state of a draw context.
560  *
561  *  @param context          The draw context to query.
562  *  @param contextData      Receives the common state for the draw context.
563  *  @result                 Success or failure of the operation.
564  */
565 Q3_EXTERN_API_C ( TQ3Status  )
566 Q3DrawContext_GetData (
567     TQ3DrawContextObject          context,
568     TQ3DrawContextData            *contextData
569 );
570 
571 
572 
573 /*!
574  *  @function
575  *      Q3DrawContext_SetClearImageColor
576  *  @discussion
577  *      Set the clear image colour for a draw context.
578  *
579  *  @param context          The draw context to update.
580  *  @param color            The new clear image colour.
581  *  @result                 Success or failure of the operation.
582  */
583 Q3_EXTERN_API_C ( TQ3Status  )
584 Q3DrawContext_SetClearImageColor (
585     TQ3DrawContextObject          context,
586     const TQ3ColorARGB            *color
587 );
588 
589 
590 
591 /*!
592  *  @function
593  *      Q3DrawContext_GetClearImageColor
594  *  @discussion
595  *      Get the clear image colour of a draw context.
596  *
597  *  @param context          The draw context to query.
598  *  @param color            Receives the clear image colour.
599  *  @result                 Success or failure of the operation.
600  */
601 Q3_EXTERN_API_C ( TQ3Status  )
602 Q3DrawContext_GetClearImageColor (
603     TQ3DrawContextObject          context,
604     TQ3ColorARGB                  *color
605 );
606 
607 
608 
609 /*!
610  *  @function
611  *      Q3DrawContext_SetPane
612  *  @discussion
613  *      Set the area within the draw context which is rendered to.
614  *
615  *      Rendering within a draw context is constrained to within the active
616  *      pane. If no pane is active, renderers will draw to the entire
617  *		draw context (e.g., the bounds of the window).
618  *
619  *  @param context          The draw context to update.
620  *  @param pane             The area which rendering will be constrained to.
621  *  @result                 Success or failure of the operation.
622  */
623 Q3_EXTERN_API_C ( TQ3Status  )
624 Q3DrawContext_SetPane (
625     TQ3DrawContextObject          context,
626     const TQ3Area                 *pane
627 );
628 
629 
630 
631 /*!
632  *  @function
633  *      Q3DrawContext_GetPane
634  *  @discussion
635  *      Get the area within the draw context which is rendered to.
636  *
637  *      Rendering within a draw context is constrained to within the active
638  *      pane. If no pane is active, renderers will draw to the entire
639  *		draw context (e.g., the bounds of the window).
640  *
641  *      Note that, unlike QD3D, Quesa will return the size of the entire
642  *      draw context if this routine is called on a draw context which has
643  *      not had an explicit pane set.
644  *
645  *  @param context          The draw context to query.
646  *  @param pane             Receives the dimensions of the rendered area.
647  *  @result                 Success or failure of the operation.
648  */
649 Q3_EXTERN_API_C ( TQ3Status  )
650 Q3DrawContext_GetPane (
651     TQ3DrawContextObject          context,
652     TQ3Area                       *pane
653 );
654 
655 
656 
657 /*!
658  *  @function
659  *      Q3DrawContext_SetPaneState
660  *  @discussion
661  *      Set the pane state for a draw context.
662  *
663  *  @param context          The draw context to update.
664  *  @param state            True or false as the pane is active.
665  *  @result                 Success or failure of the operation.
666  */
667 Q3_EXTERN_API_C ( TQ3Status  )
668 Q3DrawContext_SetPaneState (
669     TQ3DrawContextObject          context,
670     TQ3Boolean                    state
671 );
672 
673 
674 
675 /*!
676  *  @function
677  *      Q3DrawContext_GetPaneState
678  *  @discussion
679  *      Get the pane state of a draw context.
680  *
681  *  @param context          The draw context to query.
682  *  @param state            Receives true or false as the pane is active.
683  *  @result                 Success or failure of the operation.
684  */
685 Q3_EXTERN_API_C ( TQ3Status  )
686 Q3DrawContext_GetPaneState (
687     TQ3DrawContextObject          context,
688     TQ3Boolean                    *state
689 );
690 
691 
692 
693 /*!
694  *  @function
695  *      Q3DrawContext_SetClearImageMethod
696  *  @discussion
697  *      Set the clear image method for a draw context.
698  *
699  *  @param context          The draw context to update.
700  *  @param method           The new clear image method.
701  *  @result                 Success or failure of the operation.
702  */
703 Q3_EXTERN_API_C ( TQ3Status  )
704 Q3DrawContext_SetClearImageMethod (
705     TQ3DrawContextObject          context,
706     TQ3DrawContextClearImageMethod method
707 );
708 
709 
710 
711 /*!
712  *  @function
713  *      Q3DrawContext_GetClearImageMethod
714  *  @discussion
715  *      Get the clear image method of a draw context.
716  *
717  *  @param context          The draw context to query.
718  *  @param method           Receives the clear image method.
719  *  @result                 Success or failure of the operation.
720  */
721 Q3_EXTERN_API_C ( TQ3Status  )
722 Q3DrawContext_GetClearImageMethod (
723     TQ3DrawContextObject            context,
724     TQ3DrawContextClearImageMethod *method
725 );
726 
727 
728 
729 /*!
730  *  @function
731  *      Q3DrawContext_SetMask
732  *  @discussion
733  *      Set the mask for a draw context.
734  *
735  *      The mask field is a bitmap-level clipping mask, which clips the rendered
736  *      output as it is copied to the destination.
737  *
738  *      This feature is not currently supported by Quesa's interactive renderers.
739  *
740  *  @param context          The draw context to update.
741  *  @param mask             The new mask for the draw context.
742  *  @result                 Success or failure of the operation.
743  */
744 Q3_EXTERN_API_C ( TQ3Status  )
745 Q3DrawContext_SetMask (
746     TQ3DrawContextObject          context,
747     const TQ3Bitmap               *mask
748 );
749 
750 
751 
752 /*!
753  *  @function
754  *      Q3DrawContext_GetMask
755  *  @discussion
756  *      Get the mask of a draw context.
757  *
758  *  @param context          The draw context to query.
759  *  @param mask             Receives the current draw context mask.
760  *  @result                 Success or failure of the operation.
761  */
762 Q3_EXTERN_API_C ( TQ3Status  )
763 Q3DrawContext_GetMask (
764     TQ3DrawContextObject          context,
765     TQ3Bitmap                     *mask
766 );
767 
768 
769 
770 /*!
771  *  @function
772  *      Q3DrawContext_SetMaskState
773  *  @discussion
774  *      Set the mask state for a draw context.
775  *
776  *  @param context          The draw context to update.
777  *  @param state            True or false as the mask is active.
778  *  @result                 Success or failure of the operation.
779  */
780 Q3_EXTERN_API_C ( TQ3Status  )
781 Q3DrawContext_SetMaskState (
782     TQ3DrawContextObject          context,
783     TQ3Boolean                    state
784 );
785 
786 
787 
788 /*!
789  *  @function
790  *      Q3DrawContext_GetMaskState
791  *  @discussion
792  *      Get the mask state of a draw context.
793  *
794  *  @param context          The draw context to query.
795  *  @param state            Receives true or false as the mask is active.
796  *  @result                 Success or failure of the operation.
797  */
798 Q3_EXTERN_API_C ( TQ3Status  )
799 Q3DrawContext_GetMaskState (
800     TQ3DrawContextObject          context,
801     TQ3Boolean                    *state
802 );
803 
804 
805 
806 /*!
807  *  @function
808  *      Q3DrawContext_SetDoubleBufferState
809  *  @discussion
810  *      Set the double-buffer state of a draw context.
811  *
812  *      A double-buffered draw context will draw to an off-screen buffer as
813  *      objects are submited, and update the destination window/surface once
814  *      at the end of the frame.
815  *
816  *  @param context          The draw context to update.
817  *  @param state            True or false as the draw context is to be double-buffered.
818  *  @result                 Success or failure of the operation.
819  */
820 Q3_EXTERN_API_C ( TQ3Status  )
821 Q3DrawContext_SetDoubleBufferState (
822     TQ3DrawContextObject          context,
823     TQ3Boolean                    state
824 );
825 
826 
827 
828 /*!
829  *  @function
830  *      Q3DrawContext_GetDoubleBufferState
831  *  @discussion
832  *      Get the double-buffer state of a draw context.
833  *
834  *  @param context          The draw context to query.
835  *  @param state            Receives true or false as the draw context is double-buffered.
836  *  @result                 Success or failure of the operation.
837  */
838 Q3_EXTERN_API_C ( TQ3Status  )
839 Q3DrawContext_GetDoubleBufferState (
840     TQ3DrawContextObject          context,
841     TQ3Boolean                    *state
842 );
843 
844 
845 
846 /*!
847 	@functiongroup	 Pixmap Draw Context
848 */
849 
850 
851 
852 /*!
853  *  @function
854  *      Q3PixmapDrawContext_New
855  *  @discussion
856  *      Create a new Pixmap draw context object.
857  *
858  *  @param contextData      The data for the pixmap draw context object.
859  *  @result                 The new draw context object.
860  */
861 Q3_EXTERN_API_C ( TQ3DrawContextObject  )
862 Q3PixmapDrawContext_New (
863     const TQ3PixmapDrawContextData *contextData
864 );
865 
866 
867 
868 /*!
869  *  @function
870  *      Q3PixmapDrawContext_SetPixmap
871  *  @discussion
872  *      Set the pixmap for a pixmap draw context.
873  *
874  *  @param drawContext      The draw context to update.
875  *  @param pixmap           The new pixmap for the draw context.
876  *  @result                 Success or failure of the operation.
877  */
878 Q3_EXTERN_API_C ( TQ3Status  )
879 Q3PixmapDrawContext_SetPixmap (
880     TQ3DrawContextObject          drawContext,
881     const TQ3Pixmap               *pixmap
882 );
883 
884 
885 
886 /*!
887  *  @function
888  *      Q3PixmapDrawContext_GetPixmap
889  *  @discussion
890  *      Get the pixmap of a pixmap draw context.
891  *
892  *  @param drawContext      The draw context to query.
893  *  @param pixmap           Receives the pixmap of the draw context.
894  *  @result                 Success or failure of the operation.
895  */
896 Q3_EXTERN_API_C ( TQ3Status  )
897 Q3PixmapDrawContext_GetPixmap (
898     TQ3DrawContextObject          drawContext,
899     TQ3Pixmap                     *pixmap
900 );
901 
902 
903 
904 
905 
906 //=============================================================================
907 //      Mac OS function prototypes
908 //-----------------------------------------------------------------------------
909 #if QUESA_OS_MACINTOSH
910 /*!
911 	@functiongroup	 MacOS Draw Context
912 */
913 
914 /*!
915  *  @function
916  *      Q3MacDrawContext_New
917  *  @discussion
918  *      Create a new Mac draw context object.
919  *
920  *  @param drawContextData  The data for the Mac draw context object.
921  *  @result                 The new draw context object.
922  */
923 Q3_EXTERN_API_C ( TQ3DrawContextObject  )
924 Q3MacDrawContext_New (
925     const TQ3MacDrawContextData   *drawContextData
926 );
927 
928 
929 
930 /*!
931  *  @function
932  *      Q3MacDrawContext_SetWindow
933  *  @discussion
934  *      Set the window for a Mac draw context.
935  *
936  *  @param drawContext      The draw context to update.
937  *  @param window           The new window for the draw context.
938  *  @result                 Success or failure of the operation.
939  */
940 Q3_EXTERN_API_C ( TQ3Status  )
941 Q3MacDrawContext_SetWindow (
942     TQ3DrawContextObject          drawContext,
943     CWindowPtr                    window
944 );
945 
946 
947 
948 /*!
949  *  @function
950  *      Q3MacDrawContext_GetWindow
951  *  @discussion
952  *      Get the window of a Mac draw context.
953  *
954  *  @param drawContext      The draw context to query.
955  *  @param window           Receives the window of the draw context.
956  *  @result                 Success or failure of the operation.
957  */
958 Q3_EXTERN_API_C ( TQ3Status  )
959 Q3MacDrawContext_GetWindow (
960     TQ3DrawContextObject          drawContext,
961     CWindowPtr                    *window
962 );
963 
964 
965 
966 /*!
967  *  @function
968  *      Q3MacDrawContext_SetGXViewPort
969  *  @discussion
970  *      Set the QuickDraw GX port for a Mac draw context.
971  *
972  *  @param drawContext      The draw context to update.
973  *  @param viewPort         The new QuickDraw GX port for the draw context.
974  *  @result                 Success or failure of the operation.
975  */
976 Q3_EXTERN_API_C ( TQ3Status  )
977 Q3MacDrawContext_SetGXViewPort (
978     TQ3DrawContextObject          drawContext,
979     gxViewPort                    viewPort
980 );
981 
982 
983 
984 /*!
985  *  @function
986  *      Q3MacDrawContext_GetGXViewPort
987  *  @discussion
988  *      Get the QuickDraw GX port of a Mac draw context.
989  *
990  *  @param drawContext      The draw context to query.
991  *  @param viewPort         Receives the QuickDraw GX port of the draw context.
992  *  @result                 Success or failure of the operation.
993  */
994 Q3_EXTERN_API_C ( TQ3Status  )
995 Q3MacDrawContext_GetGXViewPort (
996     TQ3DrawContextObject          drawContext,
997     gxViewPort                    *viewPort
998 );
999 
1000 
1001 
1002 /*!
1003  *  @function
1004  *      Q3MacDrawContext_SetGrafPort
1005  *  @discussion
1006  *      Set the Mac OS GrafPort for a Mac draw context.
1007  *
1008  *  @param drawContext      The draw context to update.
1009  *  @param grafPort         The new Mac OS GrafPort for the draw context.
1010  *  @result                 Success or failure of the operation.
1011  */
1012 Q3_EXTERN_API_C ( TQ3Status  )
1013 Q3MacDrawContext_SetGrafPort (
1014     TQ3DrawContextObject          drawContext,
1015     CGrafPtr                      grafPort
1016 );
1017 
1018 
1019 
1020 /*!
1021  *  @function
1022  *      Q3MacDrawContext_GetGrafPort
1023  *  @discussion
1024  *      Get the Mac OS GrafPort of a Mac draw context.
1025  *
1026  *  @param drawContext      The draw context to query.
1027  *  @param grafPort         Receives the Mac OS GrafPort of the draw context.
1028  *  @result                 Success or failure of the operation.
1029  */
1030 Q3_EXTERN_API_C ( TQ3Status  )
1031 Q3MacDrawContext_GetGrafPort (
1032     TQ3DrawContextObject          drawContext,
1033     CGrafPtr                      *grafPort
1034 );
1035 
1036 
1037 
1038 /*!
1039  *  @function
1040  *      Q3MacDrawContext_Set2DLibrary
1041  *  @discussion
1042  *      Set the 2D library for a Mac draw context.
1043  *
1044  *  @param drawContext      The draw context to update.
1045  *  @param library          The new 2D library for the draw context.
1046  *  @result                 Success or failure of the operation.
1047  */
1048 Q3_EXTERN_API_C ( TQ3Status  )
1049 Q3MacDrawContext_Set2DLibrary (
1050     TQ3DrawContextObject          drawContext,
1051     TQ3MacDrawContext2DLibrary    library
1052 );
1053 
1054 
1055 
1056 /*!
1057  *  @function
1058  *      Q3MacDrawContext_Get2DLibrary
1059  *  @discussion
1060  *      Get the 2D library of a Mac draw context.
1061  *
1062  *  @param drawContext      The draw context to query.
1063  *  @param library          Receives the 2D library of the draw context.
1064  *  @result                 Success or failure of the operation.
1065  */
1066 Q3_EXTERN_API_C ( TQ3Status  )
1067 Q3MacDrawContext_Get2DLibrary (
1068     TQ3DrawContextObject          drawContext,
1069     TQ3MacDrawContext2DLibrary    *library
1070 );
1071 
1072 #endif // QUESA_OS_MACINTOSH
1073 
1074 
1075 
1076 
1077 
1078 //=============================================================================
1079 //      Unix function prototypes
1080 //-----------------------------------------------------------------------------
1081 #if QUESA_OS_UNIX
1082 /*!
1083 	@functiongroup	 X11 (Unix) Draw Context
1084 */
1085 
1086 /*!
1087  *  @function
1088  *      Q3XBuffers_New
1089  *  @discussion
1090  *      Create a new X11 buffer object.
1091  *
1092  *      Note - no QD3D documentation could be found for this routine. The
1093  *      purpose of the function, and its parameters/result, have been assumed.
1094  *
1095  *  @param dpy              The X11 display.
1096  *  @param numBuffers       The number of buffers to create.
1097  *  @param window           The X11 window.
1098  *  @result                 The new X11 buffer object.
1099  */
1100 Q3_EXTERN_API_C ( TQ3XBufferObject  )
1101 Q3XBuffers_New (
1102     Display                       *dpy,
1103     TQ3Uns32                      numBuffers,
1104     Window                        window
1105 );
1106 
1107 
1108 
1109 /*!
1110  *  @function
1111  *      Q3XBuffers_Swap
1112  *  @discussion
1113  *      Swap the front and back buffers of an X11 buffer object.
1114  *
1115  *      Note - no QD3D documentation could be found for this routine. The
1116  *      purpose of the function, and its parameters/result, have been assumed.
1117  *
1118  *  @param dpy              The X11 display.
1119  *  @param buffers          The X11 buffer object.
1120  */
1121 Q3_EXTERN_API_C ( void  )
1122 Q3XBuffers_Swap (
1123     Display                       *dpy,
1124     TQ3XBufferObject              buffers
1125 );
1126 
1127 
1128 
1129 /*!
1130  *  @function
1131  *      Q3X_GetVisualInfo
1132  *  @discussion
1133  *      Get an X11 visual info.
1134  *
1135  *      Note - no QD3D documentation could be found for this routine. The
1136  *      purpose of the function, and its parameters/result, have been assumed.
1137  *
1138  *  @param dpy              The X11 display.
1139  *  @param screen           The X11 screen.
1140  *  @result                 The X11 visual info.
1141  */
1142 Q3_EXTERN_API_C ( XVisualInfo * )
1143 Q3X_GetVisualInfo (
1144     Display                       *dpy,
1145     Screen                        *screen
1146 );
1147 
1148 
1149 
1150 /*!
1151  *  @function
1152  *      Q3XDrawContext_New
1153  *  @discussion
1154  *      Create a new X11 draw context object.
1155  *
1156  *  @param drawContextData  The data for the X11 draw context object.
1157  *  @result                 The new draw context object.
1158  */
1159 Q3_EXTERN_API_C ( TQ3DrawContextObject  )
1160 Q3XDrawContext_New (
1161     const TQ3XDrawContextData     *drawContextData
1162 );
1163 
1164 
1165 
1166 /*!
1167  *  @function
1168  *      Q3XDrawContext_SetDisplay
1169  *  @discussion
1170  *      Set the Display for an X11 draw context.
1171  *
1172  *  @param drawContext      The draw context to update.
1173  *  @param display          The new Display for the draw context.
1174  *  @result                 Success or failure of the operation.
1175  */
1176 Q3_EXTERN_API_C ( TQ3Status  )
1177 Q3XDrawContext_SetDisplay (
1178     TQ3DrawContextObject          drawContext,
1179     const Display                 *display
1180 );
1181 
1182 
1183 
1184 /*!
1185  *  @function
1186  *      Q3XDrawContext_GetDisplay
1187  *  @discussion
1188  *      Get the Display of an X11 draw context.
1189  *
1190  *  @param drawContext      The draw context to query.
1191  *  @param display          Receives the Display of the draw context.
1192  *  @result                 Success or failure of the operation.
1193  */
1194 Q3_EXTERN_API_C ( TQ3Status  )
1195 Q3XDrawContext_GetDisplay (
1196     TQ3DrawContextObject          drawContext,
1197     Display                       **display
1198 );
1199 
1200 
1201 
1202 /*!
1203  *  @function
1204  *      Q3XDrawContext_SetDrawable
1205  *  @discussion
1206  *      Set the Drawable for an X11 draw context.
1207  *
1208  *  @param drawContext      The draw context to update.
1209  *  @param drawable         The new Drawable for the draw context.
1210  *  @result                 Success or failure of the operation.
1211  */
1212 Q3_EXTERN_API_C ( TQ3Status  )
1213 Q3XDrawContext_SetDrawable (
1214     TQ3DrawContextObject          drawContext,
1215     Drawable                      drawable
1216 );
1217 
1218 
1219 
1220 /*!
1221  *  @function
1222  *      Q3XDrawContext_GetDrawable
1223  *  @discussion
1224  *      Get the Drawable of an X11 draw context.
1225  *
1226  *  @param drawContext      The draw context to query.
1227  *  @param drawable         Receives the Drawable of the draw context.
1228  *  @result                 Success or failure of the operation.
1229  */
1230 Q3_EXTERN_API_C ( TQ3Status  )
1231 Q3XDrawContext_GetDrawable (
1232     TQ3DrawContextObject          drawContext,
1233     Drawable                      *drawable
1234 );
1235 
1236 
1237 
1238 /*!
1239  *  @function
1240  *      Q3XDrawContext_SetVisual
1241  *  @discussion
1242  *      Set the Visual of an X11 draw context.
1243  *
1244  *  @param drawContext      The draw context to update.
1245  *  @param visual           The new Visual for the draw context.
1246  *  @result                 Success or failure of the operation.
1247  */
1248 Q3_EXTERN_API_C ( TQ3Status  )
1249 Q3XDrawContext_SetVisual (
1250     TQ3DrawContextObject          drawContext,
1251     const Visual                  *visual
1252 );
1253 
1254 
1255 
1256 /*!
1257  *  @function
1258  *      Q3XDrawContext_GetVisual
1259  *  @discussion
1260  *      Get the Visual of an X11 draw context.
1261  *
1262  *  @param drawContext      The draw context to query.
1263  *  @param visual           Receives the Visual of the draw context.
1264  *  @result                 Success or failure of the operation.
1265  */
1266 Q3_EXTERN_API_C ( TQ3Status  )
1267 Q3XDrawContext_GetVisual (
1268     TQ3DrawContextObject          drawContext,
1269     Visual                        **visual
1270 );
1271 
1272 
1273 
1274 /*!
1275  *  @function
1276  *      Q3XDrawContext_SetColormap
1277  *  @discussion
1278  *      Set the Colormap of an X11 draw context.
1279  *
1280  *  @param drawContext      The draw context to update.
1281  *  @param colormap         The new Colormap for the draw context.
1282  *  @result                 Success or failure of the operation.
1283  */
1284 Q3_EXTERN_API_C ( TQ3Status  )
1285 Q3XDrawContext_SetColormap (
1286     TQ3DrawContextObject          drawContext,
1287     Colormap                      colormap
1288 );
1289 
1290 
1291 
1292 /*!
1293  *  @function
1294  *      Q3XDrawContext_GetColormap
1295  *  @discussion
1296  *      Get the Colormap of an X11 draw context.
1297  *
1298  *  @param drawContext      The draw context to query.
1299  *  @param colormap         Receives the Colormap of the draw context.
1300  *  @result                 Success or failure of the operation.
1301  */
1302 Q3_EXTERN_API_C ( TQ3Status  )
1303 Q3XDrawContext_GetColormap (
1304     TQ3DrawContextObject          drawContext,
1305     Colormap                      *colormap
1306 );
1307 
1308 
1309 
1310 /*!
1311  *  @function
1312  *      Q3XDrawContext_SetColormapData
1313  *  @discussion
1314  *      Set the Colormap data for an X11 draw context.
1315  *
1316  *  @param drawContext      The draw context to update.
1317  *  @param colormapData     The new Colormap data for the draw context.
1318  *  @result                 Success or failure of the operation.
1319  */
1320 Q3_EXTERN_API_C ( TQ3Status  )
1321 Q3XDrawContext_SetColormapData (
1322     TQ3DrawContextObject          drawContext,
1323     const TQ3XColormapData        *colormapData
1324 );
1325 
1326 
1327 
1328 /*!
1329  *  @function
1330  *      Q3XDrawContext_GetColormapData
1331  *  @discussion
1332  *      Get the Colormap data of an X11 draw context.
1333  *
1334  *  @param drawContext      The draw context to query.
1335  *  @param colormapData     Receives the Colormap data of the draw context.
1336  *  @result                 Success or failure of the operation.
1337  */
1338 Q3_EXTERN_API_C ( TQ3Status  )
1339 Q3XDrawContext_GetColormapData (
1340     TQ3DrawContextObject          drawContext,
1341     TQ3XColormapData              *colormapData
1342 );
1343 
1344 #endif // QUESA_OS_UNIX
1345 
1346 
1347 
1348 
1349 
1350 //=============================================================================
1351 //      Windows function prototypes
1352 //-----------------------------------------------------------------------------
1353 #if QUESA_OS_WIN32
1354 /*!
1355 	@functiongroup	 Windows Draw Context
1356 */
1357 
1358 /*!
1359  *  @function
1360  *      Q3Win32DCDrawContext_New
1361  *  @discussion
1362  *      Create a new Win32 DC draw context object.
1363  *
1364  *  @param drawContextData  The data for the Win32 DC draw context object.
1365  *  @result                 The new draw context object.
1366  */
1367 Q3_EXTERN_API_C ( TQ3DrawContextObject  )
1368 Q3Win32DCDrawContext_New (
1369     const TQ3Win32DCDrawContextData *drawContextData
1370 );
1371 
1372 
1373 
1374 /*!
1375  *  @function
1376  *      Q3Win32DCDrawContext_SetDC
1377  *  @discussion
1378  *      Set the DC for a Win32 DC draw context.
1379  *
1380  *  @param drawContext      The draw context to update.
1381  *  @param newHDC           The new DC for the draw context.
1382  *  @result                 Success or failure of the operation.
1383  */
1384 Q3_EXTERN_API_C ( TQ3Status  )
1385 Q3Win32DCDrawContext_SetDC (
1386     TQ3DrawContextObject          drawContext,
1387     HDC                           newHDC
1388 );
1389 
1390 
1391 
1392 /*!
1393  *  @function
1394  *      Q3Win32DCDrawContext_GetDC
1395  *  @discussion
1396  *      Get the DC for a Win32 DC draw context.
1397  *
1398  *  @param drawContext      The draw context to query.
1399  *  @param curHDC           Receives the DC of the draw context.
1400  *  @result                 Success or failure of the operation.
1401  */
1402 Q3_EXTERN_API_C ( TQ3Status  )
1403 Q3Win32DCDrawContext_GetDC (
1404     TQ3DrawContextObject          drawContext,
1405     HDC                           *curHDC
1406 );
1407 
1408 
1409 #if !defined(QD3D_NO_DIRECTDRAW)
1410 
1411 /*!
1412 	@functiongroup	 Windows DirectDraw Draw Context
1413 */
1414 /*!
1415  *  @function
1416  *      Q3DDSurfaceDrawContext_New
1417  *  @discussion
1418  *      Create a new Win32 DD draw context object.
1419  *
1420  *  @param drawContextData  The data for the draw context.
1421  *  @result                 The new Win32 DD draw context.
1422  */
1423 Q3_EXTERN_API_C ( TQ3DrawContextObject  )
1424 Q3DDSurfaceDrawContext_New (
1425     const TQ3DDSurfaceDrawContextData *drawContextData
1426 );
1427 
1428 
1429 
1430 /*!
1431  *  @function
1432  *      Q3DDSurfaceDrawContext_SetDirectDrawSurface
1433  *  @discussion
1434  *      Set the DD surface for a Win32 DD draw context.
1435  *
1436  *  @param drawContext            The draw context to update.
1437  *  @param ddSurfaceDescriptor    The new DD surface for the draw context.
1438  *  @result                       Success or failure of the operation.
1439  */
1440 Q3_EXTERN_API_C ( TQ3Status  )
1441 Q3DDSurfaceDrawContext_SetDirectDrawSurface (
1442     TQ3DrawContextObject          drawContext,
1443     const TQ3DDSurfaceDescriptor  *ddSurfaceDescriptor
1444 );
1445 
1446 
1447 
1448 /*!
1449  *  @function
1450  *      Q3DDSurfaceDrawContext_GetDirectDrawSurface
1451  *  @discussion
1452  *      Get the DD surface of a Win32 DD draw context.
1453  *
1454  *  @param drawContext            The draw context to query.
1455  *  @param ddSurfaceDescriptor    Receives the DD surface of the draw context.
1456  *  @result                       Success or failure of the operation.
1457  */
1458 Q3_EXTERN_API_C ( TQ3Status  )
1459 Q3DDSurfaceDrawContext_GetDirectDrawSurface (
1460     TQ3DrawContextObject          drawContext,
1461     TQ3DDSurfaceDescriptor        *ddSurfaceDescriptor
1462 );
1463 
1464 #endif // QD3D_NO_DIRECTDRAW
1465 #endif // QUESA_OS_WIN32
1466 
1467 
1468 
1469 
1470 
1471 //=============================================================================
1472 //      Be function prototypes
1473 //-----------------------------------------------------------------------------
1474 #if QUESA_OS_BE
1475 /*!
1476 	@functiongroup	 BeOS Draw Context
1477 */
1478 
1479 /*!
1480  *  @function
1481  *      Q3BeDrawContext_New
1482  *  @discussion
1483  *      Create a new Be draw context object.
1484  *
1485  *      <em>This function is not available in QD3D.</em>
1486  *
1487  *  @param drawContextData  The data for the Be draw context object.
1488  *  @result                 The new draw context object.
1489  */
1490 Q3_EXTERN_API_C ( TQ3DrawContextObject  )
1491 Q3BeDrawContext_New (
1492     const TQ3BeDrawContextData    *drawContextData
1493 );
1494 
1495 
1496 
1497 /*!
1498  *  @function
1499  *      Q3BeDrawContext_SetView
1500  *  @discussion
1501  *      Set the BView for a Be draw context.
1502  *
1503  *      <em>This function is not available in QD3D.</em>
1504  *
1505  *  @param drawContext      The draw context to update.
1506  *  @param theView          The new BView for the draw context.
1507  *  @result                 Success or failure of the operation.
1508  */
1509 Q3_EXTERN_API_C ( TQ3Status  )
1510 Q3BeDrawContext_SetView (
1511     TQ3DrawContextObject          drawContext,
1512     BView                         *theView
1513 );
1514 
1515 
1516 
1517 /*!
1518  *  @function
1519  *      Q3BeDrawContext_GetView
1520  *  @discussion
1521  *      Get the BView for a Be draw context.
1522  *
1523  *      <em>This function is not available in QD3D.</em>
1524  *
1525  *  @param drawContext      The draw context to query.
1526  *  @param theView          Receives the BView of the draw context.
1527  *  @result                 Success or failure of the operation.
1528  */
1529 Q3_EXTERN_API_C ( TQ3Status  )
1530 Q3BeDrawContext_GetView (
1531     TQ3DrawContextObject          drawContext,
1532     BView                         **theView
1533 );
1534 
1535 #endif // QUESA_OS_BE
1536 
1537 
1538 
1539 
1540 
1541 //=============================================================================
1542 //      Cocoa function prototypes
1543 //-----------------------------------------------------------------------------
1544 #if QUESA_OS_COCOA
1545 /*!
1546 	@functiongroup	 Cocoa Draw Context
1547 */
1548 
1549 /*!
1550  *  @function
1551  *      Q3CocoaDrawContext_New
1552  *  @discussion
1553  *      Create a new Cocoa draw context object.
1554  *
1555  *      <em>This function is not available in QD3D.</em>
1556  *
1557  *  @param drawContextData  The data for the Cocoa draw context object.
1558  *  @result                 The new draw context object.
1559  */
1560 Q3_EXTERN_API_C ( TQ3DrawContextObject  )
1561 Q3CocoaDrawContext_New (
1562     const TQ3CocoaDrawContextData *drawContextData
1563 );
1564 
1565 
1566 
1567 /*!
1568  *  @function
1569  *      Q3CocoaDrawContext_SetNSView
1570  *  @discussion
1571  *      Set the NSView for a Cocoa draw context.
1572  *
1573  *      <em>This function is not available in QD3D.</em>
1574  *
1575  *  @param drawContext      The draw context to update.
1576  *  @param nsView           The new NSView for the draw context.
1577  *  @result                 Success or failure of the operation.
1578  */
1579 Q3_EXTERN_API_C ( TQ3Status  )
1580 Q3CocoaDrawContext_SetNSView (
1581     TQ3DrawContextObject          drawContext,
1582     void                          *nsView
1583 );
1584 
1585 
1586 
1587 /*!
1588  *  @function
1589  *      Q3CocoaDrawContext_GetNSView
1590  *  @discussion
1591  *      Get the NSView of a Cocoa draw context.
1592  *
1593  *      <em>This function is not available in QD3D.</em>
1594  *
1595  *  @param drawContext      The draw context to query.
1596  *  @param nsView           Receives the NSView of the draw context.
1597  *  @result                 Success or failure of the operation.
1598  */
1599 Q3_EXTERN_API_C ( TQ3Status  )
1600 Q3CocoaDrawContext_GetNSView (
1601     TQ3DrawContextObject          drawContext,
1602     void                          **nsView
1603 );
1604 
1605 #endif // QUESA_OS_COCOA
1606 
1607 
1608 
1609 // Work around a HeaderDoc bug
1610 /*!
1611 	@functiongroup
1612 */
1613 
1614 
1615 
1616 
1617 //=============================================================================
1618 //      C++ postamble
1619 //-----------------------------------------------------------------------------
1620 #ifdef __cplusplus
1621 }
1622 #endif
1623 
1624 #endif
1625 
1626 
1627