# Patch to fix flickering in full screen. Patch from
# https://raw.githubusercontent.com/Homebrew/formula-patches/74c2566/wine/2.14.patch
# See: https://bugs.winehq.org/show_bug.cgi?id=34166
old
|
new
|
|
1431 | 1431 | } |
1432 | 1432 | |
1433 | 1433 | /* This function takes care of wined3d pixel format selection. */ |
1434 | | static int context_choose_pixel_format(const struct wined3d_device *device, HDC hdc, |
1435 | | const struct wined3d_format *color_format, const struct wined3d_format *ds_format, |
1436 | | BOOL auxBuffers) |
| 1434 | static int context_choose_pixel_format(const struct wined3d_device *device, const struct wined3d_swapchain *swapchain, |
| 1435 | HDC hdc, const struct wined3d_format *color_format, const struct wined3d_format *ds_format, |
| 1436 | BOOL auxBuffers) |
1437 | 1437 | { |
1438 | 1438 | unsigned int cfg_count = device->adapter->cfg_count; |
1439 | 1439 | unsigned int current_value; |
1440 | 1440 | PIXELFORMATDESCRIPTOR pfd; |
1441 | 1441 | int iPixelFormat = 0; |
| 1442 | BOOL double_buffer = TRUE; |
1442 | 1443 | unsigned int i; |
1443 | 1444 | |
1444 | 1445 | TRACE("device %p, dc %p, color_format %s, ds_format %s, aux_buffers %#x.\n", |
1445 | 1446 | device, hdc, debug_d3dformat(color_format->id), debug_d3dformat(ds_format->id), |
1446 | 1447 | auxBuffers); |
1447 | 1448 | |
| 1449 | if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && !swapchain->desc.backbuffer_count) |
| 1450 | double_buffer = FALSE; |
| 1451 | |
1448 | 1452 | current_value = 0; |
1449 | 1453 | for (i = 0; i < cfg_count; ++i) |
1450 | 1454 | { |
… |
… |
|
1456 | 1460 | if (cfg->iPixelType != WGL_TYPE_RGBA_ARB) |
1457 | 1461 | continue; |
1458 | 1462 | /* In window mode we need a window drawable format and double buffering. */ |
1459 | | if (!(cfg->windowDrawable && cfg->doubleBuffer)) |
| 1463 | if (!cfg->windowDrawable || (double_buffer && !cfg->doubleBuffer)) |
1460 | 1464 | continue; |
1461 | 1465 | if (cfg->redSize < color_format->red_size) |
1462 | 1466 | continue; |
… |
… |
|
1479 | 1483 | * depth it is no problem to emulate 16-bit using e.g. 24-bit, so accept that. */ |
1480 | 1484 | if (cfg->depthSize == ds_format->depth_size) |
1481 | 1485 | value += 1; |
1482 | | if (cfg->stencilSize == ds_format->stencil_size) |
| 1486 | if (!cfg->doubleBuffer == !double_buffer) |
1483 | 1487 | value += 2; |
1484 | | if (cfg->alphaSize == color_format->alpha_size) |
| 1488 | if (cfg->stencilSize == ds_format->stencil_size) |
1485 | 1489 | value += 4; |
| 1490 | if (cfg->alphaSize == color_format->alpha_size) |
| 1491 | value += 8; |
1486 | 1492 | /* We like to have aux buffers in backbuffer mode */ |
1487 | 1493 | if (auxBuffers && cfg->auxBuffers) |
1488 | | value += 8; |
| 1494 | value += 16; |
1489 | 1495 | if (cfg->redSize == color_format->red_size |
1490 | 1496 | && cfg->greenSize == color_format->green_size |
1491 | 1497 | && cfg->blueSize == color_format->blue_size) |
1492 | | value += 16; |
| 1498 | value += 32; |
1493 | 1499 | |
1494 | 1500 | if (value > current_value) |
1495 | 1501 | { |
… |
… |
|
1505 | 1511 | memset(&pfd, 0, sizeof(pfd)); |
1506 | 1512 | pfd.nSize = sizeof(pfd); |
1507 | 1513 | pfd.nVersion = 1; |
1508 | | pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER | PFD_DRAW_TO_WINDOW;/*PFD_GENERIC_ACCELERATED*/ |
| 1514 | pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW;/*PFD_GENERIC_ACCELERATED*/ |
| 1515 | if (double_buffer) |
| 1516 | pfd.dwFlags |= PFD_DOUBLEBUFFER; |
1509 | 1517 | pfd.iPixelType = PFD_TYPE_RGBA; |
1510 | 1518 | pfd.cAlphaBits = color_format->alpha_size; |
1511 | 1519 | pfd.cColorBits = color_format->red_size + color_format->green_size |
… |
… |
|
1777 | 1785 | } |
1778 | 1786 | |
1779 | 1787 | /* Try to find a pixel format which matches our requirements. */ |
1780 | | if (!(ret->pixel_format = context_choose_pixel_format(device, ret->hdc, color_format, ds_format, auxBuffers))) |
| 1788 | if (!(ret->pixel_format = context_choose_pixel_format(device, swapchain, ret->hdc, color_format, ds_format, auxBuffers))) |
1781 | 1789 | goto out; |
1782 | 1790 | |
1783 | 1791 | ret->gl_info = gl_info; |