mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-24 22:31:30 +11:00
Merge pull request #686 from pcwalton/virtualbox
Add a useless call to `glXQueryVersion()` before doing anything in the GLX port to work around a bug in the VirtualBox OpenGL driver.
This commit is contained in:
commit
ff0614b61f
|
@ -41,6 +41,18 @@ impl Context {
|
||||||
opengl: &'a GlAttributes<&'a Context>, display: *mut ffi::Display)
|
opengl: &'a GlAttributes<&'a Context>, display: *mut ffi::Display)
|
||||||
-> Result<ContextPrototype<'a>, CreationError>
|
-> Result<ContextPrototype<'a>, CreationError>
|
||||||
{
|
{
|
||||||
|
// This is completely ridiculous, but VirtualBox's OpenGL driver needs some call handled by
|
||||||
|
// *it* (i.e. not Mesa) to occur before anything else can happen. That is because
|
||||||
|
// VirtualBox's OpenGL driver is going to apply binary patches to Mesa in the DLL
|
||||||
|
// constructor and until it's loaded it won't have a chance to do that.
|
||||||
|
//
|
||||||
|
// The easiest way to do this is to just call `glXQueryVersion()` before doing anything
|
||||||
|
// else. See: https://www.virtualbox.org/ticket/8293
|
||||||
|
let (mut major, mut minor) = (0, 0);
|
||||||
|
unsafe {
|
||||||
|
glx.QueryVersion(display as *mut _, &mut major, &mut minor);
|
||||||
|
}
|
||||||
|
|
||||||
// loading the list of extensions
|
// loading the list of extensions
|
||||||
let extensions = unsafe {
|
let extensions = unsafe {
|
||||||
let extensions = glx.QueryExtensionsString(display as *mut _, 0); // FIXME: screen number
|
let extensions = glx.QueryExtensionsString(display as *mut _, 0); // FIXME: screen number
|
||||||
|
|
Loading…
Reference in a new issue