QuesaDrawContext.h


Discussion

Declares the Quesa draw context objects.

Functions


Q3CocoaDrawContext_GetNSView


( TQ3Status ) Q3CocoaDrawContext_GetNSView (
    TQ3DrawContextObject drawContext,
    void **nsView
);
Discussion

Get the NSView of a Cocoa draw context.

This function is not available in QD3D.

Parameter Descriptions
drawContext
The draw context to query.
nsView
Receives the NSView of the draw context.
function result
Success or failure of the operation.

Q3CocoaDrawContext_New


( TQ3DrawContextObject ) Q3CocoaDrawContext_New (
    const TQ3CocoaDrawContextData *drawContextData
);
Discussion

Create a new Cocoa draw context object.

This function is not available in QD3D.

Parameter Descriptions
drawContextData
The data for the Cocoa draw context object.
function result
The new draw context object.

Q3CocoaDrawContext_SetNSView


( TQ3Status ) Q3CocoaDrawContext_SetNSView (
    TQ3DrawContextObject drawContext,
    void *nsView
);
Discussion

Set the NSView for a Cocoa draw context.

This function is not available in QD3D.

Parameter Descriptions
drawContext
The draw context to update.
nsView
The new NSView for the draw context.
function result
Success or failure of the operation.

Q3DDSurfaceDrawContext_GetDirectDrawSurface


( TQ3Status ) Q3DDSurfaceDrawContext_GetDirectDrawSurface (
    TQ3DrawContextObject drawContext,
    TQ3DDSurfaceDescriptor *ddSurfaceDescriptor
);
Discussion

Get the DD surface of a Win32 DD draw context.

Parameter Descriptions
drawContext
The draw context to query.
ddSurfaceDescriptor
Receives the DD surface of the draw context.
function result
Success or failure of the operation.

Q3DDSurfaceDrawContext_New


( TQ3DrawContextObject ) Q3DDSurfaceDrawContext_New (
    const TQ3DDSurfaceDrawContextData *drawContextData
);
Discussion

Create a new Win32 DD draw context object.

Parameter Descriptions
drawContextData
The data for the draw context.
function result
The new Win32 DD draw context.

Q3DDSurfaceDrawContext_SetDirectDrawSurface


( TQ3Status ) Q3DDSurfaceDrawContext_SetDirectDrawSurface (
    TQ3DrawContextObject drawContext,
    const TQ3DDSurfaceDescriptor *ddSurfaceDescriptor
);
Discussion

Set the DD surface for a Win32 DD draw context.

Parameter Descriptions
drawContext
The draw context to update.
ddSurfaceDescriptor
The new DD surface for the draw context.
function result
Success or failure of the operation.

Q3DrawContext_GetClearImageColor


( TQ3Status ) Q3DrawContext_GetClearImageColor (
    TQ3DrawContextObject context,
    TQ3ColorARGB *color
);
Discussion

Get the clear image colour of a draw context.

Parameter Descriptions
context
The draw context to query.
color
Receives the clear image colour.
function result
Success or failure of the operation.

Q3DrawContext_GetClearImageMethod


( TQ3Status ) Q3DrawContext_GetClearImageMethod (
    TQ3DrawContextObject context,
    TQ3DrawContextClearImageMethod *method
);
Discussion

Get the clear image method of a draw context.

Parameter Descriptions
context
The draw context to query.
method
Receives the clear image method.
function result
Success or failure of the operation.

Q3DrawContext_GetData


( TQ3Status ) Q3DrawContext_GetData (
    TQ3DrawContextObject context,
    TQ3DrawContextData *contextData
);
Discussion

Get the common state of a draw context.

Parameter Descriptions
context
The draw context to query.
contextData
Receives the common state for the draw context.
function result
Success or failure of the operation.

Q3DrawContext_GetDoubleBufferState


( TQ3Status ) Q3DrawContext_GetDoubleBufferState (
    TQ3DrawContextObject context,
    TQ3Boolean *state
);
Discussion

Get the double-buffer state of a draw context.

Parameter Descriptions
context
The draw context to query.
state
Receives true or false as the draw context is double-buffered.
function result
Success or failure of the operation.

Q3DrawContext_GetMask


( TQ3Status ) Q3DrawContext_GetMask (
    TQ3DrawContextObject context,
    TQ3Bitmap *mask
);
Discussion

Get the mask of a draw context.

Parameter Descriptions
context
The draw context to query.
mask
Receives the current draw context mask.
function result
Success or failure of the operation.

Q3DrawContext_GetMaskState


( TQ3Status ) Q3DrawContext_GetMaskState (
    TQ3DrawContextObject context,
    TQ3Boolean *state
);
Discussion

Get the mask state of a draw context.

Parameter Descriptions
context
The draw context to query.
state
Receives true or false as the mask is active.
function result
Success or failure of the operation.

Q3DrawContext_GetPane


( TQ3Status ) Q3DrawContext_GetPane (
    TQ3DrawContextObject context,
    TQ3Area *pane
);
Discussion

Get the area within the draw context which is rendered to.

Rendering within a draw context is constrained to within the active pane. If no pane is active, renderers will draw to the entire draw context (e.g., the bounds of the window).

Note that, unlike QD3D, Quesa will return the size of the entire draw context if this routine is called on a draw context which has not had an explicit pane set.

Parameter Descriptions
context
The draw context to query.
pane
Receives the dimensions of the rendered area.
function result
Success or failure of the operation.

Q3DrawContext_GetPaneState


( TQ3Status ) Q3DrawContext_GetPaneState (
    TQ3DrawContextObject context,
    TQ3Boolean *state
);
Discussion

Get the pane state of a draw context.

Parameter Descriptions
context
The draw context to query.
state
Receives true or false as the pane is active.
function result
Success or failure of the operation.

Q3DrawContext_GetType


( TQ3ObjectType ) Q3DrawContext_GetType (
    TQ3DrawContextObject drawContext
);
Discussion

Get the type of a draw context.

Returns kQ3ObjectTypeInvalid if the draw context type is unknown.

Parameter Descriptions
drawContext
The draw context to query.
function result
The type of the draw context object.

Q3DrawContext_SetClearImageColor


( TQ3Status ) Q3DrawContext_SetClearImageColor (
    TQ3DrawContextObject context,
    const TQ3ColorARGB *color
);
Discussion

Set the clear image colour for a draw context.

Parameter Descriptions
context
The draw context to update.
color
The new clear image colour.
function result
Success or failure of the operation.

Q3DrawContext_SetClearImageMethod


( TQ3Status ) Q3DrawContext_SetClearImageMethod (
    TQ3DrawContextObject context,
    TQ3DrawContextClearImageMethod method
);
Discussion

Set the clear image method for a draw context.

Parameter Descriptions
context
The draw context to update.
method
The new clear image method.
function result
Success or failure of the operation.

Q3DrawContext_SetData


( TQ3Status ) Q3DrawContext_SetData (
    TQ3DrawContextObject context,
    const TQ3DrawContextData *contextData
);
Discussion

Set the common state for a draw context.

Parameter Descriptions
context
The draw context to update.
contextData
The new common state for the draw context.
function result
Success or failure of the operation.

Q3DrawContext_SetDoubleBufferState


( TQ3Status ) Q3DrawContext_SetDoubleBufferState (
    TQ3DrawContextObject context,
    TQ3Boolean state
);
Discussion

Set the double-buffer state of a draw context.

A double-buffered draw context will draw to an off-screen buffer as objects are submited, and update the destination window/surface once at the end of the frame.

Parameter Descriptions
context
The draw context to update.
state
True or false as the draw context is to be double-buffered.
function result
Success or failure of the operation.

Q3DrawContext_SetMask


( TQ3Status ) Q3DrawContext_SetMask (
    TQ3DrawContextObject context,
    const TQ3Bitmap *mask
);
Discussion

Set the mask for a draw context.

The mask field is a bitmap-level clipping mask, which clips the rendered output as it is copied to the destination.

This feature is not currently supported by Quesa's interactive renderers.

Parameter Descriptions
context
The draw context to update.
mask
The new mask for the draw context.
function result
Success or failure of the operation.

Q3DrawContext_SetMaskState


( TQ3Status ) Q3DrawContext_SetMaskState (
    TQ3DrawContextObject context,
    TQ3Boolean state
);
Discussion

Set the mask state for a draw context.

Parameter Descriptions
context
The draw context to update.
state
True or false as the mask is active.
function result
Success or failure of the operation.

Q3DrawContext_SetPane


( TQ3Status ) Q3DrawContext_SetPane (
    TQ3DrawContextObject context,
    const TQ3Area *pane
);
Discussion

