#define STW_DEVICE_H_
+#include <windows.h>
+
#include "pipe/p_compiler.h"
#include "pipe/p_thread.h"
#include "util/u_handle_table.h"
+#include "stw_pixelformat.h"
+
+
+#define STW_MAX_PIXELFORMATS 16
struct pipe_screen;
#ifdef DEBUG
boolean trace_running;
#endif
-
+
+ struct stw_pixelformat_info pixelformats[STW_MAX_PIXELFORMATS];
+ unsigned pixelformat_count;
+ unsigned pixelformat_extended_count;
+
pipe_mutex mutex;
struct handle_table *ctx_table;
**************************************************************************/
#include "util/u_debug.h"
+
+#include "stw_device.h"
#include "stw_pixelformat.h"
#include "stw_public.h"
#include "stw_tls.h"
-#define STW_MAX_PIXELFORMATS 16
-
-static struct stw_pixelformat_info stw_pixelformats[STW_MAX_PIXELFORMATS];
-static uint stw_pixelformat_count = 0;
-static uint stw_pixelformat_extended_count = 0;
-
static void
stw_add_standard_pixelformats(
void
stw_pixelformat_init( void )
{
- struct stw_pixelformat_info *pf = stw_pixelformats;
+ struct stw_pixelformat_info *pf = stw_dev->pixelformats;
stw_add_standard_pixelformats( &pf, 0 );
- stw_pixelformat_count = pf - stw_pixelformats;
+ stw_dev->pixelformat_count = pf - stw_dev->pixelformats;
stw_add_standard_pixelformats( &pf, STW_PF_FLAG_MULTISAMPLED );
- stw_pixelformat_extended_count = pf - stw_pixelformats;
+ stw_dev->pixelformat_extended_count = pf - stw_dev->pixelformats;
- assert( stw_pixelformat_extended_count <= STW_MAX_PIXELFORMATS );
+ assert( stw_dev->pixelformat_extended_count <= STW_MAX_PIXELFORMATS );
}
uint
stw_pixelformat_get_count( void )
{
- return stw_pixelformat_count;
+ return stw_dev->pixelformat_count;
}
uint
stw_pixelformat_get_extended_count( void )
{
- return stw_pixelformat_extended_count;
+ return stw_dev->pixelformat_extended_count;
}
const struct stw_pixelformat_info *
stw_pixelformat_get_info( uint index )
{
- assert( index < stw_pixelformat_extended_count );
+ assert( index < stw_dev->pixelformat_extended_count );
- return &stw_pixelformats[index];
+ return &stw_dev->pixelformats[index];
}
*
**************************************************************************/
-#ifndef PIXELFORMAT_H
-#define PIXELFORMAT_H
+#ifndef STW_PIXELFORMAT_H
+#define STW_PIXELFORMAT_H
#include <windows.h>
+
#include "pipe/p_compiler.h"
#define STW_PF_FLAG_DOUBLEBUFFER 0x00000001
int stw_query_samples( void );
-#endif /* PIXELFORMAT_H */
+#endif /* STW_PIXELFORMAT_H */