summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/glide/fxwgl.c
diff options
context:
space:
mode:
authorDaniel Borca <[email protected]>2003-12-10 15:24:49 +0000
committerDaniel Borca <[email protected]>2003-12-10 15:24:49 +0000
commit28442852978e8ca0bcc5fda6393fc7b94fcf2bbf (patch)
treefb627fe1aea1faccf98d34316041aa925a56115a /src/mesa/drivers/glide/fxwgl.c
parent43be8ee414369f2745de0cf936f9767ee31df991 (diff)
got rid of __FUNCTION__ :(
Texus2 functions are dynamically linked now made getRegistryOrEnvironmentString more portable bugfix: unnecessary total SW fallback -- glColorMask bugfix: when shared palette was not loaded correctly point_attenuation_stage back in business (point size/atten) fxTexGetInfo is not required for fxIsTexSupported fxDDChooseTextureFormat optimized for RGB/RGBA textures accelerated Quads with Triangle_Fans more WGL extensions/functions (also updated export file) DXTC/S3TC -> FXT1 wrapping hack quick & dirty fix for Quake2
Diffstat (limited to 'src/mesa/drivers/glide/fxwgl.c')
-rw-r--r--src/mesa/drivers/glide/fxwgl.c80
1 files changed, 79 insertions, 1 deletions
diff --git a/src/mesa/drivers/glide/fxwgl.c b/src/mesa/drivers/glide/fxwgl.c
index 4609880f8d3..2de4e1a0d74 100644
--- a/src/mesa/drivers/glide/fxwgl.c
+++ b/src/mesa/drivers/glide/fxwgl.c
@@ -26,6 +26,8 @@
* David Bucciarelli
* Brian Paul
* Keith Whitwell
+ * Hiroshi Morii
+ * Daniel Borca
*/
/* fxwgl.c - Microsoft wgl functions emulation for
@@ -400,14 +402,83 @@ wglGetCurrentDC(VOID)
return (NULL);
}
+GLAPI BOOL GLAPIENTRY
+wglSwapIntervalEXT (int interval)
+{
+ if (ctx == NULL) {
+ return FALSE;
+ }
+ if (interval < 0) {
+ interval = 0;
+ } else if (interval > 3) {
+ interval = 3;
+ }
+ ctx->swapInterval = interval;
+ return TRUE;
+}
+
+GLAPI int GLAPIENTRY
+wglGetSwapIntervalEXT (void)
+{
+ return (ctx == NULL) ? -1 : ctx->swapInterval;
+}
+
+GLAPI BOOL GLAPIENTRY
+wglGetDeviceGammaRampEXT (unsigned char *r, unsigned char *g, unsigned char *b)
+{
+ return TRUE;
+}
+
+GLAPI BOOL GLAPIENTRY
+wglSetDeviceGammaRampEXT (const unsigned char *r, const unsigned char *g, const unsigned char *b)
+{
+ return TRUE;
+}
+
+GLAPI const char * GLAPIENTRY
+wglGetExtensionsStringEXT (void)
+{
+ return "WGL_3DFX_gamma_control "
+ "WGL_EXT_swap_control "
+ "WGL_EXT_extensions_string WGL_ARB_extensions_string";
+}
+
+GLAPI const char * GLAPIENTRY
+wglGetExtensionsStringARB (HDC hdc)
+{
+ return wglGetExtensionsStringEXT();
+}
+
+static struct {
+ const char *name;
+ PROC func;
+} wgl_ext[] = {
+ {"wglGetExtensionsStringARB", wglGetExtensionsStringARB},
+ {"wglGetExtensionsStringEXT", wglGetExtensionsStringEXT},
+ {"wglSwapIntervalEXT", wglSwapIntervalEXT},
+ {"wglGetSwapIntervalEXT", wglGetSwapIntervalEXT},
+ {"wglGetDeviceGammaRampEXT", wglGetDeviceGammaRampEXT},
+ {"wglGetDeviceGammaRamp3DFX", wglGetDeviceGammaRampEXT},
+ {"wglSetDeviceGammaRampEXT", wglSetDeviceGammaRampEXT},
+ {"wglSetDeviceGammaRamp3DFX", wglSetDeviceGammaRampEXT},
+ {NULL, NULL}
+};
+
GLAPI PROC GLAPIENTRY
wglGetProcAddress(LPCSTR lpszProc)
{
+ int i;
PROC p = (PROC) _glapi_get_proc_address((const char *) lpszProc);
-
+
if (p)
return p;
+ for (i = 0; wgl_ext[i].name; i++) {
+ if (!strcmp(lpszProc, wgl_ext[i].name)) {
+ return wgl_ext[i].func;
+ }
+ }
+
SetLastError(0);
return (NULL);
}
@@ -612,6 +683,13 @@ wglChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR * ppfd)
fclose(pix_file);
#endif
+#if 1 || QUAKE2
+ if (ppfd->cColorBits == 24 && ppfd->cDepthBits == 32) {
+ ppfd->cColorBits = 16;
+ ppfd->cDepthBits = 16;
+ }
+#endif
+
qt_valid_pix = qt_pix;
if (ppfd->nSize != sizeof(PIXELFORMATDESCRIPTOR) || ppfd->nVersion != 1) {