Set the area within the draw context which is rendered to.

Rendering within a draw context is constrained to within the active pane. If no pane is active, renderers will draw to the entire draw context (e.g., the bounds of the window).

Parameter Descriptions
context
The draw context to update.
pane
The area which rendering will be constrained to.
function result
Success or failure of the operation.

Q3DrawContext_SetPaneState


( TQ3Status ) Q3DrawContext_SetPaneState (
    TQ3DrawContextObject context,
    TQ3Boolean state
);
Discussion

Set the pane state for a draw context.

Parameter Descriptions
context
The draw context to update.
state
True or false as the pane is active.
function result
Success or failure of the operation.

Q3MacDrawContext_Get2DLibrary


( TQ3Status ) Q3MacDrawContext_Get2DLibrary (
    TQ3DrawContextObject drawContext,
    TQ3MacDrawContext2DLibrary *library
);
Discussion

Get the 2D library of a Mac draw context.

Parameter Descriptions
drawContext
The draw context to query.
library
Receives the 2D library of the draw context.
function result
Success or failure of the operation.

Q3MacDrawContext_GetGXViewPort


( TQ3Status ) Q3MacDrawContext_GetGXViewPort (
    TQ3DrawContextObject drawContext,
    gxViewPort *viewPort
);
Discussion

Get the QuickDraw GX port of a Mac draw context.

Parameter Descriptions
drawContext
The draw context to query.
viewPort
Receives the QuickDraw GX port of the draw context.
function result
Success or failure of the operation.

Q3MacDrawContext_GetGrafPort


( TQ3Status ) Q3MacDrawContext_GetGrafPort (
    TQ3DrawContextObject drawContext,
    CGrafPtr *grafPort
);
Discussion

Get the Mac OS GrafPort of a Mac draw context.

Parameter Descriptions
drawContext
The draw context to query.
grafPort
Receives the Mac OS GrafPort of the draw context.
function result
Success or failure of the operation.

Q3MacDrawContext_GetWindow


( TQ3Status ) Q3MacDrawContext_GetWindow (
    TQ3DrawContextObject drawContext,
    CWindowPtr *window
);
Discussion

Get the window of a Mac draw context.

Parameter Descriptions
drawContext
The draw context to query.
window
Receives the window of the draw context.
function result
Success or failure of the operation.

Q3MacDrawContext_New


( TQ3DrawContextObject ) Q3MacDrawContext_New (
    const TQ3MacDrawContextData *drawContextData
);
Discussion

Create a new Mac draw context object.

Parameter Descriptions
drawContextData
The data for the Mac draw context object.
function result
The new draw context object.

Q3MacDrawContext_Set2DLibrary


( TQ3Status ) Q3MacDrawContext_Set2DLibrary (
    TQ3DrawContextObject drawContext,
    TQ3MacDrawContext2DLibrary library
);
Discussion

Set the 2D library for a Mac draw context.

Parameter Descriptions
drawContext
The draw context to update.
library
The new 2D library for the draw context.
function result
Success or failure of the operation.

Q3MacDrawContext_SetGXViewPort


( TQ3Status ) Q3MacDrawContext_SetGXViewPort (
    TQ3DrawContextObject drawContext,
    gxViewPort viewPort
);
Discussion

Set the QuickDraw GX port for a Mac draw context.

Parameter Descriptions
drawContext
The draw context to update.
viewPort
The new QuickDraw GX port for the draw context.
function result
Success or failure of the operation.

Q3MacDrawContext_SetGrafPort


( TQ3Status ) Q3MacDrawContext_SetGrafPort (
    TQ3DrawContextObject drawContext,
    CGrafPtr grafPort
);
Discussion

Set the Mac OS GrafPort for a Mac draw context.

Parameter Descriptions
drawContext
The draw context to update.
grafPort
The new Mac OS GrafPort for the draw context.
function result
Success or failure of the operation.

Q3MacDrawContext_SetWindow


( TQ3Status ) Q3MacDrawContext_SetWindow (
    TQ3DrawContextObject drawContext,
    CWindowPtr window
);
Discussion

Set the window for a Mac draw context.

Parameter Descriptions
drawContext
The draw context to update.
window
The new window for the draw context.
function result
Success or failure of the operation.

Q3PixmapDrawContext_GetPixmap


