Index

C/C++ Functions

dcRasterizerIni

DT_SWORD dcRasterizerIni(DT_DCRASTER* dcr, const DT_MDC* memory_surface, DT_SLONG raster_intersect, DT_ID_SLONG raster_id)

Short Description: Create and initialize D-Type Direct Color Rasterizer

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.

Parameters

ParameterDescription

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:

Standard

  • 0 = Ultra-Fast RGBA Rasterizer
  • 1 = No-Overlap RGBA Rasterizer
  • 2 = Reference RGBA Rasterizer
  • 3 = Alpha-Blend RGBA Rasterizer
  • 4 = CDTRasterizerAlphaTrueRGBA_V1_SC
  • 5 = CDTRasterizerAlphaXtraRGBA_V1_SC

Shading

  • 10 = CDTRasterizerAlphaTrueCREF_T1 0
  • 11 = CDTRasterizerAlphaTrueCREF_T1 1
  • 12 = CDTRasterizerAlphaTrueCREF_T1 2
  • 13 = CDTRasterizerAlphaTrueRGBA_Gouraud 1
  • 14 = CDTRasterizerAlphaTrueRGBA_Gouraud 2
  • 15 = CDTRasterizerAlphaEasyRGBA_Gouraud
  • 16 = CDTRasterizerAlphaTrueCREF_T1 3
  • 17 = CDTRasterizerAlphaTrueCREF_T1 4

Grayscale / B&W

  • 50 = Ultra-Fast Grayscale Rasterizer
  • 51 = Perfect Grayscale Rasterizer
  • 52 = Universal Rasterizer — Grayscale
  • 54 = Extreme Grayscale Rasterizer

Return Value

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.

Comments

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).

 

Index