Graphics Programming
TVP4020
Programmers Reference Manual
52
// Set the Rasterizer mode to the default, see
// §5.3.11
RasterizerMode (0)
// Load the delta values for the first segment.
StartXDom (X1<<16)
dXDom (1.0<<16)
StartY (Y1<<16)
dY (((Y2- Y1)<<16)/(X2 - X1))
Count (abs (X2 - X1))
// Set the render mode
render.PrimitiveType = PERMEDIA_LINE_PRIMITIVE
// Start rendering
Render (render)
// The first segment is complete, load delta
// for the second
dXDom (1.0<<16)
dY (((Y3- Y2)<<16)/(X3 - X2))
// Continue with the second segment
ContinueNewLine (abs (X3 - X2))
Note that the mechanism to render the second segment with the
ContinueNewLine command is analogous to the ContinueNewSub
command used at the knee of a triangle. Care must be taken when a
continue command is being used for lines. Incorrect rendering can occur
with operations such as alpha blending and logical ops if a segment
draws back over the previous line segment thus attempting to reuse
pixels that have just been updated. The solution is to send a Sync prior
to the ContinueNewLine. This will ensure pending writes are flushed
before the framebuffer reads for the new line segment. Note that there is
no need to poll for the Sync here; the act of loading this command
register is sufficient.
When a Continue command is used rather than a ContinueNewLine,
some error will be propagated along the line so this is rarely used for
lines. To minimize these errors, a choice of actions are available as to
how the DDA units are restarted on the receipt of a ContinueNewLine
command, see section §5.3.11.
Summary of Contents for TVP4020 PERMEDIA 2
Page 1: ...Texas Instruments TVP4020 PERMEDIA 2 Programmer s Reference Manual Issue 4 ...
Page 284: ...TVP4020 Programmers Reference Manual A Gouraud Shaded Triangle 275 ...
Page 292: ...TVP4020 Programmers Reference Manual Register Tables 283 ...
Page 314: ...TVP4020 Programmers Reference Manual Index 305 ...
Page 315: ...Index TVP4020 Programmers Reference Manual 306 Index ...
Page 323: ...Index TVP4020 Programmers Reference Manual 314 ...