Roderick Colenbrander : wgl: Remove unneeded opengl initialisation code at wine startup.

Alexandre Julliard julliard at winehq.org
Mon Feb 25 06:51:01 CST 2008


Module: wine
Branch: master
Commit: 220163ee9d698543fe34257969a88e5976d378de
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=220163ee9d698543fe34257969a88e5976d378de

Author: Roderick Colenbrander <thunderbird2k at gmx.net>
Date:   Fri Feb 22 20:55:02 2008 +0000

wgl: Remove unneeded opengl initialisation code at wine startup.

---

 dlls/winex11.drv/opengl.c      |   46 ----------------------------------------
 dlls/winex11.drv/x11drv.h      |    1 -
 dlls/winex11.drv/x11drv_main.c |   10 --------
 3 files changed, 0 insertions(+), 57 deletions(-)

diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index d685b94..1d0ada0 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -3364,47 +3364,6 @@ BOOL X11DRV_SwapBuffers(X11DRV_PDEVICE *physDev)
   return TRUE;
 }
 
-/***********************************************************************
- *		X11DRV_setup_opengl_visual
- *
- * Setup the default visual used for OpenGL and Direct3D, and the desktop
- * window (if it exists).  If OpenGL isn't available, the visual is simply
- * set to the default visual for the display
- */
-XVisualInfo *X11DRV_setup_opengl_visual( Display *display )
-{
-    XVisualInfo *visual = NULL;
-    int i;
-
-    /* In order to support OpenGL or D3D, we require a double-buffered visual and stencil buffer support,
-     * D3D and some applications can make use of aux buffers.
-     */
-    int visualProperties[][11] = {
-        { GLX_RGBA, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, 24, GLX_STENCIL_SIZE, 8, GLX_ALPHA_SIZE, 8, GLX_AUX_BUFFERS, 1, None },
-        { GLX_RGBA, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, 24, GLX_STENCIL_SIZE, 8, GLX_ALPHA_SIZE, 8, None },
-        { GLX_RGBA, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, 16, GLX_STENCIL_SIZE, 8, None },
-        { GLX_RGBA, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, 16, None },
-    };
-
-    if (!has_opengl())
-        return NULL;
-
-    wine_tsx11_lock();
-    for (i = 0; i < sizeof(visualProperties)/sizeof(visualProperties[0]); ++i) {
-        visual = pglXChooseVisual(display, DefaultScreen(display), visualProperties[i]);
-        if (visual)
-            break;
-    }
-    wine_tsx11_unlock();
-
-    if (visual)
-        TRACE("Visual ID %lx Chosen\n", visual->visualid);
-    else
-        WARN("No suitable visual found\n");
-
-    return visual;
-}
-
 XVisualInfo *visual_from_fbconfig_id( XID fbconfig_id )
 {
     WineGLPixelFormat *fmt;
@@ -3579,11 +3538,6 @@ BOOL X11DRV_wglUseFontBitmapsW(X11DRV_PDEVICE *physDev, DWORD first, DWORD count
     return FALSE;
 }
 
-XVisualInfo *X11DRV_setup_opengl_visual( Display *display )
-{
-  return NULL;
-}
-
 Drawable get_glxdrawable(X11DRV_PDEVICE *physDev)
 {
     return 0;
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index ee2cac7..97d1a27 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -270,7 +270,6 @@ extern BOOL X11DRV_XRender_ExtTextOut(X11DRV_PDEVICE *physDev, INT x, INT y, UIN
 				      UINT count, const INT *lpDx);
 extern void X11DRV_XRender_UpdateDrawable(X11DRV_PDEVICE *physDev);
 
-extern XVisualInfo *X11DRV_setup_opengl_visual(Display *display);
 extern Drawable get_glxdrawable(X11DRV_PDEVICE *physDev);
 extern BOOL destroy_glxpixmap(Display *display, XID glxpixmap);
 
diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c
index 444754b..f4f5f06 100644
--- a/dlls/winex11.drv/x11drv_main.c
+++ b/dlls/winex11.drv/x11drv_main.c
@@ -476,7 +476,6 @@ sym_not_found:
 static BOOL process_attach(void)
 {
     Display *display;
-    XVisualInfo *desktop_vi = NULL;
     const char *env;
 
     setup_options();
@@ -513,15 +512,6 @@ static BOOL process_attach(void)
         }
     }
     if (!screen_depth) screen_depth = DefaultDepthOfScreen( screen );
-
-    /* If OpenGL is available, change the default visual, etc as necessary */
-    if ((desktop_vi = X11DRV_setup_opengl_visual( display )))
-    {
-        visual       = desktop_vi->visual;
-        screen       = ScreenOfDisplay(display, desktop_vi->screen);
-        screen_depth = desktop_vi->depth;
-        XFree(desktop_vi);
-    }
     screen_bpp = depth_to_bpp( screen_depth );
 
     XInternAtoms( display, (char **)atom_names, NB_XATOMS - FIRST_XATOM, False, X11DRV_Atoms );




More information about the wine-cvs mailing list