draw_pt_elts.c File Reference

Include dependency graph for draw_pt_elts.c:

Go to the source code of this file.

Functions

static unsigned elt_uint (const void *elts, unsigned idx)
static unsigned elt_ushort (const void *elts, unsigned idx)
static unsigned elt_ubyte (const void *elts, unsigned idx)
static unsigned elt_vert (const void *elts, unsigned idx)
pt_elt_func draw_pt_elt_func (struct draw_context *draw)
const void * draw_pt_elt_ptr (struct draw_context *draw, unsigned start)


Function Documentation

pt_elt_func draw_pt_elt_func ( struct draw_context draw  ) 

Definition at line 60 of file draw_pt_elts.c.

References elt_ubyte(), elt_uint(), elt_ushort(), elt_vert(), draw_context::pt, and draw_context::user.

00061 {
00062    switch (draw->pt.user.eltSize) {
00063    case 0: return &elt_vert;
00064    case 1: return &elt_ubyte;
00065    case 2: return &elt_ushort; 
00066    case 4: return &elt_uint;
00067    default: return NULL;
00068    }
00069 }     

const void* draw_pt_elt_ptr ( struct draw_context draw,
unsigned  start 
)

Definition at line 71 of file draw_pt_elts.c.

References draw_context::pt, and draw_context::user.

00073 {
00074    const char *elts = draw->pt.user.elts;
00075 
00076    switch (draw->pt.user.eltSize) {
00077    case 0: 
00078       return (const void *)(((const ubyte *)NULL) + start);
00079    case 1: 
00080       return (const void *)(((const ubyte *)elts) + start);
00081    case 2: 
00082       return (const void *)(((const ushort *)elts) + start);
00083    case 4: 
00084       return (const void *)(((const uint *)elts) + start);
00085    default:
00086       return NULL;
00087    }
00088 }

static unsigned elt_ubyte ( const void *  elts,
unsigned  idx 
) [static]

Definition at line 50 of file draw_pt_elts.c.

00051 {
00052    return *(((const ubyte *)elts) + idx);
00053 }

static unsigned elt_uint ( const void *  elts,
unsigned  idx 
) [static]

Definition at line 40 of file draw_pt_elts.c.

00041 {
00042    return *(((const uint *)elts) + idx);
00043 }

static unsigned elt_ushort ( const void *  elts,
unsigned  idx 
) [static]

Definition at line 45 of file draw_pt_elts.c.

00046 {
00047    return *(((const ushort *)elts) + idx);
00048 }

static unsigned elt_vert ( const void *  elts,
unsigned  idx 
) [static]

Definition at line 55 of file draw_pt_elts.c.

00056 {
00057    return (const ubyte *)elts - (const ubyte *)NULL + idx;
00058 }


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