draw_pt_util.c File Reference

Include dependency graph for draw_pt_util.c:

Go to the source code of this file.

Functions

void draw_pt_split_prim (unsigned prim, unsigned *first, unsigned *incr)
unsigned draw_pt_reduced_prim (unsigned prim)


Function Documentation

unsigned draw_pt_reduced_prim ( unsigned  prim  ) 

Definition at line 80 of file draw_pt_util.c.

References assert, PIPE_PRIM_LINE_LOOP, PIPE_PRIM_LINE_STRIP, PIPE_PRIM_LINES, PIPE_PRIM_POINTS, PIPE_PRIM_POLYGON, PIPE_PRIM_QUAD_STRIP, PIPE_PRIM_QUADS, PIPE_PRIM_TRIANGLE_FAN, PIPE_PRIM_TRIANGLE_STRIP, and PIPE_PRIM_TRIANGLES.

00081 {
00082    switch (prim) {
00083    case PIPE_PRIM_POINTS:
00084       return PIPE_PRIM_POINTS;
00085    case PIPE_PRIM_LINES:
00086    case PIPE_PRIM_LINE_STRIP:
00087    case PIPE_PRIM_LINE_LOOP:
00088       return PIPE_PRIM_LINES;
00089    case PIPE_PRIM_TRIANGLES:
00090    case PIPE_PRIM_TRIANGLE_STRIP:
00091    case PIPE_PRIM_TRIANGLE_FAN:
00092    case PIPE_PRIM_POLYGON:
00093    case PIPE_PRIM_QUADS:
00094    case PIPE_PRIM_QUAD_STRIP:
00095       return PIPE_PRIM_TRIANGLES;
00096    default:
00097       assert(0);
00098       return PIPE_PRIM_POINTS;
00099    }
00100 }

void draw_pt_split_prim ( unsigned  prim,
unsigned *  first,
unsigned *  incr 
)

Definition at line 37 of file draw_pt_util.c.

References assert, PIPE_PRIM_LINE_LOOP, PIPE_PRIM_LINE_STRIP, PIPE_PRIM_LINES, PIPE_PRIM_POINTS, PIPE_PRIM_POLYGON, PIPE_PRIM_QUAD_STRIP, PIPE_PRIM_QUADS, PIPE_PRIM_TRIANGLE_FAN, PIPE_PRIM_TRIANGLE_STRIP, and PIPE_PRIM_TRIANGLES.

00038 {
00039    switch (prim) {
00040    case PIPE_PRIM_POINTS:
00041       *first = 1;
00042       *incr = 1;
00043       break;
00044    case PIPE_PRIM_LINES:
00045       *first = 2;
00046       *incr = 2;
00047       break;
00048    case PIPE_PRIM_LINE_STRIP:
00049    case PIPE_PRIM_LINE_LOOP:
00050       *first = 2;
00051       *incr = 1;
00052       break;
00053    case PIPE_PRIM_TRIANGLES:
00054       *first = 3;
00055       *incr = 3;
00056       break;
00057    case PIPE_PRIM_TRIANGLE_STRIP:
00058    case PIPE_PRIM_TRIANGLE_FAN:
00059    case PIPE_PRIM_POLYGON:
00060       *first = 3;
00061       *incr = 1;
00062       break;
00063    case PIPE_PRIM_QUADS:
00064       *first = 4;
00065       *incr = 4;
00066       break;
00067    case PIPE_PRIM_QUAD_STRIP:
00068       *first = 4;
00069       *incr = 2;
00070       break;
00071    default:
00072       assert(0);
00073       *first = 0;
00074       *incr = 1;                /* set to one so that count % incr works */
00075       break;
00076    }
00077 }


Generated on Tue Sep 29 06:25:21 2009 for Gallium3D by  doxygen 1.5.4