*
**************************************************************************/
-#ifndef WGL_ARBEXTENSIONSSTRING_H
-#define WGL_ARBEXTENSIONSSTRING_H
+#ifndef STW_ARBEXTENSIONSSTRING_H
+#define STW_ARBEXTENSIONSSTRING_H
WINGDIAPI const char * APIENTRY
wglGetExtensionsStringARB(
HDC hdc );
-#endif /* WGL_ARBEXTENSIONSSTRING_H */
+#endif /* STW_ARBEXTENSIONSSTRING_H */
{
uint count;
uint index;
- const struct pixelformat_info *pf;
+ const struct stw_pixelformat_info *pf;
- count = pixelformat_get_extended_count();
+ count = stw_pixelformat_get_extended_count();
if (attrib == WGL_NUMBER_PIXEL_FORMATS_ARB) {
*pvalue = (int) count;
if (index >= count)
return FALSE;
- pf = pixelformat_get_info( index );
+ pf = stw_pixelformat_get_info( index );
switch (attrib) {
case WGL_DRAW_TO_WINDOW_ARB:
{ WGL_SAMPLES_ARB, 2, FALSE }
};
-struct pixelformat_score
+struct stw_pixelformat_score
{
int points;
uint index;
static BOOL
score_pixelformats(
- struct pixelformat_score *scores,
+ struct stw_pixelformat_score *scores,
uint count,
int attribute,
int expected_value )
UINT *nNumFormats )
{
uint count;
- struct pixelformat_score *scores;
+ struct stw_pixelformat_score *scores;
uint i;
*nNumFormats = 0;
* points for a mismatch when the match does not have to be exact.
* Set a score to 0 if there is a mismatch for an exact match criteria.
*/
- count = pixelformat_get_extended_count();
- scores = (struct pixelformat_score *) MALLOC( count * sizeof( struct pixelformat_score ) );
+ count = stw_pixelformat_get_extended_count();
+ scores = (struct stw_pixelformat_score *) MALLOC( count * sizeof( struct stw_pixelformat_score ) );
if (scores == NULL)
return FALSE;
for (i = 0; i < count; i++) {
swapped = FALSE;
for (i = 1; i < n; i++) {
if (scores[i - 1].points < scores[i].points) {
- struct pixelformat_score score = scores[i - 1];
+ struct stw_pixelformat_score score = scores[i - 1];
scores[i - 1] = scores[i];
scores[i] = score;
*
**************************************************************************/
-#ifndef WGL_ARBPIXELFORMAT_H
-#define WGL_ARBPIXELFORMAT_H
+#ifndef STW_ARBPIXELFORMAT_H
+#define STW_ARBPIXELFORMAT_H
/* Extension functions for get_proc_address:
const int *piAttributes,
int *piValues );
-#endif /* WGL_ARBPIXELFORMAT_H */
+#endif /* STW_ARBPIXELFORMAT_H */
int iLayerPlane )
{
uint pfi;
- const struct pixelformat_info *pf = NULL;
+ const struct stw_pixelformat_info *pf = NULL;
struct stw_context *ctx = NULL;
GLvisual *visual = NULL;
struct pipe_screen *screen = NULL;
if (pfi == 0)
return 0;
- pf = pixelformat_get_info( pfi - 1 );
+ pf = stw_pixelformat_get_info( pfi - 1 );
ctx = CALLOC_STRUCT( stw_context );
if (ctx == NULL)
if (glcurctx == glctx)
st_make_current( NULL, NULL, NULL );
- fb = framebuffer_from_hdc( ctx->hdc );
+ fb = stw_framebuffer_from_hdc( ctx->hdc );
if (fb)
- framebuffer_destroy( fb );
+ stw_framebuffer_destroy( fb );
if (WindowFromDC( ctx->hdc ) != NULL)
ReleaseDC( WindowFromDC( ctx->hdc ), ctx->hdc );
/* Find the width and height of the window named by hdc.
*/
static void
-get_window_size( HDC hdc, GLuint *width, GLuint *height )
+stw_get_window_size( HDC hdc, GLuint *width, GLuint *height )
{
if (WindowFromDC( hdc )) {
RECT rect;
return TRUE;
}
- fb = framebuffer_from_hdc( hdc );
+ fb = stw_framebuffer_from_hdc( hdc );
if (hdc != NULL)
- get_window_size( hdc, &width, &height );
+ stw_get_window_size( hdc, &width, &height );
- /* Lazy creation of framebuffers.
+ /* Lazy creation of stw_framebuffers.
*/
if (fb == NULL && ctx != NULL && hdc != NULL) {
GLvisual *visual = &ctx->st->ctx->Visual;
- fb = framebuffer_create( hdc, visual, width, height );
+ fb = stw_framebuffer_create( hdc, visual, width, height );
if (fb == NULL)
return FALSE;
}
if (ctx && fb) {
st_make_current( ctx->st, fb->stfb, fb->stfb );
- framebuffer_resize( fb, width, height );
+ stw_framebuffer_resize( fb, width, height );
ctx->hdc = hdc;
ctx->st->pipe->priv = hdc;
}
goto error1;
}
- pixelformat_init();
+ stw_pixelformat_init();
return TRUE;
void
-framebuffer_resize(
+stw_framebuffer_resize(
struct stw_framebuffer *fb,
GLuint width,
GLuint height )
static struct stw_framebuffer *fb_head = NULL;
static LRESULT CALLBACK
-window_proc(
+stw_window_proc(
HWND hWnd,
UINT uMsg,
WPARAM wParam,
assert( fb != NULL );
if (uMsg == WM_SIZE && wParam != SIZE_MINIMIZED)
- framebuffer_resize( fb, LOWORD( lParam ), HIWORD( lParam ) );
+ stw_framebuffer_resize( fb, LOWORD( lParam ), HIWORD( lParam ) );
return CallWindowProc( fb->WndProc, hWnd, uMsg, wParam, lParam );
}
/* Create a new framebuffer object which will correspond to the given HDC.
*/
struct stw_framebuffer *
-framebuffer_create(
+stw_framebuffer_create(
HDC hdc,
GLvisual *visual,
GLuint width,
fb->WndProc = (WNDPROC) SetWindowLongPtr(
fb->hWnd,
GWLP_WNDPROC,
- (LONG_PTR) window_proc );
+ (LONG_PTR) stw_window_proc );
}
fb->next = fb_head;
}
void
-framebuffer_destroy(
+stw_framebuffer_destroy(
struct stw_framebuffer *fb )
{
struct stw_framebuffer **link = &fb_head;
/* Given an hdc, return the corresponding stw_framebuffer.
*/
struct stw_framebuffer *
-framebuffer_from_hdc(
+stw_framebuffer_from_hdc(
HDC hdc )
{
struct stw_framebuffer *fb;
struct pipe_screen *screen;
struct pipe_surface *surface;
- fb = framebuffer_from_hdc( hdc );
+ fb = stw_framebuffer_from_hdc( hdc );
if (fb == NULL)
return FALSE;
#include "main/mtypes.h"
-/* Windows framebuffer, derived from gl_framebuffer.
+/**
+ * Windows framebuffer, derived from gl_framebuffer.
*/
struct stw_framebuffer
{
};
struct stw_framebuffer *
-framebuffer_create(
+stw_framebuffer_create(
HDC hdc,
GLvisual *visual,
GLuint width,
GLuint height );
void
-framebuffer_destroy(
+stw_framebuffer_destroy(
struct stw_framebuffer *fb );
void
-framebuffer_resize(
+stw_framebuffer_resize(
struct stw_framebuffer *fb,
GLuint width,
GLuint height );
struct stw_framebuffer *
-framebuffer_from_hdc(
+stw_framebuffer_from_hdc(
HDC hdc );
#endif /* STW_FRAMEBUFFER_H */
#include "stw_arbpixelformat.h"
#include "stw_public.h"
-struct extension_entry
+struct stw_extension_entry
{
const char *name;
PROC proc;
};
-#define EXTENTRY(P) { #P, (PROC) P }
+#define STW_EXTENSION_ENTRY(P) { #P, (PROC) P }
-static const struct extension_entry extension_entries[] = {
+static const struct stw_extension_entry stw_extension_entries[] = {
/* WGL_ARB_extensions_string */
- EXTENTRY( wglGetExtensionsStringARB ),
+ STW_EXTENSION_ENTRY( wglGetExtensionsStringARB ),
/* WGL_ARB_pixel_format */
- EXTENTRY( wglChoosePixelFormatARB ),
- EXTENTRY( wglGetPixelFormatAttribfvARB ),
- EXTENTRY( wglGetPixelFormatAttribivARB ),
+ STW_EXTENSION_ENTRY( wglChoosePixelFormatARB ),
+ STW_EXTENSION_ENTRY( wglGetPixelFormatAttribfvARB ),
+ STW_EXTENSION_ENTRY( wglGetPixelFormatAttribivARB ),
{ NULL, NULL }
};
stw_get_proc_address(
LPCSTR lpszProc )
{
- const struct extension_entry *entry;
+ const struct stw_extension_entry *entry;
PROC p = (PROC) _glapi_get_proc_address( lpszProc );
if (p)
return p;
- for (entry = extension_entries; entry->name; entry++)
+ for (entry = stw_extension_entries; entry->name; entry++)
if (strcmp( lpszProc, entry->name ) == 0)
return entry->proc;
#include "stw_public.h"
#include "stw_tls.h"
-#define MAX_PIXELFORMATS 16
+#define STW_MAX_PIXELFORMATS 16
-static struct pixelformat_info pixelformats[MAX_PIXELFORMATS];
-static uint pixelformat_count = 0;
-static uint pixelformat_extended_count = 0;
+static struct stw_pixelformat_info pixelformats[STW_MAX_PIXELFORMATS];
+static uint stw_pixelformat_count = 0;
+static uint stw_pixelformat_extended_count = 0;
static void
add_standard_pixelformats(
- struct pixelformat_info **ppf,
+ struct stw_pixelformat_info **ppf,
uint flags )
{
- struct pixelformat_info *pf = *ppf;
- struct pixelformat_color_info color24 = { 8, 0, 8, 8, 8, 16 };
- struct pixelformat_alpha_info alpha8 = { 8, 24 };
- struct pixelformat_alpha_info noalpha = { 0, 0 };
- struct pixelformat_depth_info depth24s8 = { 24, 8 };
- struct pixelformat_depth_info depth16 = { 16, 0 };
+ struct stw_pixelformat_info *pf = *ppf;
+ struct stw_pixelformat_color_info color24 = { 8, 0, 8, 8, 8, 16 };
+ struct stw_pixelformat_alpha_info alpha8 = { 8, 24 };
+ struct stw_pixelformat_alpha_info noalpha = { 0, 0 };
+ struct stw_pixelformat_depth_info depth24s8 = { 24, 8 };
+ struct stw_pixelformat_depth_info depth16 = { 16, 0 };
pf->flags = PF_FLAG_DOUBLEBUFFER | flags;
pf->color = color24;
}
void
-pixelformat_init( void )
+stw_pixelformat_init( void )
{
- struct pixelformat_info *pf = pixelformats;
+ struct stw_pixelformat_info *pf = pixelformats;
add_standard_pixelformats( &pf, 0 );
- pixelformat_count = pf - pixelformats;
+ stw_pixelformat_count = pf - pixelformats;
add_standard_pixelformats( &pf, PF_FLAG_MULTISAMPLED );
- pixelformat_extended_count = pf - pixelformats;
+ stw_pixelformat_extended_count = pf - pixelformats;
- assert( pixelformat_extended_count <= MAX_PIXELFORMATS );
+ assert( stw_pixelformat_extended_count <= STW_MAX_PIXELFORMATS );
}
uint
-pixelformat_get_count( void )
+stw_pixelformat_get_count( void )
{
- return pixelformat_count;
+ return stw_pixelformat_count;
}
uint
-pixelformat_get_extended_count( void )
+stw_pixelformat_get_extended_count( void )
{
- return pixelformat_extended_count;
+ return stw_pixelformat_extended_count;
}
-const struct pixelformat_info *
-pixelformat_get_info( uint index )
+const struct stw_pixelformat_info *
+stw_pixelformat_get_info( uint index )
{
- assert( index < pixelformat_extended_count );
+ assert( index < stw_pixelformat_extended_count );
return &pixelformats[index];
}
{
uint count;
uint index;
- const struct pixelformat_info *pf;
+ const struct stw_pixelformat_info *pf;
(void) hdc;
- count = pixelformat_get_extended_count();
+ count = stw_pixelformat_get_extended_count();
index = (uint) iPixelFormat - 1;
if (ppfd == NULL)
if (index >= count || nBytes != sizeof( PIXELFORMATDESCRIPTOR ))
return 0;
- pf = pixelformat_get_info( index );
+ pf = stw_pixelformat_get_info( index );
ppfd->nSize = sizeof( PIXELFORMATDESCRIPTOR );
ppfd->nVersion = 1;
(void) hdc;
- count = pixelformat_get_count();
+ count = stw_pixelformat_get_count();
bestindex = count;
bestdelta = 0xffffffff;
for (index = 0; index < count; index++) {
uint delta = 0;
- const struct pixelformat_info *pf = pixelformat_get_info( index );
+ const struct stw_pixelformat_info *pf = stw_pixelformat_get_info( index );
if (!(ppfd->dwFlags & PFD_DOUBLEBUFFER_DONTCARE) &&
!!(ppfd->dwFlags & PFD_DOUBLEBUFFER) !=
(void) hdc;
index = (uint) iPixelFormat - 1;
- count = pixelformat_get_extended_count();
+ count = stw_pixelformat_get_extended_count();
if (index >= count)
return FALSE;
#define PF_FLAG_DOUBLEBUFFER 0x00000001
#define PF_FLAG_MULTISAMPLED 0x00000002
-struct pixelformat_color_info
+struct stw_pixelformat_color_info
{
uint redbits;
uint redshift;
uint blueshift;
};
-struct pixelformat_alpha_info
+struct stw_pixelformat_alpha_info
{
uint alphabits;
uint alphashift;
};
-struct pixelformat_depth_info
+struct stw_pixelformat_depth_info
{
uint depthbits;
uint stencilbits;
};
-struct pixelformat_info
+struct stw_pixelformat_info
{
uint flags;
- struct pixelformat_color_info color;
- struct pixelformat_alpha_info alpha;
- struct pixelformat_depth_info depth;
+ struct stw_pixelformat_color_info color;
+ struct stw_pixelformat_alpha_info alpha;
+ struct stw_pixelformat_depth_info depth;
};
void
-pixelformat_init( void );
+stw_pixelformat_init( void );
uint
-pixelformat_get_count( void );
+stw_pixelformat_get_count( void );
uint
-pixelformat_get_extended_count( void );
+stw_pixelformat_get_extended_count( void );
-const struct pixelformat_info *
-pixelformat_get_info( uint index );
+const struct stw_pixelformat_info *
+stw_pixelformat_get_info( uint index );
int stw_query_sample_buffers( void );
int stw_query_samples( void );