( TQ3Status ) Q3PixmapDrawContext_GetPixmap (
    TQ3DrawContextObject drawContext,
    TQ3Pixmap *pixmap
);
Discussion

Get the pixmap of a pixmap draw context.

Parameter Descriptions
drawContext
The draw context to query.
pixmap
Receives the pixmap of the draw context.
function result
Success or failure of the operation.

Q3PixmapDrawContext_New


( TQ3DrawContextObject ) Q3PixmapDrawContext_New (
    const TQ3PixmapDrawContextData *contextData
);
Discussion

Create a new Pixmap draw context object.

Parameter Descriptions
contextData
The data for the pixmap draw context object.
function result
The new draw context object.

Q3PixmapDrawContext_SetPixmap


( TQ3Status ) Q3PixmapDrawContext_SetPixmap (
    TQ3DrawContextObject drawContext,
    const TQ3Pixmap *pixmap
);
Discussion

Set the pixmap for a pixmap draw context.

Parameter Descriptions
drawContext
The draw context to update.
pixmap
The new pixmap for the draw context.
function result
Success or failure of the operation.

Q3Win32DCDrawContext_GetDC


( TQ3Status ) Q3Win32DCDrawContext_GetDC (
    TQ3DrawContextObject drawContext,
    HDC *curHDC
);
Discussion

Get the DC for a Win32 DC draw context.

Parameter Descriptions
drawContext
The draw context to query.
curHDC
Receives the DC of the draw context.
function result
Success or failure of the operation.

Q3Win32DCDrawContext_New


( TQ3DrawContextObject ) Q3Win32DCDrawContext_New (
    const TQ3Win32DCDrawContextData *drawContextData
);
Discussion

Create a new Win32 DC draw context object.

Parameter Descriptions
drawContextData
The data for the Win32 DC draw context object.
function result
The new draw context object.

Q3Win32DCDrawContext_SetDC


( TQ3Status ) Q3Win32DCDrawContext_SetDC (
    TQ3DrawContextObject drawContext,
    HDC newHDC
);
Discussion

Set the DC for a Win32 DC draw context.

Parameter Descriptions
drawContext
The draw context to update.
newHDC
The new DC for the draw context.
function result
Success or failure of the operation.

Q3XBuffers_New


( TQ3XBufferObject ) Q3XBuffers_New (
    Display *dpy,
    TQ3Uns32 numBuffers,
    Window window
);
Discussion

Create a new X11 buffer object.

Note - no QD3D documentation could be found for this routine. The purpose of the function, and its parameters/result, have been assumed.

Parameter Descriptions
dpy
The X11 display.
numBuffers
The number of buffers to create.
window
The X11 window.
function result
The new X11 buffer object.

Q3XBuffers_Swap


( void ) Q3XBuffers_Swap (
    Display *dpy,
    TQ3XBufferObject buffers
);
Discussion

Swap the front and back buffers of an X11 buffer object.

Note - no QD3D documentation could be found for this routine. The purpose of the function, and its parameters/result, have been assumed.

Parameter Descriptions
dpy
The X11 display.
buffers
The X11 buffer object.

Q3XDrawContext_GetColormap


( TQ3Status ) Q3XDrawContext_GetColormap (
    TQ3DrawContextObject drawContext,
    Colormap *colormap
);
Discussion

Get the Colormap of an X11 draw context.

Parameter Descriptions
drawContext
The draw context to query.
colormap
Receives the Colormap of the draw context.
function result
Success or failure of the operation.

Q3XDrawContext_GetColormapData


( TQ3Status ) Q3XDrawContext_GetColormapData (
    TQ3DrawContextObject drawContext,
    TQ3XColormapData *colormapData
);
Discussion

Get the Colormap data of an X11 draw context.

Parameter Descriptions
drawContext
The draw context to query.
colormapData
Receives the Colormap data of the draw context.
function result
Success or failure of the operation.

Q3XDrawContext_GetDisplay


( TQ3Status ) Q3XDrawContext_GetDisplay (
    TQ3DrawContextObject drawContext,
    Display **display
);
Discussion

Get the Display of an X11 draw context.

Parameter Descriptions
drawContext
The draw context to query.
display
Receives the Display of the draw context.
function result
Success or failure of the operation.

Q3XDrawContext_GetDrawable


( TQ3Status ) Q3XDrawContext_GetDrawable (
    TQ3DrawContextObject drawContext,
    Drawable *drawable
);
Discussion

