DIRECTORY G3dRender, ImagerSample, Rope; G3dRenderWithPixels: CEDAR DEFINITIONS ~ BEGIN Context: TYPE ~ G3dRender.Context; ContextProc: TYPE ~ G3dRender.ContextProc; ImagerProc: TYPE ~ G3dRender.ImagerProc; Pair: TYPE ~ G3dRender.Pair; PairSequence: TYPE ~ G3dRender.PairSequence; Patch: TYPE ~ G3dRender.Patch; PatchProc: TYPE ~ G3dRender.PatchProc; Pixel: TYPE ~ G3dRender.Pixel; Quad: TYPE ~ G3dRender.Quad; RealSequence: TYPE ~ G3dRender.RealSequence; RGB: TYPE ~ G3dRender.RGB; RopeProc: TYPE ~ G3dRender.RopeProc; RenderData: TYPE ~ G3dRender.RenderData; ShadingClass: TYPE ~ G3dRender.ShadingClass; SpotProc: TYPE ~ G3dRender.SpotProc; Triple: TYPE ~ G3dRender.Triple; ROPE: TYPE ~ Rope.ROPE; RasterSampleMaps: TYPE ~ ARRAY [0..5) OF ImagerSample.RasterSampleMap; RopeDesc: TYPE ~ RECORD [rope: ROPE, pos: Pair, color: Pixel, size: REAL, font: ROPE]; LerpVtx: TYPE ~ RECORD [ x, y: REAL, val: RealSequence ]; LerpVtxSequence: TYPE ~ RECORD [ length: CARDINAL, element: SEQUENCE maxLength: CARDINAL OF REF LerpVtx ]; FancyPatch: TYPE ~ RECORD [ recurseLevel: NAT _ 0, renderData: REF RenderData, -- procs for texturing, etc. ctlPt: SEQUENCE length: CARDINAL OF LerpVtx ]; AllocatePixelMemory: ContextProc; DepthBuffering: PROC [context: Context, on: BOOL _ TRUE ]; AntiAliasing: PROC [context: Context, on: BOOL _ TRUE ]; NormalBuffering: PROC [context: Context, on: BOOL _ TRUE ]; FillInBackGround: ContextProc; FillInConstantBackGround: PROC [context: Context, bkgrdClr: RGB, cvrge: BYTE _ 255]; BufferRendering: PROC [context: Context, on: BOOL _ TRUE ]; MakeFrame: ContextProc; ShadeSpot: SpotProc; Draw2DLine: PROC [context: Context, p1, p2: Pair, color: Pixel]; Draw2DPoly: PROC [context: Context, poly: PairSequence, color: Pixel]; DrawRope: RopeProc; DoRope: ImagerProc; PolygonTiler: PatchProc; FancyTiler: PROC [context: Context, poly: REF Patch]; RealFancyTiler: PROC [context: Context, poly: REF FancyPatch]; END. >G3dRenderWithPixels.mesa Copyright c 1984 by Xerox Corporation. All rights reserved. Last Edited by: Crow, August 9, 1989 3:04:40 pm PDT Glassner, March 14, 1989 2:18:44 pm PST Types Initializing and Updating Pixel Maps Get pixel memory for things like rgb, alpha, depth, normal coding. Get a bare context for making images independent of color display. Sets up or destroys depth buffer in VM for context.pixels. Sets up or destroys alpha buffer in VM for context.pixels (used for antialiasing). Sets up or destroys normal vector buffer in VM for context.pixels (used for LightingTool) . Loads background behind current image. Clears frame, use with alpha buffer to load background color behind shapes. Frame Generation Renders through buffer and blits to screen when on, directly to screen (slowly) when off Makes image, clears frame, adds background, etc. Low-level drawing Send spot values through the vertex shading procedure. Draw a line with integer endpoints. Draw polygon avoiding floating point. Put a rope in the pixels, somehow. Put a rope in the pixels, using calls on the imager, rope is passed as RopeDesc in data. Simple Polygon Tilers Call point for discriminating among tilers. Fancy Polygon Tilers Recursive implementor of tiler. For Anti-aliasing, texture, etc. We're goin' blow the socks off this baby! ΚΣ˜Ihead™šœ Οmœ1™