[GtkGLExt] gtkglext + windows 7



I had noticed on some (and only some) gfx cards under vista, the screen would update at sparatic intervals or not update at all within gtkglext opengl surface on windows 7 rc and vista when dwm/compositing was enabled (aero effects).  I decided to look into this, though unfortunately I don't have any of the machines with the fault available to me.  My speculation however, was the lack of a PFD_SUPPORT_COMPOSITION flag (http://www.opengl.org/pipeline/article/vol003_7/).  I've updated gdkglconfig_win32.c to detect composition and add the flag via two code segments below (sorry I didn't bother generating a patch file)

If anyone else was experiencing this bug, please email me to test my solution.

~mike

//mlf
typedef HRESULT (*PDWMISCOMP)(BOOL *);
static PDWMISCOMP is_comp;
static HMODULE hmod_dwmapi = NULL;
static gboolean no_dwm_api = FALSE;

//more by mlf
#ifndef PFD_SUPPORT_COMPOSITION
#define PFD_SUPPORT_COMPOSITION 0x00008000
#endif

//mlf
static gboolean dwm_aero_on()
{
  if(!hmod_dwmapi && !no_dwm_api)
  {
    HMODULE hmod = LoadLibrary("dwmapi.dll");
    if(!hmod)
      no_dwm_api = TRUE;
      
    is_comp = (PDWMISCOMP)GetProcAddress(hmod, "DwmIsCompositionEnabled");
    if(!is_comp)
      no_dwm_api = TRUE;      
  }
    
  if(hmod_dwmapi && is_comp)
  {
    BOOL e;
    is_comp(&e);
    return (e) ? TRUE : FALSE;
  }  
  
  return FALSE;
}

//.........and the change in the parse attrib list routine
  //fix this thing to work with aero
  if(dwm_aero_on())  
  {
    pfd->dwFlags = PFD_SUPPORT_OPENGL |
                   PFD_SUPPORT_COMPOSITION;        
  }
  else
  {
    pfd->dwFlags = PFD_SUPPORT_OPENGL |
                   PFD_SUPPORT_GDI;
  }


      


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]