summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/glide/fxwgl.c
diff options
context:
space:
mode:
authorDaniel Borca <dborca@users.sourceforge.net>2004-01-23 15:57:52 +0000
committerDaniel Borca <dborca@users.sourceforge.net>2004-01-23 15:57:52 +0000
commit3d06dc75816ef7f1c6e2c3f24a98dd2934c4c385 (patch)
tree74e43e286b3d3d947e58f73bd0a69b4a6d4aeaaf /src/mesa/drivers/glide/fxwgl.c
parent3abf746a7eae52220485cd031aecec2ca9e6103e (diff)
accomodated new driver_func initialization
added DMesaGetProcAddress some other minor fixes updated documentation
Diffstat (limited to 'src/mesa/drivers/glide/fxwgl.c')
-rw-r--r--src/mesa/drivers/glide/fxwgl.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/mesa/drivers/glide/fxwgl.c b/src/mesa/drivers/glide/fxwgl.c
index adf88a485c..ae1d913f3b 100644
--- a/src/mesa/drivers/glide/fxwgl.c
+++ b/src/mesa/drivers/glide/fxwgl.c
@@ -218,7 +218,6 @@ struct __pixelformat__ pix[] = {
FXMESA_NONE}
}
};
-static int qt_pix = sizeof(pix) / sizeof(pix[0]);
static fxMesaContext ctx = NULL;
static WNDPROC hWNDOldProc;
@@ -676,6 +675,14 @@ wglSwapLayerBuffers(HDC hdc, UINT fuPlanes)
return (FALSE);
}
+static int pfd_tablen (void)
+{
+ /* we should take an envvar for `fxMesaSelectCurrentBoard' */
+ return (fxMesaSelectCurrentBoard(0) < GR_SSTTYPE_Voodoo4)
+ ? 2 /* only 16bit entries */
+ : sizeof(pix) / sizeof(pix[0]); /* full table */
+}
+
GLAPI int GLAPIENTRY
wglChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR * ppfd)
{
@@ -723,7 +730,7 @@ wglChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR * ppfd)
}
#endif
- qt_valid_pix = qt_pix;
+ qt_valid_pix = pfd_tablen();
if (ppfd->nSize != sizeof(PIXELFORMATDESCRIPTOR) || ppfd->nVersion != 1) {
SetLastError(0);
@@ -787,7 +794,7 @@ wglDescribePixelFormat(HDC hdc, int iPixelFormat, UINT nBytes,
{
int qt_valid_pix;
- qt_valid_pix = qt_pix;
+ qt_valid_pix = pfd_tablen();
if (iPixelFormat < 1 || iPixelFormat > qt_valid_pix ||
((nBytes != sizeof(PIXELFORMATDESCRIPTOR)) && (nBytes != 0))) {
@@ -830,7 +837,7 @@ wglSetPixelFormat(HDC hdc, int iPixelFormat, const PIXELFORMATDESCRIPTOR * ppfd)
{
int qt_valid_pix;
- qt_valid_pix = qt_pix;
+ qt_valid_pix = pfd_tablen();
if (iPixelFormat < 1 || iPixelFormat > qt_valid_pix) {
if (ppfd == NULL) {