Commit 28a2646d authored by Roderick Colenbrander's avatar Roderick Colenbrander Committed by Alexandre Julliard

wgl: Get rid of glXQueryDrawable because officially it only works on GLXDrawables.

Nvidia allows it to operate on a standard Window too but Mesa and AMD don't and this isn't needed according to the GLX specs. This prevents crashes when creating +wgl logs.
parent 85f9460a
...@@ -146,6 +146,7 @@ static const WineGLExtension *WineGLExtensionList[MAX_EXTENSIONS]; ...@@ -146,6 +146,7 @@ static const WineGLExtension *WineGLExtensionList[MAX_EXTENSIONS];
static int WineGLExtensionListSize; static int WineGLExtensionListSize;
static void X11DRV_WineGL_LoadExtensions(void); static void X11DRV_WineGL_LoadExtensions(void);
static WineGLPixelFormat* ConvertPixelFormatWGLtoGLX(Display *display, int iPixelFormat, BOOL AllowOffscreen, int *fmt_count);
static BOOL glxRequireVersion(int requiredVersion); static BOOL glxRequireVersion(int requiredVersion);
static BOOL glxRequireExtension(const char *requiredExtension); static BOOL glxRequireExtension(const char *requiredExtension);
...@@ -582,37 +583,23 @@ static int describeContext(Wine_GLContext* ctx) { ...@@ -582,37 +583,23 @@ static int describeContext(Wine_GLContext* ctx) {
return ctx_vis_id; return ctx_vis_id;
} }
static int describeDrawable(Wine_GLContext* ctx, Drawable drawable) { static BOOL describeDrawable(X11DRV_PDEVICE *physDev) {
int tmp; int tmp;
int nElements; WineGLPixelFormat *fmt;
int attribList[3] = { GLX_FBCONFIG_ID, 0, None }; int fmt_count = 0;
GLXFBConfig *fbCfgs;
if (pglXQueryDrawable == NULL) {
/** glXQueryDrawable not available so returns not supported */
return -1;
}
TRACE(" Drawable %p have :\n", (void*) drawable);
pglXQueryDrawable(gdi_display, drawable, GLX_WIDTH, (unsigned int*) &tmp);
TRACE(" - WIDTH as %d\n", tmp);
pglXQueryDrawable(gdi_display, drawable, GLX_HEIGHT, (unsigned int*) &tmp);
TRACE(" - HEIGHT as %d\n", tmp);
pglXQueryDrawable(gdi_display, drawable, GLX_FBCONFIG_ID, (unsigned int*) &tmp);
TRACE(" - FBCONFIG_ID as 0x%x\n", tmp);
attribList[1] = tmp; fmt = ConvertPixelFormatWGLtoGLX(gdi_display, physDev->current_pf, TRUE /* Offscreen */, &fmt_count);
fbCfgs = pglXChooseFBConfig(gdi_display, DefaultScreen(gdi_display), attribList, &nElements); if(!fmt) return FALSE;
if (fbCfgs == NULL) {
return -1;
}
pglXGetFBConfigAttrib(gdi_display, fbCfgs[0], GLX_VISUAL_ID, &tmp); TRACE(" HDC %p has:\n", physDev->hdc);
TRACE(" - VISUAL_ID as 0x%x\n", tmp); TRACE(" - iPixelFormat %d\n", fmt->iPixelFormat);
TRACE(" - Drawable %p\n", (void*) get_glxdrawable(physDev));
TRACE(" - FBCONFIG_ID 0x%x\n", fmt->fmt_id);
XFree(fbCfgs); pglXGetFBConfigAttrib(gdi_display, fmt->fbconfig, GLX_VISUAL_ID, &tmp);
TRACE(" - VISUAL_ID 0x%x\n", tmp);
return tmp; return TRUE;
} }
static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, Wine_GLPBuffer* pbuf) { static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, Wine_GLPBuffer* pbuf) {
...@@ -1842,7 +1829,7 @@ BOOL CDECL X11DRV_wglMakeCurrent(X11DRV_PDEVICE *physDev, HGLRC hglrc) { ...@@ -1842,7 +1829,7 @@ BOOL CDECL X11DRV_wglMakeCurrent(X11DRV_PDEVICE *physDev, HGLRC hglrc) {
if (ctx->ctx == NULL) { if (ctx->ctx == NULL) {
/* The describe lines below are for debugging purposes only */ /* The describe lines below are for debugging purposes only */
if (TRACE_ON(wgl)) { if (TRACE_ON(wgl)) {
describeDrawable(ctx, drawable); describeDrawable(physDev);
describeContext(ctx); describeContext(ctx);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment