On Wed Jun 19 07:18:24 2024 +0000, Rémi Bernon wrote:
switch (value) { case GLX_SWAP_EXCHANGE_OML: pf->swap_method = WGL_SWAP_EXCHANGE_ARB; break; case GLX_SWAP_COPY_OML: pf->swap_method = WGL_SWAP_COPY_ARB; break; case GLX_SWAP_UNDEFINED_OML: pf->swap_method = WGL_SWAP_UNDEFINED_ARB; break; default: ERR( "Unexpected swap method %x.\n", value ); pf->swap_method = 0; break; }
Then, should this be `swap_method = -1` maybe? Or use `WGL_SWAP_EXCHANGE_ARB` as a default?
In the unexpected value cases for `swap_method` and `pixel_type` I tried to maintain the existing winex11 behavior (`swap_method` value was not set at all, `pixel_type` defaulted to RGBA), since I wasn't sure if this behavior was on purpose (possibly as a workaround for some driver?), although my guess is that this a scenario we don't ever expect in practice and we want to do something somewhat reasonable "just in case". Another possible reason would be future-proofing, e.g., new values for the GLX attributes in extensions.
If we are not concerned about maintaining the existing behavior, my preference is to set to `-1` to make driver brokenness (or the fact that we are not handling a new value) more explicit, and I have changed v3 accordingly. If we find that we do in fact want to work around misbehaving GL(X) drivers we can always revisit to handle new values, use defaults or not expose problematic formats to WGL at all.