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 d9bf096..65bdbe5 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 8c6dedf..ebc80f0 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 016d968..0dccdc2 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 7d4c168..8315096 100644 (file)
@@ -1505,15 +1505,12 @@ 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");
    _mesa_enable_extension(ctx, "GL_ARB_vertex_program");
index 6ebdb71..abef71a 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 0b0197d..9f032e9 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;