Get the Drawable of an X11 draw context.

Parameter Descriptions
drawContext
The draw context to query.
drawable
Receives the Drawable of the draw context.
function result
Success or failure of the operation.

Q3XDrawContext_GetVisual


( TQ3Status ) Q3XDrawContext_GetVisual (
    TQ3DrawContextObject drawContext,
    Visual **visual
);
Discussion

Get the Visual of an X11 draw context.

Parameter Descriptions
drawContext
The draw context to query.
visual
Receives the Visual of the draw context.
function result
Success or failure of the operation.

Q3XDrawContext_New


( TQ3DrawContextObject ) Q3XDrawContext_New (
    const TQ3XDrawContextData *drawContextData
);
Discussion

Create a new X11 draw context object.

Parameter Descriptions
drawContextData
The data for the X11 draw context object.
function result
The new draw context object.

Q3XDrawContext_SetColormap


( TQ3Status ) Q3XDrawContext_SetColormap (
    TQ3DrawContextObject drawContext,
    Colormap colormap
);
Discussion

Set the Colormap of an X11 draw context.

Parameter Descriptions
drawContext
The draw context to update.
colormap
The new Colormap for the draw context.
function result
Success or failure of the operation.

Q3XDrawContext_SetColormapData


( TQ3Status ) Q3XDrawContext_SetColormapData (
    TQ3DrawContextObject drawContext,
    const TQ3XColormapData *colormapData
);
Discussion

Set the Colormap data for an X11 draw context.

Parameter Descriptions
drawContext
The draw context to update.
colormapData
The new Colormap data for the draw context.
function result
Success or failure of the operation.

Q3XDrawContext_SetDisplay


( TQ3Status ) Q3XDrawContext_SetDisplay (
    TQ3DrawContextObject drawContext,
    const Display *display
);
Discussion

Set the Display for an X11 draw context.

Parameter Descriptions
drawContext
The draw context to update.
display
The new Display for the draw context.
function result
Success or failure of the operation.

Q3XDrawContext_SetDrawable


( TQ3Status ) Q3XDrawContext_SetDrawable (
    TQ3DrawContextObject drawContext,
    Drawable drawable
);
Discussion

Set the Drawable for an X11 draw context.

Parameter Descriptions
drawContext
The draw context to update.
drawable
The new Drawable for the draw context.
function result
Success or failure of the operation.

Q3XDrawContext_SetVisual


( TQ3Status ) Q3XDrawContext_SetVisual (
    TQ3DrawContextObject drawContext,
    const Visual *visual
);
Discussion

Set the Visual of an X11 draw context.

Parameter Descriptions
drawContext
The draw context to update.
visual
The new Visual for the draw context.
function result
Success or failure of the operation.

Q3X_GetVisualInfo


( XVisualInfo * ) Q3X_GetVisualInfo (
    Display *dpy,
    Screen *screen
);
Discussion

Get an X11 visual info.

Note - no QD3D documentation could be found for this routine. The purpose of the function, and its parameters/result, have been assumed.

Parameter Descriptions
dpy
The X11 display.
screen
The X11 screen.
function result
The X11 visual info.

Structs


TQ3AcceleratedOffscreenPropertyData


Data for kQ3DrawContextPropertyAcceleratedOffscreen.
typedef struct TQ3AcceleratedOffscreenPropertyData {
    TQ3Object    masterDrawContext;
    TQ3Boolean    copyFromPixmapAtFrameStart;
    TQ3Boolean    copyToPixmapAtFrameEnd;
} TQ3AcceleratedOffscreenPropertyData;
Discussion

To request that a pixmap draw context be rendered using hardware acceleration, attach this data, with the property type kQ3DrawContextPropertyAcceleratedOffscreen, to the draw context before rendering anything. The masterDrawContext member must be an on-screen context that has been rendered, and must continue to exist while the pixmap context exists. If there are multiple monitors being handled by multiple video cards, the masterDrawContext determines which video card will handle the hardware acceleration for the pixmap context.

Field Descriptions
masterDrawContext
An on-screen draw context, see discussion.
copyFromPixmapAtFrameStart
Whether to copy the pixmap to the rendering context at the beginning of each frame. This could be useful if using a pixmap as a background image.
copyToPixmapAtFrameEnd
Whether to copy the rendered image to the pixmap at the end of the last pass of each frame.

