stw_winsys.h File Reference

Include dependency graph for stw_winsys.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  stw_winsys

Functions

boolean st_init (const struct stw_winsys *stw_winsys)
void st_cleanup (void)


Function Documentation

void st_cleanup ( void   ) 

Definition at line 67 of file stw_device.c.

References stw_device::ctx_array, DRV_CONTEXT_MAX, DrvDeleteContext(), and drv_context::hglrc.

00068 {
00069    DHGLRC dhglrc;
00070 
00071    if(!stw_dev)
00072       return;
00073 
00074    /* Ensure all contexts are destroyed */
00075    for (dhglrc = 1; dhglrc <= DRV_CONTEXT_MAX; dhglrc++)
00076       if (stw_dev->ctx_array[dhglrc - 1].hglrc)
00077          DrvDeleteContext( dhglrc );
00078 
00079    stw_dev = NULL;
00080 }

boolean st_init ( const struct stw_winsys stw_winsys  ) 

Definition at line 41 of file stw_device.c.

References assert, stw_winsys::create_screen, FALSE, pixelformat_init(), stw_device::screen, stw_device::stw_winsys, and TRUE.

00042 {
00043    static struct stw_device stw_dev_storage;
00044 
00045    assert(!stw_dev);
00046 
00047    stw_dev = &stw_dev_storage;
00048    memset(stw_dev, 0, sizeof(*stw_dev));
00049 
00050    stw_dev->stw_winsys = stw_winsys;
00051 
00052    stw_dev->screen = stw_winsys->create_screen();
00053    if(!stw_dev->screen)
00054       goto error1;
00055 
00056    pixelformat_init();
00057 
00058    return TRUE;
00059 
00060 error1:
00061    stw_dev = NULL;
00062    return FALSE;
00063 }


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