aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/glx
diff options
context:
space:
mode:
authortomaka <pierre.krieger1708@gmail.com>2015-12-30 08:40:30 +0100
committertomaka <pierre.krieger1708@gmail.com>2015-12-30 08:40:30 +0100
commitff0614b61f7c5544829a36b41236da2ab4b583ab (patch)
tree248513b8d07acd6a0fee522d86387a78d0bc9322 /src/api/glx
parentbcddb42cfb2e8addcc66dc777465b2f8bfc64fe1 (diff)
parentcf3097f6a0b3a20aa0979046343a02f072ea4b47 (diff)
downloadglutin-ff0614b61f7c5544829a36b41236da2ab4b583ab.tar.gz
glutin-ff0614b61f7c5544829a36b41236da2ab4b583ab.zip
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.
Diffstat (limited to 'src/api/glx')
-rw-r--r--src/api/glx/mod.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/api/glx/mod.rs b/src/api/glx/mod.rs
index 9f3e084..a8a765f 100644
--- a/src/api/glx/mod.rs
+++ b/src/api/glx/mod.rs
@@ -41,6 +41,18 @@ impl Context {
opengl: &'a GlAttributes<&'a Context>, display: *mut ffi::Display)
-> 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
let extensions = unsafe {
let extensions = glx.QueryExtensionsString(display as *mut _, 0); // FIXME: screen number