TQ3CocoaDrawContextData


typedef struct TQ3CocoaDrawContextData {
    TQ3DrawContextData                          drawContextData;
    void                                        *nsView;
} TQ3CocoaDrawContextData;
Discussion

Describes the state for a Cocoa draw context.

Field Descriptions
drawContextData
The common state for the draw context.
nsView
The NSView to render to.

TQ3DDSurfaceDescriptor


typedef struct TQ3DDSurfaceDescriptor {
    TQ3DirectDrawObjectSelector                 objectSelector;
    union {
    LPDIRECTDRAW                            lpDirectDraw;
    LPDIRECTDRAW2                           lpDirectDraw2;
    
} ;
Discussion

Describes the type of DirectDraw objects to be used for rendering.

Field Descriptions
objectSelector
Indicates the type of interface which has been supplied.
lpDirectDraw
A DIRECTDRAW interface object.
lpDirectDraw2
A DIRECTDRAW2 interface object.
lpDirectDrawSurface
A DIRECTDRAWSURFACE interface object.
lpDirectDrawSurface2
A DIRECTDRAWSURFACE2 interface object.

TQ3DDSurfaceDrawContextData


typedef struct TQ3DDSurfaceDrawContextData {
    TQ3DrawContextData                          drawContextData;
    TQ3DDSurfaceDescriptor                      ddSurfaceDescriptor;
} TQ3DDSurfaceDrawContextData;
Discussion

Describes the state for a Windows DirectDraw draw context.

Field Descriptions
drawContextData
The common state for the draw context.
ddSurfaceDescriptor
Describes the DirectDraw surface to render to.

TQ3DrawContextData


typedef struct TQ3DrawContextData {
    TQ3DrawContextClearImageMethod              clearImageMethod;
    TQ3ColorARGB                                clearImageColor;
    TQ3Area                                     pane;
    TQ3Boolean                                  paneState;
    TQ3Bitmap                                   mask;
    TQ3Boolean                                  maskState;
    TQ3Boolean                                  doubleBufferState;
} TQ3DrawContextData;
Discussion

Describes the common state for a draw context.

If paneState is false, the draw context has an implicit pane which fills the entire window/destination surface. Under Quesa, querying a draw context object with Q3DrawContext_GetPane will return this implicit pane if not pane has been assigned (this feature is not available in QD3D).

The mask and maskState fields are currently ignored by Quesa's interactive renderers.

Field Descriptions
clearImageMethod
How the draw context should be cleared on each frame.
clearImageColor
The clear colour to use if clearImageMethod is kQ3ClearMethodWithColor.
pane
The area within the draw context which will be rendered to.
paneState
Indicates if the pane field is used.
mask
The clipping mask to be applied for rendering.
maskState
indicates if the clipping mask is used.
doubleBufferState
Indicates if rendering will be double-buffered.

TQ3MacDrawContextData


typedef struct TQ3MacDrawContextData {
    TQ3DrawContextData                          drawContextData;
    CWindowPtr                                  window;
    TQ3MacDrawContext2DLibrary                  library;
    gxViewPort                                  viewPort;
    CGrafPtr                                    grafPort;
} TQ3MacDrawContextData;
Discussion

Describes the state for a Mac OS draw context.

The library and viewPort fields are not supported by Quesa.

To render to the screen, either the window or grafPort fields must be valid. Rendering to an off-screen buffer (e.g., a GWorld) should be achieved by rendering to a suitably constructed Pixmap draw context.

If a window is supplied, its port will be obtained internally by Quesa and the grafPort field should be NULL. When rendering to a port which does not correspond to a valid WindowRef (e.g., a QD port constructed from a CoreGraphics context), the window field should be NULL and the port to render to supplied in the grafPort field.

Field Descriptions
drawContextData
The common state for the draw context.
window
The window to render to.
library
The library to use for rendering. Should be kQ3Mac2DLibraryNone.
viewPort
The QuickDraw GX port to render to. Should be NULL.
grafPort
The QuickDraw port to render to.

TQ3PixmapDrawContextData


typedef struct TQ3PixmapDrawContextData {
    TQ3DrawContextData                          drawContextData;
    TQ3Pixmap                                   pixmap;
} TQ3PixmapDrawContextData;
Discussion

Describes the state for a pixmap draw context.

Field Descriptions
drawContextData
The common state for the draw context.
pixmap
The pixmap to render to.

TQ3Win32DCDrawContextData


typedef struct TQ3Win32DCDrawContextData {
    TQ3DrawContextData                          drawContextData;
    HDC                                         hdc;
} TQ3Win32DCDrawContextData;
Discussion

Describes the state for a Windows HDC draw context.

Field Descriptions
drawContextData
The common state for the draw context.
hdc
The HDC to render to.

TQ3XColormapData


typedef struct TQ3XColormapData {
    TQ3Int32                                    baseEntry;
    TQ3Int32                                    maxRed;
    TQ3Int32                                    maxGreen;
    TQ3Int32                                    maxBlue;
    TQ3Int32                                    multRed;
    TQ3Int32                                    multGreen;
    TQ3Int32                                    multBlue;
} TQ3XColormapData;
Discussion

The colormap entry for an X11 draw context.

Note - no QD3D documentation could be found for this type. The purpose of the fields have been assumed.

Field Descriptions
baseEntry
The base entry.
maxRed
The maximum red value.
maxGreen
The maximum green value.
maxBlue
The maximum blue value.
multRed
The red multiplier value.
multGreen
The green multiplier value.
multBlue
The blue multiplier value.

TQ3XDrawContextData


typedef struct TQ3XDrawContextData {
    TQ3DrawContextData                          contextData;
    Display                                     *display;
    Drawable                                    drawable;
    Visual                                      *visual;
    Colormap                                    cmap;
    TQ3XColormapData                            *colorMapData;
} TQ3XDrawContextData;
Discussion

Describes the state for an X11 DirectDraw draw context.

Note - no QD3D documentation could be found for this type. The purpose of the fields have been assumed.

Field Descriptions
drawContextData
The common state for the draw context.
display
The X11 Display.
drawable
The X11 Drawable.
visual
The X11 Visual.
cmap
The X11 color map.
colorMapData
The X11 color map data.

Enumerations


Draw context property types


enum {
  kQ3DrawContextPropertyClearDepthBufferFlag    = Q3_METHOD_TYPE('c', 'l', 'd', 'b'),
  kQ3DrawContextPropertyClearDepthBufferValue    = Q3_METHOD_TYPE('c', 'l', 'd', 'v'),
  kQ3DrawContextPropertyWritableDepthBuffer    = Q3_METHOD_TYPE('w', 'r', 'd', 'b'),
  kQ3DrawContextPropertyGLDepthFunc        = Q3_METHOD_TYPE('g', 'l', 'd', 'f'),
  kQ3DrawContextPropertyGLTextureSharing      = Q3_METHOD_TYPE('g', 'l', 't', 's'),
  kQ3DrawContextPropertyGLStencilBufferDepth    = Q3_METHOD_TYPE('g', 'l', 's', 'd'),
  kQ3DrawContextPropertySwapBufferInEndPass    = Q3_METHOD_TYPE('s', 'b', 'e', 'p'),
  kQ3DrawContextPropertySyncToRefresh        = Q3_METHOD_TYPE('g', 'l', 's', 'r'),
  kQ3DrawContextPropertySurfaceBehindWindow    = Q3_METHOD_TYPE('s', 'u', 'b', 'w'),
  kQ3DrawContextPropertyGLContextBuildCount    = Q3_METHOD_TYPE('g', 'l', 'b', 'c'),
  kQ3DrawContextPropertyAcceleratedOffscreen    = Q3_OBJECT_TYPE('g', 'l', 'a', 'o'),
  kQ3DrawContextPropertyGLPixelFormat        = Q3_OBJECT_TYPE('g', 'l', 'p', 'f'),
  kQ3DrawContextPropertyTypeSize32        = 0xFFFFFFFF
};
Discussion

Property types that may be assigned to a draw context, for instance to request special rendering behavior. Such requests may be ignored by some renderers. If a particular property has not been set, it will be treated as having the default value.

Constants

kQ3DrawContextPropertyClearDepthBufferFlag
Whether to clear the depth buffer before rendering. Data type: TQ3Boolean. Default: kQ3True
kQ3DrawContextPropertyClearDepthBufferValue
Value to fill the depth buffer with if it is cleared. Data type: TQ3Float64 Default: 1.0
kQ3DrawContextPropertyWritableDepthBuffer
Whether the depth buffer is initially writable. (See glDepthMask) Data type: TQ3Boolean Default: kQ3True
kQ3DrawContextPropertyGLDepthFunc
Initial value for glDepthFunc. Data type: TQ3Uns32 Default: GL_LESS
kQ3DrawContextPropertyGLTextureSharing
If true, requests that an OpenGL context should share textures with a previously-created OpenGL context, if possible. Data type: TQ3Boolean. Default: kQ3True
kQ3DrawContextPropertyGLStencilBufferDepth
Desired bit depth of OpenGL stencil buffer. Data type: TQ3Uns32. Default: 0 (no stencil buffer)
kQ3DrawContextPropertySwapBufferInEndPass
If true, requests that the renderer swap buffers in its EndPass method. Only relevant to double-buffered contexts. Data type: TQ3Boolean. Default: kQ3True.
kQ3DrawContextPropertySyncToRefresh
If true, requests that the renderer synchronize drawing with the screen refresh rate. Data type: TQ3Boolean. Default: kQ3False.
kQ3DrawContextPropertySurfaceBehindWindow
If true, requests that drawing occur on a surface behind the window. Only applies to Mac window contexts. Data type: TQ3Boolean. Default: kQ3False.
kQ3DrawContextPropertyGLContextBuildCount
Unlike most draw context properties, this is set by Quesa itself and read by clients. When used with OpenGL-based renderers, the count is incremented whenever the associated OpenGL context is rebuilt. Data type: TQ3Uns32.
kQ3DrawContextPropertyAcceleratedOffscreen
This property, which may only be used with a pixmap draw context, requests that the context use hardware acceleration if possible. Data type: TQ3AcceleratedOffscreenPropertyData.
kQ3DrawContextPropertyGLPixelFormat
Request a specific OpenGL pixel format. The data type is platform-specific. Mac Carbon: AGLPixelFormat. Windows: int. Mac Cocoa: NSOpenGLPixelFormat*.

TQ3DirectDrawObjectSelector


typedef enum {
    kQ3DirectDrawObject                         = 1,
    kQ3DirectDrawObject2                        = 2,
    kQ3DirectDrawObjectSize32                   = 0xFFFFFFFF
} TQ3DirectDrawObjectSelector;
Discussion

Windows DirectDraw interface selectors.

Constants

kQ3DirectDrawObject
A DIRECTDRAW interface has been supplied.
kQ3DirectDrawObject2
A DIRECTDRAW2 interface has been supplied.

TQ3DirectDrawObjectSelector


typedef enum {
    kQ3DirectDrawSurface                        = 1,
    kQ3DirectDrawSurface2                       = 2,
    kQ3DirectDrawSurfaceSize32                  = 0xFFFFFFFF
} TQ3DirectDrawSurfaceSelector;
Discussion

Windows DirectDraw surface selectors.

Constants

kQ3DirectDrawSurface
A DIRECTDRAWSURFACE interface has been supplied.
kQ3DirectDrawSurface2
A DIRECTDRAWSURFACE2 interface has been supplied.

TQ3DrawContextClearImageMethod


typedef enum {
    kQ3ClearMethodNone                          = 0,
    kQ3ClearMethodWithColor                     = 1,
    kQ3ClearMethodSize32                        = 0xFFFFFFFF
} TQ3DrawContextClearImageMethod;
Discussion

Clear method.

Constants

kQ3ClearMethodNone
Do not clear the draw context before rendering.
kQ3ClearMethodWithColor
Clear the draw context to the clear colour before rendering.

TQ3MacDrawContext2DLibrary


typedef enum {
    kQ3Mac2DLibraryNone                         = 0,
    kQ3Mac2DLibraryQuickDraw                    = 1,
    kQ3Mac2DLibraryQuickDrawGX                  = 2,
    kQ3Mac2DLibrarySize32                       = 0xFFFFFFFF
} TQ3MacDrawContext2DLibrary;
Discussion

Mac draw context variants. These are legacy constants from QD3D, and for Quesa the library field should be set to kQ3Mac2DLibraryNone.

Constants

kQ3Mac2DLibraryNone
Unspecified method should be used.
kQ3Mac2DLibraryQuickDraw
Renderers should use QuickDraw in the final stage of rendering.
kQ3Mac2DLibraryQuickDrawGX
Renderers should use QuickDraw GX in the final stage of rendering.

© 1999-2008 Quesa Developers (Last Updated 5/10/2008)