![background image](http://html.mh-extra.com/html/texas-instruments/tvp4020-permedia-2/tvp4020-permedia-2_reference-manual_1097169168.webp)
TVP4020
Programmers Reference Manual
Delta Programming Examples
159
// This function draws the mesh as a series of shaded triangles.
void TriangleMesh (gal &cx)
{
__DeltaModeFmat
deltaMode;
__DeltaRenderFmat
drawCmd;
int
vertexStore;
int
rect, v;
// Assume the rendering device is already initialized. Note we
// expect the BiasCoords mode in the RasterizerMode register to be
// set to add a bias of zero.
// Set-up the DeltaMode register.
deltaMode.pad
= 0;
deltamode.ColorOrder
= 0;
deltamode.BackfaceCallEnable
= 0;
deltaMode.TextureParameterMode
= 2;
// Auto normalize.
deltaMode.ClampEnable
= 1;
// Clamp enabled.
deltaMode.NoDraw
= 0;
// Do drawing.
deltaMode.DiamondExit
= 1;
// Not needed for this
// example.
deltaMode.SubPixelCorrectionEnable
= 1;
// Enable sub pixel
// correction.
deltaMode.DiffuseTextureEnable
= 0;
// Disable.
deltaMode.SpecularTextureEnable
= 0;
// Disable.
deltaMode.DepthEnable
= 1;
// Enable.
deltaMode.SmoothShadingEnable
= 1;
// Enable.
deltaMode.TextureEnable
= 0;
// Disabled.
deltaMode.FogEnable
= 1;
// Enabled, but
// controlled from
// the draw command.
deltaMode.Reserved
= 0;
LD_REG (__DeltaTagDeltaMode, *((long *) &deltaMode));
// Set-up the draw command data.
drawCmd.pad
= 0;
drawCmd.ReuseBitMask
= 0;
drawCmd.SubPixelCorrectionEnable
= 1;
// Enable.
drawCmd.RaservedA
= 0;
drawCmd.SyncOnBitMask
= 0;
// Disable.
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 ...