From 8293a9ead0ddbc40be62815f0f0823356665b3dc Mon Sep 17 00:00:00 2001 From: Roderick Colenbrander Date: Fri, 22 Feb 2008 20:40:00 +0000 Subject: [PATCH] wgl: Remove the pixel format limitation. --- dlls/winex11.drv/opengl.c | 85 ++++++++++++++++++--------------------- 1 file changed, 40 insertions(+), 45 deletions(-) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 3531918e022..d685b94832d 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -829,17 +829,10 @@ static int get_render_type_from_fbconfig(Display *display, GLXFBConfig fbconfig) static BOOL init_formats(Display *display, int screen, Visual *visual) { - int fmt_id, tmp_fmt_id, nCfgs, i; + int fmt_id, nCfgs, i, run; GLXFBConfig* cfgs; - GLXFBConfig fbconfig = NULL; XVisualInfo *visinfo; - VisualID visualid = XVisualIDFromVisual(visual); - int nOffscreenFormats = 0; - /* As mentioned in various parts of the code only the format of the main visual can be used for onscreen rendering. - * Next to this format there are also so called offscreen rendering formats (used for pbuffers) which can be supported - * because they don't need a visual. Below we use glXGetFBConfigs instead of glXChooseFBConfig to enumerate the fb configurations - * because this call lists both types of formats instead of only onscreen ones. */ cfgs = pglXGetFBConfigs(display, DefaultScreen(display), &nCfgs); if (NULL == cfgs || 0 == nCfgs) { ERR("glXChooseFBConfig returns NULL\n"); @@ -847,48 +840,50 @@ static BOOL init_formats(Display *display, int screen, Visual *visual) return FALSE; } - /* Count the number of offscreen formats to determine the size for our pixelformat list */ - for(i=0; ivisualid == visualid) { + /* Fill the pixel format list. Put onscreen formats at the top and offscreen ones at the bottom. + * Do this as GLX doesn't guarantee that the list is sorted */ + for(run=0; run < 2; run++) + { + for(i=0; idepth != screen_depth) + continue; - /* Fill the list with offscreen formats */ - for(i=0; i