15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    SUN_triangle_list
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ci
65bd8deadSopenharmony_ciName Strings
75bd8deadSopenharmony_ci
85bd8deadSopenharmony_ci    GL_SUN_triangle_list
95bd8deadSopenharmony_ci
105bd8deadSopenharmony_ciContact
115bd8deadSopenharmony_ci
125bd8deadSopenharmony_ci    Jack Middleton, Sun (Jack.Middleton 'at' eng.sun.com)
135bd8deadSopenharmony_ci
145bd8deadSopenharmony_ciStatus
155bd8deadSopenharmony_ci
165bd8deadSopenharmony_ci    Shipping
175bd8deadSopenharmony_ci
185bd8deadSopenharmony_ciVersion
195bd8deadSopenharmony_ci
205bd8deadSopenharmony_ci    $Date: 1999/12/28 01:40:37 $ $Revision: 1.4 $
215bd8deadSopenharmony_ci    SUN Date: 99/06/25 13:12:54  Revision: 1.6
225bd8deadSopenharmony_ci
235bd8deadSopenharmony_ciNumber
245bd8deadSopenharmony_ci
255bd8deadSopenharmony_ci    165
265bd8deadSopenharmony_ci
275bd8deadSopenharmony_ciDependencies
285bd8deadSopenharmony_ci
295bd8deadSopenharmony_ci    OpenGL 1.1 is required
305bd8deadSopenharmony_ci
315bd8deadSopenharmony_ci
325bd8deadSopenharmony_ciOverview
335bd8deadSopenharmony_ci
345bd8deadSopenharmony_ci    OpenGL has two chained triangle primitives, TRIANGLE_STRIP and
355bd8deadSopenharmony_ci    TRIANGLE_FAN.  For multiple, consecutive triangle strips or
365bd8deadSopenharmony_ci    triangle fans, the overhead of Begin and End, or separate calls to
375bd8deadSopenharmony_ci    DrawArrays, can be significant depending on the number of triangles
385bd8deadSopenharmony_ci    per strip or fan.
395bd8deadSopenharmony_ci
405bd8deadSopenharmony_ci    Many surface tessellators produce triangle strips with very few
415bd8deadSopenharmony_ci    triangles per strip before needing to restart a new strip.  Even
425bd8deadSopenharmony_ci    sophisticated tessellators typically need to restart a new strip,
435bd8deadSopenharmony_ci    or switch from a triangle strip to a triangle fan, many times
445bd8deadSopenharmony_ci    within a single object.  Such tessellators can often produce a more
455bd8deadSopenharmony_ci    efficient tessellation--one with fewer vertices--by mixing strips
465bd8deadSopenharmony_ci    and fans within the same object.  The ability to switch from one to
475bd8deadSopenharmony_ci    the other without restarting the strip or fan yields even more
485bd8deadSopenharmony_ci    savings.  Unfortunately, the overhead of switching from a triangle
495bd8deadSopenharmony_ci    strip to a triangle fan, or vice versa, can reduce, or even
505bd8deadSopenharmony_ci    eliminate the benefit gained from reducing the number of vertices.
515bd8deadSopenharmony_ci
525bd8deadSopenharmony_ci    A new triangle list primitive, along with an associated replacement
535bd8deadSopenharmony_ci    code attribute, is defined by this extension to allow multiple
545bd8deadSopenharmony_ci    triangle strips and fans to be specified within the same Begin/End
555bd8deadSopenharmony_ci    pair or from a single call to DrawArrays.  The triangle list
565bd8deadSopenharmony_ci    extension also provides the means to switch between triangle strips
575bd8deadSopenharmony_ci    and triangle fans with or without restarting the strip or fan.
585bd8deadSopenharmony_ci
595bd8deadSopenharmony_ci    TRIANGLE_LIST is a new primitive type (i.e., new Begin mode) that
605bd8deadSopenharmony_ci    uses the ReplacementCodeSUN state attribute to determine whether the
615bd8deadSopenharmony_ci    current vertex replaces the oldest vertex, as in a triangle strip,
625bd8deadSopenharmony_ci    the middle vertex, as in a triangle fan, or restarts a new chained
635bd8deadSopenharmony_ci    triangle list.  The first vertex of a new triangle list is
645bd8deadSopenharmony_ci    implicitly treated as a RESTART.  The first three vertices complete
655bd8deadSopenharmony_ci    the first triangle, after which the replacement codes of the vertex
665bd8deadSopenharmony_ci    are used.  The two vertices immediately following a
675bd8deadSopenharmony_ci    restart--including the implicit restart on the first vertex--are
685bd8deadSopenharmony_ci    ignored.  The ReplacementCodeSUN attribute is part of the vertex
695bd8deadSopenharmony_ci    state, and is only used by the TRIANGLE_LIST primitive.
705bd8deadSopenharmony_ci
715bd8deadSopenharmony_ci
725bd8deadSopenharmony_ciIssues
735bd8deadSopenharmony_ci
745bd8deadSopenharmony_ci    1.	Two types of restarts: CW/CCW
755bd8deadSopenharmony_ci
765bd8deadSopenharmony_ci	Compressed geometry supports the notion of RESTART_CW versus
775bd8deadSopenharmony_ci	RESTART_CCW.  These two types of restart are supported by all
785bd8deadSopenharmony_ci	of Sun's hardware and this capability was exposed via XGL.  We
795bd8deadSopenharmony_ci	need to decide whether we want to expose this in OpenGL.  In a
805bd8deadSopenharmony_ci	sense, we already have exposed it with the compressed geometry
815bd8deadSopenharmony_ci	extension, since the compressed geometry spec allows both types
825bd8deadSopenharmony_ci	of restart.
835bd8deadSopenharmony_ci
845bd8deadSopenharmony_ci	It is worth noting that these modes are somewhat misnamed.
855bd8deadSopenharmony_ci	They really don't override the meaning of the GL_FRONT_FACE
865bd8deadSopenharmony_ci	flag (nor did they override the equivalent XGL mode, either).
875bd8deadSopenharmony_ci	Rather, the type of restart either inverts the GL_FRONT_FACE
885bd8deadSopenharmony_ci	state, in the case of RESTART_CW, or it uses the GL_FRONT_FACE
895bd8deadSopenharmony_ci	flag unmodified, in the case of RESTART_CCW.  This should be
905bd8deadSopenharmony_ci	the case for compressed geometry today (although it may be
915bd8deadSopenharmony_ci	broken), and it would be true for triangle lists if we decided
925bd8deadSopenharmony_ci	to expose this capability.  My preference would be to not
935bd8deadSopenharmony_ci	expose this, since all it really does is create a documentation
945bd8deadSopenharmony_ci	headache.  The user can always define a generalized triangle list
955bd8deadSopenharmony_ci	with consistently wound triangles using the CCW variant of restart.
965bd8deadSopenharmony_ci        Supporting both types of restart just doesn't fit into OpenGL's
975bd8deadSopenharmony_ci	(or Java 3D's) model cleanly.
985bd8deadSopenharmony_ci
995bd8deadSopenharmony_ci	[NOTE: a decision has been made to not expose the CW/CCW feature]
1005bd8deadSopenharmony_ci
1015bd8deadSopenharmony_ci    2.	Enumerated values for replacement codes
1025bd8deadSopenharmony_ci
1035bd8deadSopenharmony_ci	Enumerated values used for extensions are typically defined as
1045bd8deadSopenharmony_ci	integers in a specified range.  This range depends on whether
1055bd8deadSopenharmony_ci	they are vendor private (_SUN) or multi-vendor (_EXT or _ARB)
1065bd8deadSopenharmony_ci	extensions.  For this extension, we are defining a new
1075bd8deadSopenharmony_ci	replacement code attribute that is part of the vertex state
1085bd8deadSopenharmony_ci	and is expected to be processed directly by hardware.  Given
1095bd8deadSopenharmony_ci	this, we have defined the replacement codes as small integer
1105bd8deadSopenharmony_ci	values (1, 2, and 3) that correspond with what the hardware
1115bd8deadSopenharmony_ci	wants to see.  The cost for having these values be different,
1125bd8deadSopenharmony_ci	especially for replacement codes in a vertex array, are too
1135bd8deadSopenharmony_ci	great.
1145bd8deadSopenharmony_ci
1155bd8deadSopenharmony_ci	Another reason for not using constants in the range of
1165bd8deadSopenharmony_ci	extension enums is that if this ever became part of the core
1175bd8deadSopenharmony_ci	after first being an extension, or even if it became a
1185bd8deadSopenharmony_ci	multi-vendor extension after first being a Sun-private
1195bd8deadSopenharmony_ci	extension, then the codes would change.  This would be
1205bd8deadSopenharmony_ci	unworkable for an attribute such as this, since it is part of
1215bd8deadSopenharmony_ci	the vertex pipeline.
1225bd8deadSopenharmony_ci
1235bd8deadSopenharmony_ci	We need to ensure that our current plan of defining
1245bd8deadSopenharmony_ci	replacement codes outside the range of extension enums is not
1255bd8deadSopenharmony_ci	violating any rules.  I think that this shouldn't be a problem
1265bd8deadSopenharmony_ci	since the replacement codes themselves are really just
1275bd8deadSopenharmony_ci	parameters to the replacement code command.  As such, they are
1285bd8deadSopenharmony_ci	just bit patterns and shouldn't need to be unique.
1295bd8deadSopenharmony_ci
1305bd8deadSopenharmony_ci
1315bd8deadSopenharmony_ciNew Procedures and Functions
1325bd8deadSopenharmony_ci
1335bd8deadSopenharmony_ci    void ReplacementCodeuiSUN(uint code);
1345bd8deadSopenharmony_ci
1355bd8deadSopenharmony_ci    void ReplacementCodeusSUN(ushort code);
1365bd8deadSopenharmony_ci
1375bd8deadSopenharmony_ci    void ReplacementCodeubSUN(ubyte code);
1385bd8deadSopenharmony_ci
1395bd8deadSopenharmony_ci    void ReplacementCodeuivSUN(const uint *code);
1405bd8deadSopenharmony_ci
1415bd8deadSopenharmony_ci    void ReplacementCodeusvSUN(const ushort *code);
1425bd8deadSopenharmony_ci
1435bd8deadSopenharmony_ci    void ReplacementCodeubvSUN(const ubyte *code);
1445bd8deadSopenharmony_ci
1455bd8deadSopenharmony_ci    void ReplacementCodePointerSUN(enum type,
1465bd8deadSopenharmony_ci				   sizei stride,
1475bd8deadSopenharmony_ci				   const void *pointer);
1485bd8deadSopenharmony_ci
1495bd8deadSopenharmony_ci
1505bd8deadSopenharmony_ciNew Tokens
1515bd8deadSopenharmony_ci
1525bd8deadSopenharmony_ci    Accepted by the <mode> parameter of Begin, DrawArrays,
1535bd8deadSopenharmony_ci    DrawElements, MultiDrawArraysSUN, MultiDrawArraysEXT,
1545bd8deadSopenharmony_ci    MultiDrawElementsSUN, and MultiDrawElementsEXT:
1555bd8deadSopenharmony_ci
1565bd8deadSopenharmony_ci	TRIANGLE_LIST_SUN			0x81D7
1575bd8deadSopenharmony_ci
1585bd8deadSopenharmony_ci    Accepted by the by the <pname> parameter of GetBooleanv,
1595bd8deadSopenharmony_ci    GetIntegerv, GetFloatv, and GetDoublev:
1605bd8deadSopenharmony_ci
1615bd8deadSopenharmony_ci	REPLACEMENT_CODE_SUN			0x81D8
1625bd8deadSopenharmony_ci
1635bd8deadSopenharmony_ci    Accepted by the <code> parameter of ReplacementCode{ui,us,ub}[v]SUN:
1645bd8deadSopenharmony_ci
1655bd8deadSopenharmony_ci	RESTART_SUN				0x01
1665bd8deadSopenharmony_ci	REPLACE_MIDDLE_SUN			0x02
1675bd8deadSopenharmony_ci	REPLACE_OLDEST_SUN			0x03
1685bd8deadSopenharmony_ci
1695bd8deadSopenharmony_ci    Accepted by the <array> parameter of EnableClientState and
1705bd8deadSopenharmony_ci    DisableClientState, and by the <cap> parameter of IsEnabled:
1715bd8deadSopenharmony_ci
1725bd8deadSopenharmony_ci	REPLACEMENT_CODE_ARRAY_SUN		0x85C0
1735bd8deadSopenharmony_ci
1745bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
1755bd8deadSopenharmony_ci    GetFloatv, and GetDoublev:
1765bd8deadSopenharmony_ci
1775bd8deadSopenharmony_ci	REPLACEMENT_CODE_ARRAY_TYPE_SUN		0x85C1
1785bd8deadSopenharmony_ci	REPLACEMENT_CODE_ARRAY_STRIDE_SUN	0x85C2
1795bd8deadSopenharmony_ci
1805bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetPointerv:
1815bd8deadSopenharmony_ci
1825bd8deadSopenharmony_ci	REPLACEMENT_CODE_ARRAY_POINTER_SUN	0x85C3
1835bd8deadSopenharmony_ci
1845bd8deadSopenharmony_ci
1855bd8deadSopenharmony_ci    Accepted by the <format> parameter of InterleavedArrays:
1865bd8deadSopenharmony_ci
1875bd8deadSopenharmony_ci	R1UI_V3F_SUN				0x85C4
1885bd8deadSopenharmony_ci	R1UI_C4UB_V3F_SUN			0x85C5
1895bd8deadSopenharmony_ci	R1UI_C3F_V3F_SUN			0x85C6
1905bd8deadSopenharmony_ci	R1UI_N3F_V3F_SUN			0x85C7
1915bd8deadSopenharmony_ci	R1UI_C4F_N3F_V3F_SUN			0x85C8
1925bd8deadSopenharmony_ci	R1UI_T2F_V3F_SUN			0x85C9
1935bd8deadSopenharmony_ci	R1UI_T2F_N3F_V3F_SUN			0x85CA
1945bd8deadSopenharmony_ci	R1UI_T2F_C4F_N3F_V3F_SUN		0x85CB
1955bd8deadSopenharmony_ci
1965bd8deadSopenharmony_ci
1975bd8deadSopenharmony_ciAdditions to Chapter 2 of the GL Specification (OpenGL Operation)
1985bd8deadSopenharmony_ci
1995bd8deadSopenharmony_ci    Replacement Code
2005bd8deadSopenharmony_ci    ----------------
2015bd8deadSopenharmony_ci    The replacement code is a per-vertex state attribute that controls
2025bd8deadSopenharmony_ci    triangle vertex replacement for the triangle list primitive; it is
2035bd8deadSopenharmony_ci    ignored for all other primitives.  This state attribute is set by
2045bd8deadSopenharmony_ci    the ReplacementCodeSUN command.  Since it is part of the vertex state,
2055bd8deadSopenharmony_ci    the ReplacementCodeSUN command may appear within a Begin/End pair.  The
2065bd8deadSopenharmony_ci    replacement code is an enum with 3 values, RESTART_SUN,
2075bd8deadSopenharmony_ci    REPLACE_MIDDLE_SUN, and REPLACE_OLDEST_SUN.
2085bd8deadSopenharmony_ci
2095bd8deadSopenharmony_ci    Note that the replacement code follows the same rules as other
2105bd8deadSopenharmony_ci    per-vertex state attributes.  The current value of the replacement
2115bd8deadSopenharmony_ci    code state attribute affects subsequent vertices until the next
2125bd8deadSopenharmony_ci    time the ReplacementCodeSUN command is executed, updating the value
2135bd8deadSopenharmony_ci    of the state attribute.  This means that a replacement code that is
2145bd8deadSopenharmony_ci    set outside of a Begin/End will affect subsequent triangle lists in
2155bd8deadSopenharmony_ci    which the replacement code is not set.  Similarly, the value of the
2165bd8deadSopenharmony_ci    last replacement code set within a Begin/End will affect subsequent
2175bd8deadSopenharmony_ci    triangle lists in which the replacement code is not set.
2185bd8deadSopenharmony_ci
2195bd8deadSopenharmony_ci    Triangle List
2205bd8deadSopenharmony_ci    -------------
2215bd8deadSopenharmony_ci    A triangle list primitive is a series of triangles that are
2225bd8deadSopenharmony_ci    connected according to the replacement codes associated with each
2235bd8deadSopenharmony_ci    vertex in the list.  A triangle list is specified by giving a
2245bd8deadSopenharmony_ci    series of defining vertices between a Begin/End pair when Begin is
2255bd8deadSopenharmony_ci    called with TRIANGLE_LIST.  As with a triangle strip and a triangle
2265bd8deadSopenharmony_ci    fan, the first three vertices define a triangle.  The order of the
2275bd8deadSopenharmony_ci    three vertices is significant.  Subsequent vertices either define a
2285bd8deadSopenharmony_ci    triangle that is connected to the previous triangle using the new
2295bd8deadSopenharmony_ci    vertex and two vertices from the previous triangle, or they restart
2305bd8deadSopenharmony_ci    a new triangle, depending on the value specified by the replacement
2315bd8deadSopenharmony_ci    code state.  The edge flag attribute is ignored by the triangle list
2325bd8deadSopenharmony_ci    primitive.  If PolygonMode is set to LINE or POINT, then all edges
2335bd8deadSopenharmony_ci    or vertices are drawn (as with TRIANGLE_STRIP and TRIANGLE_FAN).
2345bd8deadSopenharmony_ci
2355bd8deadSopenharmony_ci    In addition to the current vertex, the state required to support
2365bd8deadSopenharmony_ci    triangle lists consists of a 2-bit vertex counter that indicates
2375bd8deadSopenharmony_ci    the number of vertices since the beginning of the list or since a
2385bd8deadSopenharmony_ci    restart, two stored processed vertices, and a one-bit pointer
2395bd8deadSopenharmony_ci    indicating the order of drawing (oldest-middle-current versus
2405bd8deadSopenharmony_ci    middle-oldest-current).
2415bd8deadSopenharmony_ci
2425bd8deadSopenharmony_ci    The rules for determining when to draw a triangle and what vertices
2435bd8deadSopenharmony_ci    to use and in what order are as follows:
2445bd8deadSopenharmony_ci
2455bd8deadSopenharmony_ci    1.	When a BEGIN command is called with TRIANGLE_LIST, the vertex
2465bd8deadSopenharmony_ci	counter is set to 0.
2475bd8deadSopenharmony_ci
2485bd8deadSopenharmony_ci    2.	When a new vertex is completed, the following logic is used to
2495bd8deadSopenharmony_ci	process the vertex:
2505bd8deadSopenharmony_ci
2515bd8deadSopenharmony_ci	    if (vertex_counter == 0) {
2525bd8deadSopenharmony_ci		vertex_counter = 1
2535bd8deadSopenharmony_ci		drawing_order = 0
2545bd8deadSopenharmony_ci		vertexA = currentVertex
2555bd8deadSopenharmony_ci	    }
2565bd8deadSopenharmony_ci	    else if (vertex_counter == 1) {
2575bd8deadSopenharmony_ci		vertex_counter = 2
2585bd8deadSopenharmony_ci		vertexB = currentVertex
2595bd8deadSopenharmony_ci	    }
2605bd8deadSopenharmony_ci	    else if (vertex_counter == 2) {
2615bd8deadSopenharmony_ci		vertex_counter = 3
2625bd8deadSopenharmony_ci		draw(vertexA, vertexB, currentVertex)
2635bd8deadSopenharmony_ci	    }
2645bd8deadSopenharmony_ci	    else {
2655bd8deadSopenharmony_ci		if (repl_code == RESTART) {
2665bd8deadSopenharmony_ci		    vertex_counter = 1
2675bd8deadSopenharmony_ci		    drawing_order = 0
2685bd8deadSopenharmony_ci		    vertexA = currentVertex
2695bd8deadSopenharmony_ci		}
2705bd8deadSopenharmony_ci		else {
2715bd8deadSopenharmony_ci		    if (repl_code == REPLACE_OLDEST)
2725bd8deadSopenharmony_ci			drawing_order = !drawing_order
2735bd8deadSopenharmony_ci
2745bd8deadSopenharmony_ci		    if (drawing_order == 0)
2755bd8deadSopenharmony_ci			draw(vertexA, vertexB, currentVertex)
2765bd8deadSopenharmony_ci		    else
2775bd8deadSopenharmony_ci			draw(vertexB, vertexA, currentVertex)
2785bd8deadSopenharmony_ci
2795bd8deadSopenharmony_ci		    if (repl_code == REPLACE_OLDEST)
2805bd8deadSopenharmony_ci			vertexA = vertexB
2815bd8deadSopenharmony_ci		    vertexB = currentVertex
2825bd8deadSopenharmony_ci		}
2835bd8deadSopenharmony_ci	    }
2845bd8deadSopenharmony_ci
2855bd8deadSopenharmony_ci    If a triangle list has fewer than 3 vertices then no triangles are
2865bd8deadSopenharmony_ci    drawn.  If a triangle list has fewer than 2 vertices following a
2875bd8deadSopenharmony_ci    vertex with a RESTART replacement code, then the restart is
2885bd8deadSopenharmony_ci    ignored, along with the one vertex after the restart, if present.
2895bd8deadSopenharmony_ci
2905bd8deadSopenharmony_ci    Because the replacement code is ignored for the first vertex and
2915bd8deadSopenharmony_ci    the two vertices immediately following a restart, a constant
2925bd8deadSopenharmony_ci    replacement code has a well-defined, consistent semantic.  If the
2935bd8deadSopenharmony_ci    replacement code for each vertex is REPLACE_OLDEST, then a triangle
2945bd8deadSopenharmony_ci    strip will be drawn.  If the replacement code for each vertex is
2955bd8deadSopenharmony_ci    REPLACE_MIDDLE, then a triangle fan will be drawn.  If the
2965bd8deadSopenharmony_ci    replacement code for each vertex is RESTART, then isolated
2975bd8deadSopenharmony_ci    triangles will be drawn.
2985bd8deadSopenharmony_ci
2995bd8deadSopenharmony_ci    The following example illustrates the use of vertex replacement
3005bd8deadSopenharmony_ci    within a single triangle list to draw triangle strips, triangle
3015bd8deadSopenharmony_ci    fans, isolated triangles, and, finally, a triangle strip that
3025bd8deadSopenharmony_ci    switches to a fan and back to a strip without a restart.  In this
3035bd8deadSopenharmony_ci    example REPLACE_OLDEST is abbreviated RO and REPLACE_MIDDLE is
3045bd8deadSopenharmony_ci    abbreviated RM.  Note that the initial RESTART replacement appears
3055bd8deadSopenharmony_ci    in square brackets, indicating that it is an implicit restart; the
3065bd8deadSopenharmony_ci    replacement code is ignored for the first vertex following a begin
3075bd8deadSopenharmony_ci    command.  The replacement code is also ignored for the two
3085bd8deadSopenharmony_ci    vertices immediately following a restart.
3095bd8deadSopenharmony_ci
3105bd8deadSopenharmony_ci                               2       4       6
3115bd8deadSopenharmony_ci        V1  [RESTART]          .-------.-------.
3125bd8deadSopenharmony_ci        V2   --               /\      /\      /
3135bd8deadSopenharmony_ci        V3   --              /  \    /  \    /
3145bd8deadSopenharmony_ci        V4   RO             /    \  /    \  /  Triangle Strip
3155bd8deadSopenharmony_ci        V5   RO            /      \/      \/
3165bd8deadSopenharmony_ci        V6   RO           .-------.-------.
3175bd8deadSopenharmony_ci                          1       3       5
3185bd8deadSopenharmony_ci
3195bd8deadSopenharmony_ci                              9.-------.10
3205bd8deadSopenharmony_ci                              /\      /\
3215bd8deadSopenharmony_ci        V7   RESTART         /  \    /  \
3225bd8deadSopenharmony_ci        V8   --             /    \  /    \
3235bd8deadSopenharmony_ci        V9   --            /      \/      \
3245bd8deadSopenharmony_ci        V10  RM           8.------.7-------.11  Triangle Fan
3255bd8deadSopenharmony_ci        V11  RM          14\      /\      /
3265bd8deadSopenharmony_ci        V12  RM             \    /  \    /
3275bd8deadSopenharmony_ci        V13  RM              \  /    \  /
3285bd8deadSopenharmony_ci        V14  RM               \/      \/
3295bd8deadSopenharmony_ci                              .-------.
3305bd8deadSopenharmony_ci                              13     12
3315bd8deadSopenharmony_ci
3325bd8deadSopenharmony_ci                            16           19
3335bd8deadSopenharmony_ci        V15  RESTART         .            .
3345bd8deadSopenharmony_ci        V16  --             /\           /\
3355bd8deadSopenharmony_ci        V17  --            /  \         /  \
3365bd8deadSopenharmony_ci        V18  RESTART      /    \       /    \  Isolated Triangles
3375bd8deadSopenharmony_ci        V19  --          /      \     /      \
3385bd8deadSopenharmony_ci        V20  --         .--------.   .--------.
3395bd8deadSopenharmony_ci                       15       17  18       20
3405bd8deadSopenharmony_ci
3415bd8deadSopenharmony_ci                       22    24    26
3425bd8deadSopenharmony_ci                        .-----.-----.
3435bd8deadSopenharmony_ci        V21  RESTART    |\    |\    |\
3445bd8deadSopenharmony_ci        V22  --         | \   | \   | \
3455bd8deadSopenharmony_ci        V23  --         |  \  |  \  |  .27
3465bd8deadSopenharmony_ci        V24  RO         |   \ |   \ | /\
3475bd8deadSopenharmony_ci        V25  RO         |    \|    25/  \
3485bd8deadSopenharmony_ci        V26  RO         .-----.-----.---.28   Mixed Strip & Fan
3495bd8deadSopenharmony_ci        V27  RO        21    23    /|\  |
3505bd8deadSopenharmony_ci        V28  RM                   / | \ |
3515bd8deadSopenharmony_ci        V29  RM                  /  |  \|
3525bd8deadSopenharmony_ci        V30  RM                 .---.---.29
3535bd8deadSopenharmony_ci        V31  RM               31\   /30
3545bd8deadSopenharmony_ci        V32  RO                  \ /
3555bd8deadSopenharmony_ci                                  .
3565bd8deadSopenharmony_ci                                 32
3575bd8deadSopenharmony_ci
3585bd8deadSopenharmony_ci
3595bd8deadSopenharmony_ci
3605bd8deadSopenharmony_ci    Triangle list primitives may be drawn using vertex arrays in the
3615bd8deadSopenharmony_ci    same manner as other primitives.  The replacement code state flag
3625bd8deadSopenharmony_ci    may be enabled as part of a vertex array operation.  The
3635bd8deadSopenharmony_ci    REPLACEMENT_CODE_ARRAY_SUN enum is used to enable or disable the
3645bd8deadSopenharmony_ci    replacement code array using the EnableClientState and
3655bd8deadSopenharmony_ci    DisableClientState functions.
3665bd8deadSopenharmony_ci
3675bd8deadSopenharmony_ci    The following function defines the type, stride, and pointer for
3685bd8deadSopenharmony_ci    the replacement code data.
3695bd8deadSopenharmony_ci
3705bd8deadSopenharmony_ci	void ReplacementCodePointerSUN(enum type,
3715bd8deadSopenharmony_ci				       sizei stride,
3725bd8deadSopenharmony_ci				       const void *pointer);
3735bd8deadSopenharmony_ci
3745bd8deadSopenharmony_ci    Legal values for type are UNSIGNED_BYTE, UNSIGNED_SHORT, and
3755bd8deadSopenharmony_ci    UNSIGNED_INT.  As with other vertex state, the value of the
3765bd8deadSopenharmony_ci    replacement code attribute is undefined after a vertex array
3775bd8deadSopenharmony_ci    command has been executed.
3785bd8deadSopenharmony_ci
3795bd8deadSopenharmony_ci    The following describes the memory layout of the new interleaved
3805bd8deadSopenharmony_ci    array types.  These new types may be used as the format parameter
3815bd8deadSopenharmony_ci    of the InterleavedArrays function.
3825bd8deadSopenharmony_ci
3835bd8deadSopenharmony_ci	format			pt	pc	pn	pv	s
3845bd8deadSopenharmony_ci	---------------------	------	------	------	------	------
3855bd8deadSopenharmony_ci	R1UI_V3F					i	i+3f
3865bd8deadSopenharmony_ci	R1UI_C4UB_V3F			i		i+c	i+c+3f
3875bd8deadSopenharmony_ci	R1UI_C3F_V3F			i		i+3f	i+6f
3885bd8deadSopenharmony_ci	R1UI_N3F_V3F				i	i+3f	i+6f
3895bd8deadSopenharmony_ci	R1UI_C4F_N3F_V3F		i	i+4f	i+7f	i+10f
3905bd8deadSopenharmony_ci	R1UI_T2F_V3F		i			i+2f	i+5f
3915bd8deadSopenharmony_ci	R1UI_T2F_N3F_V3F	i		i+2f	i+5f	i+8f
3925bd8deadSopenharmony_ci	R1UI_T2F_C4F_N3F_V3F	i	i+2f	i+6f	i+9f	i+12f
3935bd8deadSopenharmony_ci
3945bd8deadSopenharmony_ciWhere i is sizeof(UNSIGNED_INT) rounded up to the nearest multiple of
3955bd8deadSopenharmony_cif.  The replacement code pointer always starts at offset 0 from the
3965bd8deadSopenharmony_ciinterleaved array pointer.
3975bd8deadSopenharmony_ci
3985bd8deadSopenharmony_ci
3995bd8deadSopenharmony_ciAdditions to Chapter 3 of the GL Specification (Rasterization)
4005bd8deadSopenharmony_ci
4015bd8deadSopenharmony_ci    None
4025bd8deadSopenharmony_ci
4035bd8deadSopenharmony_ci
4045bd8deadSopenharmony_ciAdditions to Chapter 4 of the GL Specification (Per-Fragment Operations
4055bd8deadSopenharmony_ciand the Framebuffer)
4065bd8deadSopenharmony_ci
4075bd8deadSopenharmony_ci    None
4085bd8deadSopenharmony_ci
4095bd8deadSopenharmony_ci
4105bd8deadSopenharmony_ciAdditions to Chapter 5 of the GL Specification (Special Functions)
4115bd8deadSopenharmony_ci
4125bd8deadSopenharmony_ci    None
4135bd8deadSopenharmony_ci
4145bd8deadSopenharmony_ci
4155bd8deadSopenharmony_ciAdditions to Chapter 6 of the GL Specification (State and State Requests)
4165bd8deadSopenharmony_ci
4175bd8deadSopenharmony_ci    None
4185bd8deadSopenharmony_ci
4195bd8deadSopenharmony_ciAdditions to the GLX / WGL / AGL Specifications
4205bd8deadSopenharmony_ci 
4215bd8deadSopenharmony_ci     None
4225bd8deadSopenharmony_ci
4235bd8deadSopenharmony_ciGLX Protocol
4245bd8deadSopenharmony_ci
4255bd8deadSopenharmony_ci    Three rendering commands are sent to the server as part of
4265bd8deadSopenharmony_ci    the glXRender request:
4275bd8deadSopenharmony_ci
4285bd8deadSopenharmony_ci	ReplacementCodeuiSUN
4295bd8deadSopenharmony_ci	  2		8		rendering command length
4305bd8deadSopenharmony_ci	  2		16388		rendering command opcode
4315bd8deadSopenharmony_ci	  4		CARD32		code
4325bd8deadSopenharmony_ci
4335bd8deadSopenharmony_ci	ReplacementCodeubSUN
4345bd8deadSopenharmony_ci	  2		8		rendering command length
4355bd8deadSopenharmony_ci	  2		16389		rendering command opcode
4365bd8deadSopenharmony_ci	  1		CARD8		code
4375bd8deadSopenharmony_ci	  1		CARD8		pad
4385bd8deadSopenharmony_ci  	  2		CARD16		pad
4395bd8deadSopenharmony_ci
4405bd8deadSopenharmony_ci	ReplacementCodeusSUN
4415bd8deadSopenharmony_ci	  2		8		rendering command length
4425bd8deadSopenharmony_ci	  2		16390		rendering command opcode
4435bd8deadSopenharmony_ci	  2		CARD16		code
4445bd8deadSopenharmony_ci	  2		CARD16		pad
4455bd8deadSopenharmony_ci
4465bd8deadSopenharmony_ci
4475bd8deadSopenharmony_ciErrors
4485bd8deadSopenharmony_ci
4495bd8deadSopenharmony_ci    INVALID_ENUM is generated if ReplacementCodePointerSUN parameter
4505bd8deadSopenharmony_ci    <type> is not UNSIGNED_BYTE, UNSIGNED_SHORT, or UNSIGNED_INT.
4515bd8deadSopenharmony_ci
4525bd8deadSopenharmony_ci    INVALID_VALUE is generated if ReplacementCodePointerSUN parameter
4535bd8deadSopenharmony_ci    <stride> is negative.
4545bd8deadSopenharmony_ci
4555bd8deadSopenharmony_ci
4565bd8deadSopenharmony_ciNew State
4575bd8deadSopenharmony_ci
4585bd8deadSopenharmony_ci    Get Value				Get Command	Type	Initial Value
4595bd8deadSopenharmony_ci    ---------				-----------	----	-------------
4605bd8deadSopenharmony_ci    REPLACEMENT_CODE_SUN		GetIntegerv	Z4	REPLACE_OLDEST
4615bd8deadSopenharmony_ci    REPLACEMENT_CODE_ARRAY_SUN		IsEnabled	B	False
4625bd8deadSopenharmony_ci    REPLACEMENT_CODE_ARRAY_TYPE_SUN	GetIntegerv	Z3	UNSIGNED_INT
4635bd8deadSopenharmony_ci    REPLACEMENT_CODE_ARRAY_STRIDE_SUN	GetIntegerv	Z+	0
4645bd8deadSopenharmony_ci    REPLACEMENT_CODE_ARRAY_POINTER_SUN	GetPointerv	Y	0
4655bd8deadSopenharmony_ci
4665bd8deadSopenharmony_ci    Get Value				Attribute
4675bd8deadSopenharmony_ci    ---------				---------
4685bd8deadSopenharmony_ci    REPLACEMENT_CODE_SUN		current
4695bd8deadSopenharmony_ci    REPLACEMENT_CODE_ARRAY_SUN		vertex-array
4705bd8deadSopenharmony_ci    REPLACEMENT_CODE_ARRAY_TYPE_SUN	vertex-array
4715bd8deadSopenharmony_ci    REPLACEMENT_CODE_ARRAY_STRIDE_SUN	vertex-array
4725bd8deadSopenharmony_ci    REPLACEMENT_CODE_ARRAY_POINTER_SUN	vertex-array
4735bd8deadSopenharmony_ci
4745bd8deadSopenharmony_ciNew Implementation Dependent State
4755bd8deadSopenharmony_ci 
4765bd8deadSopenharmony_ci     None
4775bd8deadSopenharmony_ci
4785bd8deadSopenharmony_ciRevision History
4795bd8deadSopenharmony_ci    
4805bd8deadSopenharmony_ci    6/25/99 Added fields from the new extension template.
481