stw_pixelformat.c File Reference

Include dependency graph for stw_pixelformat.c:

Go to the source code of this file.

Defines

#define MAX_PIXELFORMATS   16

Functions

static void add_standard_pixelformats (struct pixelformat_info **ppf, uint flags)
void pixelformat_init (void)
uint pixelformat_get_count (void)
uint pixelformat_get_extended_count (void)
struct pixelformat_infopixelformat_get_info (uint index)

Variables

static struct pixelformat_info pixelformats [16]
static uint pixelformat_count = 0
static uint pixelformat_extended_count = 0


Define Documentation

#define MAX_PIXELFORMATS   16

Definition at line 31 of file stw_pixelformat.c.


Function Documentation

static void add_standard_pixelformats ( struct pixelformat_info **  ppf,
uint  flags 
) [static]

Definition at line 38 of file stw_pixelformat.c.

References pixelformat_info::alpha, pixelformat_info::color, pixelformat_info::depth, pixelformat_info::flags, and PF_FLAG_DOUBLEBUFFER.

00041 {
00042    struct pixelformat_info *pf = *ppf;
00043    struct pixelformat_color_info color24 = { 8, 0, 8, 8, 8, 16 };
00044    struct pixelformat_alpha_info alpha8 = { 8, 24 };
00045    struct pixelformat_alpha_info noalpha = { 0, 0 };
00046    struct pixelformat_depth_info depth24s8 = { 24, 8 };
00047    struct pixelformat_depth_info depth16 = { 16, 0 };
00048 
00049    pf->flags = PF_FLAG_DOUBLEBUFFER | flags;
00050    pf->color = color24;
00051    pf->alpha = alpha8;
00052    pf->depth = depth16;
00053    pf++;
00054 
00055    pf->flags = PF_FLAG_DOUBLEBUFFER | flags;
00056    pf->color = color24;
00057    pf->alpha = alpha8;
00058    pf->depth = depth24s8;
00059    pf++;
00060 
00061    pf->flags = PF_FLAG_DOUBLEBUFFER | flags;
00062    pf->color = color24;
00063    pf->alpha = noalpha;
00064    pf->depth = depth16;
00065    pf++;
00066 
00067    pf->flags = PF_FLAG_DOUBLEBUFFER | flags;
00068    pf->color = color24;
00069    pf->alpha = noalpha;
00070    pf->depth = depth24s8;
00071    pf++;
00072 
00073    pf->flags = flags;
00074    pf->color = color24;
00075    pf->alpha = noalpha;
00076    pf->depth = depth16;
00077    pf++;
00078 
00079    pf->flags = flags;
00080    pf->color = color24;
00081    pf->alpha = noalpha;
00082    pf->depth = depth24s8;
00083    pf++;
00084 
00085    *ppf = pf;
00086 }

uint pixelformat_get_count ( void   ) 

Definition at line 103 of file stw_pixelformat.c.

References pixelformat_count.

00104 {
00105    return pixelformat_count;
00106 }

uint pixelformat_get_extended_count ( void   ) 

Definition at line 109 of file stw_pixelformat.c.

References pixelformat_extended_count.

00110 {
00111    return pixelformat_extended_count;
00112 }

struct pixelformat_info* pixelformat_get_info ( uint  index  )  [read]

Definition at line 115 of file stw_pixelformat.c.

References assert, pixelformat_extended_count, and pixelformats.

00116 {
00117    assert( index < pixelformat_extended_count );
00118 
00119    return &pixelformats[index];
00120 }

void pixelformat_init ( void   ) 

Definition at line 89 of file stw_pixelformat.c.

References add_standard_pixelformats(), assert, MAX_PIXELFORMATS, PF_FLAG_MULTISAMPLED, pixelformat_count, pixelformat_extended_count, and pixelformats.

00090 {
00091    struct pixelformat_info *pf = pixelformats;
00092 
00093    add_standard_pixelformats( &pf, 0 );
00094    pixelformat_count = pf - pixelformats;
00095 
00096    add_standard_pixelformats( &pf, PF_FLAG_MULTISAMPLED );
00097    pixelformat_extended_count = pf - pixelformats;
00098 
00099    assert( pixelformat_extended_count <= MAX_PIXELFORMATS );
00100 }


Variable Documentation

uint pixelformat_count = 0 [static]

Definition at line 34 of file stw_pixelformat.c.

uint pixelformat_extended_count = 0 [static]

Definition at line 35 of file stw_pixelformat.c.

struct pixelformat_info pixelformats[16] [static]

Definition at line 33 of file stw_pixelformat.c.


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