BRender Technical Reference Manual:4 Data Structures (Alphabetical Reference):br_primitive
Next|Prev|Up
The Structure
Members
Copy/Assign
Access & Maintenance
Referencing & Lifetime
Construction & Destruction

br_primitive


The Structure

The primitive is an item of rendering data produced in the second phase of rendering. It is typically a lit face of a model, transformed into screen co-ordinates. It contains sufficient information (some private) to be depth sorted and rendered to the destination pixel map. The application programmer will only be handling primitives as far as is necessary to determine whether the primitive should appear and in what order it should be rendered. Primitives are only generated by BRender.

The typedef

(See order.h for a precise declaration)

Properties

br_uint_16 type Primitive type

br_material * material Material from which primitive was generated

Organisation

br_primitive * next Next primitive (when in bucket)

Related Functions

For details of how to specify that a primitive call-back function should be called during rendering see BrZsPrimitiveCallbackSet()
39. To determine into which bucket a primitive would be inserted see BrZsPrimitiveBucketSelect()309. To insert a primitive into an order table see BrZsOrderTablePrimitiveInsert()263.

Related Structures

See br_order_table260 for the container into which primitives are inserted. See br_primitive_cbfn307 for details of how to customise primitive insertion into order tables.

Members

Properties

br_uint_16 type

There are currently three types of primitive: point, line and triangle. This member indicates the type of this primitive. It should not be modified. The following table lists the symbols defining the value of each type.

br_material * material

The material assigned to the face of the model from which the primitive was generated (explicitly or by inheritance).

Organisation

br_primitive * next

Each bucket within an order table is a linked list of primitives. The primitive contains the links in the form of this pointer. When a primitive is inserted into a bucket, it is inserted at the head (the first bucket in the list). Upon rendering the buckets are rendered from the head onwards. This member should not be modified.

Copy/Assign

Do not copy primitives.

Access & Maintenance

Primitives are only generated by BRender, and are primarily for internal use. The applications programmer is not expected to traverse or maintain primitives. Some members may be usefully read, but modification is not encouraged for members other than material.

Referencing & Lifetime

Primitives are allocated from the primitive heap as supplied to BrZsBegin()28. They are valid until the next call of BrZsSceneRenderBegin()35 when the primitive heap will be overwritten with new primitives - unless, of course a different one is set up.

Construction & Destruction

Primitives can only be constructed through the rendering process. They are never destroyed, but are overwritten.


Generated with
CERN WebMaker