diff options
Diffstat (limited to 'src/mesa/drivers/windows/wgl.c')
-rw-r--r-- | src/mesa/drivers/windows/wgl.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/mesa/drivers/windows/wgl.c b/src/mesa/drivers/windows/wgl.c index 0db57641fe1..62a4c1704ce 100644 --- a/src/mesa/drivers/windows/wgl.c +++ b/src/mesa/drivers/windows/wgl.c @@ -1,4 +1,4 @@ -/* $Id: wgl.c,v 1.9 2001/09/18 16:39:38 kschultz Exp $ */ +/* $Id: wgl.c,v 1.10 2002/04/23 18:23:33 kschultz Exp $ */ /* * This library is free software; you can redistribute it and/or @@ -100,6 +100,7 @@ int qt_ext = sizeof(ext) / sizeof(ext[0]); struct __pixelformat__ pix[] = { + /* Double Buffer, alpha */ { { sizeof(PIXELFORMATDESCRIPTOR), 1, PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|PFD_GENERIC_FORMAT|PFD_DOUBLEBUFFER|PFD_SWAP_COPY, PFD_TYPE_RGBA, @@ -107,6 +108,7 @@ struct __pixelformat__ pix[] = 0, 0, 0, 0, 0, 16, 8, 0, 0, 0, 0, 0, 0 }, GL_TRUE }, + /* Single Buffer, alpha */ { { sizeof(PIXELFORMATDESCRIPTOR), 1, PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|PFD_GENERIC_FORMAT, PFD_TYPE_RGBA, @@ -114,6 +116,22 @@ struct __pixelformat__ pix[] = 0, 0, 0, 0, 0, 16, 8, 0, 0, 0, 0, 0, 0 }, GL_FALSE }, + /* Double Buffer, no alpha */ + { { sizeof(PIXELFORMATDESCRIPTOR), 1, + PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|PFD_GENERIC_FORMAT|PFD_DOUBLEBUFFER|PFD_SWAP_COPY, + PFD_TYPE_RGBA, + 24, 8, 0, 8, 8, 8, 16, 0, 0, + 0, 0, 0, 0, 0, 16, 8, 0, 0, 0, 0, 0, 0 }, + GL_TRUE + }, + /* Single Buffer, no alpha */ + { { sizeof(PIXELFORMATDESCRIPTOR), 1, + PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|PFD_GENERIC_FORMAT, + PFD_TYPE_RGBA, + 24, 8, 0, 8, 8, 8, 16, 0, 0, + 0, 0, 0, 0, 0, 16, 8, 0, 0, 0, 0, 0, 0 }, + GL_FALSE + }, }; int qt_pix = sizeof(pix) / sizeof(pix[0]); @@ -158,7 +176,8 @@ WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC hdc) if ( wgl_ctx[i].ctx == NULL ) { wgl_ctx[i].ctx = WMesaCreateContext( hWnd, NULL, GL_TRUE, - pix[curPFD-1].doubleBuffered ); + pix[curPFD-1].doubleBuffered, + pix[curPFD-1].pfd.cAlphaBits ? GL_TRUE : GL_FALSE); if (wgl_ctx[i].ctx == NULL) break; wgl_ctx[i].hdc = hdc; @@ -559,6 +578,8 @@ WGLAPI int GLAPIENTRY wglChoosePixelFormat(HDC hdc, continue; if(ppfd->iPixelType != pix[i].pfd.iPixelType) delta++; + if(ppfd->cAlphaBits != pix[i].pfd.cAlphaBits) + delta++; if(delta < bestdelta) { best = i + 1; |