Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only apply nvidia hack with nvidia drivers #67

Merged
merged 3 commits into from May 27, 2014
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

Change 1 -> GLX_VENDOR

Replace 1 with GLX_VENDOR for glXGetClientString call.
  • Loading branch information
bjwbell committed May 27, 2014
commit 6de7f80f389bb9cacd083f7470c3b3e860599613
@@ -22,6 +22,7 @@ use opengles::glx::{GLX_TEXTURE_TARGET_EXT, glXCreatePixmap, glXDestroyPixmap};
use opengles::glx::{glXGetProcAddress, glXChooseFBConfig};
use opengles::glx::{glXGetVisualFromFBConfig};
use opengles::glx::{GLX_RGBA_BIT, GLX_WINDOW_BIT, GLX_RENDER_TYPE, GLX_DOUBLEBUFFER};
use opengles::glx::{GLX_VENDOR};
use opengles::gl2::NO_ERROR;
use opengles::gl2;
use std::cast;
@@ -96,7 +97,7 @@ impl NativeCompositingGraphicsContext {
let glXGetClientString: extern "C" fn(*Display, c_int) -> *c_char =
cast::transmute(glXGetProcAddress(cast::transmute(&"glXGetClientString\x00"[0])));

This comment has been minimized.

Copy link
@pcwalton

pcwalton May 27, 2014

Contributor

Use the std::c_str functionality instead.

assert!(glXGetClientString as *c_void != ptr::null());
let glx_cli_vendor_c_str = CString::new(glXGetClientString(display, 1), false);
let glx_cli_vendor_c_str = CString::new(glXGetClientString(display, GLX_VENDOR), false);
let glx_cli_vendor = match glx_cli_vendor_c_str.as_str() { Some(s) => s,
None => fail!("Can't get glx client vendor.") };
if glx_cli_vendor.to_ascii().eq_ignore_case("NVIDIA".to_ascii()) {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.