This function creates and initializes a new instance of D-Type Direct Color Rasterizer. The dcRasterizerIni function must be called before any other D-Type Direct Color Rasterizer function can be used.
If the initialization was successful, applications can subsequently call D-Type Direct Color Rasterizer's scene construction functions (dcRasterizerMoveTo, dcRasterizerMoveToFrac, dcRasterizerLineTo, dcRasterizerLineToFrac, dcRasterizerBSplineTo, dcRasterizerBSplineToFrac, dcRasterizerBezierTo, dcRasterizerBezierToFrac, dcRasterizerMultiSegment, dcRasterizerMultiSegmentFrac) to add output to the current scene. Once the entire scene has been constructed, applications can render it by calling dcRasterizerDoOutput.
Parameter | Description |
---|---|
dcr |
Pointer to the handle of the newly created D-Type Direct Color Rasterizer instance. |
memory_surface |
A valid pointer to the DT_MDC structure that describes the memory surface to which the scene will be rendered. |
raster_intersect |
Initial value for maximum number of intersections in a single scan line. Set to 0 to use the default value. |
raster_id |
Version of D-Type Direct Color Rasterizer to initialize:
|
If the initialization was successful, the return value is 1 and dcr holds a handle of the newly created D-Type Direct Color Rasterizer instance. Otherwise, the function returns 0 and dcr holds DV_NULL.
An application can create multiple instances of D-Type Direct Color Rasterizer by calling the dcRasterizerIni function more than once. Each instance is created dynamically and must be destroyed by calling the dcRasterizerExt function before the application terminates. In multi-threaded applications, each thread could initialize its own D-Type Direct Color Rasterizer instance. This approach allows multiple threads to call the library's functions simultaneously (without using mutexes or other synchronization or blocking code).