Windows: Fallback to 0 samples if ARB::choosePixelFormat() fails with 1
This solves a problem when using a Qt application over remote desktop as if it failed with even 1 sample then it would fallback to GDI which causes an error if the software OpenGL option is used. Change-Id: Ib311a7a657f92aab15277461bc8e040bebbe4753 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>bb10
parent
9ea8082658
commit
d64f776a9a
|
|
@ -597,6 +597,14 @@ static int choosePixelFormat(HDC hdc,
|
|||
break;
|
||||
if (iAttributes[samplesValuePosition] > 1) {
|
||||
iAttributes[samplesValuePosition] /= 2;
|
||||
} else if (iAttributes[samplesValuePosition] == 1) {
|
||||
// Fallback in case it is unable to initialize with any
|
||||
// samples to avoid falling back to the GDI path
|
||||
// NB: The sample attributes needs to be at the end for this
|
||||
// to work correctly
|
||||
iAttributes[samplesValuePosition - 1] = FALSE;
|
||||
iAttributes[samplesValuePosition] = 0;
|
||||
iAttributes[samplesValuePosition + 1] = 0;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue