Hack for linear fogging. Added empty routines for WGL_ARB_pixel_format WGL_ARB_render...
authorDaniel Borca <dborca@users.sourceforge.net>
Sat, 19 Jun 2004 11:07:58 +0000 (11:07 +0000)
committerDaniel Borca <dborca@users.sourceforge.net>
Sat, 19 Jun 2004 11:07:58 +0000 (11:07 +0000)
docs/README.3DFX
src/mesa/drivers/glide/fx.rc
src/mesa/drivers/glide/fxapi.c
src/mesa/drivers/glide/fxdd.c
src/mesa/drivers/glide/fxsetup.c
src/mesa/drivers/glide/fxwgl.c

index d9bf09604e92d22b64043030fbca40edc2c90cf0..65bdbe50b0a9754d959dea31e39bf673a8854a71 100644 (file)
@@ -185,11 +185,6 @@ MESA_FX_MAXLOD
            "9"  - 512x512 textures
            "10" - 1024x1024 textures
            "11" - 2048x2048 textures
-MESA_3DFX_STRING
-       OS: all
-       HW: all
-       Desc: advertise "3dfx" substring in GL_RENDERER
-       Note: used by some games aware by 3dfx hw limitations
 MESA_GLX_FX
        OS: linux
        HW: Voodoo1, Rush, Voodoo2
index 8c6dedff375870ae4f0aeb26e4c8c1b8ccb00b42..ebc80f0486fb7eb4e4c2ddc013b0bc76f2f4699a 100644 (file)
@@ -5,10 +5,10 @@
 #define HWSTR                   "3dfx Voodoo Graphics, Voodoo^2, Voodoo Banshee, Velocity 100/200, Voodoo3, Voodoo4, Voodoo5"
 #define COPYRIGHTSTR            "Copyright \251 Brian E. Paul"
 
-#define VERSIONSTR              "6.1.0.5"
+#define VERSIONSTR              "6.1.0.8"
 #define MANVERSION              6
 #define MANREVISION             1
-#define BUILD_NUMBER            5
+#define BUILD_NUMBER            8
 
 VS_VERSION_INFO VERSIONINFO
  FILEVERSION MANVERSION, MANREVISION, 0, BUILD_NUMBER
index 016d968be0514650953e2cf729146970c19c53d4..0dccdc2093bd61cebd0477fca97d4e140f09efbe 100644 (file)
@@ -644,9 +644,8 @@ fxMesaCreateContext(GLuint win,
                       fxMesa->snapVertices ? "" : "no ");
    }
 
-  sprintf(fxMesa->rendererString, "Mesa %s v0.61 %s%s%s",
+  sprintf(fxMesa->rendererString, "Mesa %s v0.61 %s%s",
           grGetString(GR_RENDERER),
-          getenv("MESA_3DFX_STRING") ? "3dfx " : "",
           grGetString(GR_HARDWARE),
           ((fxMesa->type < GR_SSTTYPE_Voodoo4) && (voodoo->numChips > 1)) ? " SLI" : "");
 
index 7d4c1681941391d861ef3fa0b550f268f5423665..8315096a0bf7178d197f415b10db53358aa50f78 100644 (file)
@@ -1505,14 +1505,11 @@ fxDDInitExtensions(GLcontext * ctx)
    /* core-level extensions */
    _mesa_enable_extension(ctx, "GL_EXT_multi_draw_arrays");
    _mesa_enable_extension(ctx, "GL_IBM_multimode_draw_arrays");
+   _mesa_enable_extension(ctx, "GL_ARB_vertex_buffer_object");
 #if 0
    /* not until texel fetchers are right */
    _mesa_enable_extension(ctx, "GL_SGIS_generate_mipmap");
 #endif
-#if 0
-   /* breaks UT2004 */
-   _mesa_enable_extension(ctx, "GL_ARB_vertex_buffer_object");
-#endif
 #if 0
    /* not just yet */
    _mesa_enable_extension(ctx, "GL_ARB_fragment_program");
index 6ebdb717d0bc9f8e25a7283c1bb8a2abe4185466..abef71a35e37957874677c028df1151fb4d6df03 100644 (file)
@@ -1802,6 +1802,14 @@ fxSetupFog(GLcontext * ctx)
         case GL_LINEAR:
            guFogGenerateLinear(fxMesa->fogTable, ctx->Fog.Start,
                                ctx->Fog.End);
+           if (fxMesa->fogTable[0] > 63) {
+              /* [dBorca] Hack alert:
+               * As per Glide3 Programming Guide:
+               * The difference between consecutive fog values
+               * must be less than 64.
+               */
+              fxMesa->fogTable[0] = 63;
+           }
            break;
         case GL_EXP:
            guFogGenerateExp(fxMesa->fogTable, ctx->Fog.Density);
index 0b0197d3ecc329dfb1207f3335b09dd272d1a491..9f032e909499d2e4bf715450e01a526889c03c0e 100644 (file)
@@ -477,12 +477,117 @@ wglSetDeviceGammaRamp3DFX (HDC hdc, LPVOID arrays)
  return TRUE;
 }
 
