PhDCCreate()

Create and initialize a new draw context

Synopsis:

PhDrawContext_t *PhDCCreate( 
                   int type,
                   long flags,
                   int (*flush)(int Subtype),
                   int (*modify)(PhDrawContext_t *dc,
                                 int acquire,
                                 void *data ) );

Arguments:

type
The type of draw context:
flags
Flags that apply to the context:
flush
The function to be called whenever the current draw buffer needs to be flushed. If not provided, the standard Photon graphic flush function is used.

The Subtype argument is what's passed by PgFFlush().

modify
A function that's called whenever this draw control is to be modified. The modification is restricted by the type of the draw control (e.g. if the type is Ph_DRAW_TO_PRINTER, you can target a different printer but can't target memory with subsequent calls to the modify function).

The arguments are:

Library:

ph

Description:

This function creates a draw context structure and initializes its flush and attach functions. The type argument is recorded in the new draw control and prevents the DC from being used as anything but its current type.


Note: You aren't likely to call this function directly unless you're creating your own type of draw context. The functions that create specific types of contexts (e.g. direct-mode, printer, and memory) call PhDCCreate().

Returns:

A pointer to the newly allocated draw context, or NULL if there isn't enough memory.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PdCreateDirectContext(), PdCreateOffscreenContext(), PhDCSetCurrent(), PhDCGetCurrent(), PhDCRelease(), PmMemCreateMC(), PpCreatePC()