+typedef void *HPBUFFERARB;
+
+/* WGL_ARB_pixel_format */
+GLAPI BOOL GLAPIENTRY
+wglGetPixelFormatAttribivARB (HDC hdc,
+                             int iPixelFormat,
+                             int iLayerPlane,
+                             UINT nAttributes,
+                             const int *piAttributes,
+                             int *piValues)
+{
+  SetLastError(0);
+  return(FALSE);
+}
+
+GLAPI BOOL GLAPIENTRY
+wglGetPixelFormatAttribfvARB (HDC hdc,
+                             int iPixelFormat,
+                             int iLayerPlane,
+                             UINT nAttributes,
+                             const int *piAttributes,
+                             FLOAT *pfValues)
+{
+  SetLastError(0);
+  return(FALSE);
+}
+
+GLAPI BOOL GLAPIENTRY
+wglChoosePixelFormatARB (HDC hdc,
+                        const int *piAttribIList,
+                        const FLOAT *pfAttribFList,
+                        UINT nMaxFormats,
+                        int *piFormats,
+                        UINT *nNumFormats)
+{
+  SetLastError(0);
+  return(FALSE);
+}
+
+/* WGL_ARB_render_texture */
+GLAPI BOOL GLAPIENTRY
+wglBindTexImageARB (HPBUFFERARB hPbuffer, int iBuffer)
+{
+  SetLastError(0);
+  return(FALSE);
+}
+
+GLAPI BOOL GLAPIENTRY
+wglReleaseTexImageARB (HPBUFFERARB hPbuffer, int iBuffer)
+{
+  SetLastError(0);
+  return(FALSE);
+}
+
+GLAPI BOOL GLAPIENTRY
+wglSetPbufferAttribARB (HPBUFFERARB hPbuffer,
+                       const int *piAttribList)
+{
+  SetLastError(0);
+  return(FALSE);
+}
+
+/* WGL_ARB_pbuffer */
+GLAPI HPBUFFERARB GLAPIENTRY
+wglCreatePbufferARB (HDC hDC,
+                    int iPixelFormat,
+                    int iWidth,
+                    int iHeight,
+                    const int *piAttribList)
+{
+  SetLastError(0);
+  return NULL;
+}
+
+GLAPI HDC GLAPIENTRY
+wglGetPbufferDCARB (HPBUFFERARB hPbuffer)
+{
+  SetLastError(0);
+  return NULL;
+}
+
+GLAPI int GLAPIENTRY
+wglReleasePbufferDCARB (HPBUFFERARB hPbuffer, HDC hDC)
+{
+  SetLastError(0);
+  return -1;
+}
+
+GLAPI BOOL GLAPIENTRY
+wglDestroyPbufferARB (HPBUFFERARB hPbuffer)
+{
+  SetLastError(0);
+  return(FALSE);
+}
+
+GLAPI BOOL GLAPIENTRY
+wglQueryPbufferARB (HPBUFFERARB hPbuffer,
+                   int iAttribute,
+                   int *piValue)
+{
+  SetLastError(0);
+  return(FALSE);
+}
+
 GLAPI const char * GLAPIENTRY
 wglGetExtensionsStringEXT (void)
 {
  return "WGL_3DFX_gamma_control "
         "WGL_EXT_swap_control "
-        "WGL_EXT_extensions_string WGL_ARB_extensions_string";
+        "WGL_EXT_extensions_string WGL_ARB_extensions_string"
+        /*WGL_ARB_pixel_format WGL_ARB_render_texture WGL_ARB_pbuffer*/;
 }
 
 GLAPI const char * GLAPIENTRY
@@ -495,12 +600,26 @@ static struct {
        const char *name;
        PROC func;
 } wgl_ext[] = {
-       {"wglGetExtensionsStringARB", wglGetExtensionsStringARB},
-       {"wglGetExtensionsStringEXT", wglGetExtensionsStringEXT},
-       {"wglSwapIntervalEXT",        wglSwapIntervalEXT},
-       {"wglGetSwapIntervalEXT",     wglGetSwapIntervalEXT},
-       {"wglGetDeviceGammaRamp3DFX", wglGetDeviceGammaRamp3DFX},
-       {"wglSetDeviceGammaRamp3DFX", wglSetDeviceGammaRamp3DFX},
+       {"wglGetExtensionsStringARB",    wglGetExtensionsStringARB},
+       {"wglGetExtensionsStringEXT",    wglGetExtensionsStringEXT},
+       {"wglSwapIntervalEXT",           wglSwapIntervalEXT},
+       {"wglGetSwapIntervalEXT",        wglGetSwapIntervalEXT},
+       {"wglGetDeviceGammaRamp3DFX",    wglGetDeviceGammaRamp3DFX},
+       {"wglSetDeviceGammaRamp3DFX",    wglSetDeviceGammaRamp3DFX},
+       /* WGL_ARB_pixel_format */
+       {"wglGetPixelFormatAttribivARB", wglGetPixelFormatAttribivARB},
+       {"wglGetPixelFormatAttribfvARB", wglGetPixelFormatAttribfvARB},
+       {"wglChoosePixelFormatARB",      wglChoosePixelFormatARB},
+       /* WGL_ARB_render_texture */
+       {"wglBindTexImageARB",           wglBindTexImageARB},
+       {"wglReleaseTexImageARB",        wglReleaseTexImageARB},
+       {"wglSetPbufferAttribARB",       wglSetPbufferAttribARB},
+       /* WGL_ARB_pbuffer */
+       {"wglCreatePbufferARB",          wglCreatePbufferARB},
+       {"wglGetPbufferDCARB",           wglGetPbufferDCARB},
+       {"wglReleasePbufferDCARB",       wglReleasePbufferDCARB},
+       {"wglDestroyPbufferARB",         wglDestroyPbufferARB},
+       {"wglQueryPbufferARB",           wglQueryPbufferARB},
        {NULL, NULL}
 };
 
@@ -510,7 +629,7 @@ wglGetProcAddress(LPCSTR lpszProc)
    int i;
    PROC p = (PROC) _glapi_get_proc_address((const char *) lpszProc);
 
-   /* [dBorca] we can't do BlendColor... yet */
+   /* [dBorca] we can't do BlendColor */
    if (p && strcmp(lpszProc, "glBlendColor") && strcmp(lpszProc, "glBlendColorEXT"))
       return p;