aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.travis.yml13
-rw-r--r--Cargo.toml5
-rw-r--r--README.md2
-rw-r--r--src/x11/window/mod.rs16
4 files changed, 26 insertions, 10 deletions
diff --git a/.travis.yml b/.travis.yml
index afd21a7..3089722 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,9 @@
language: rust
+env:
+ global:
+ - secure: "FfubMXYXu2e7chvdfKBkc+aKPkvoBOb5Idg0KCYuD++qPFIBYg6pUE8H8WvU+V7RsEBu5vshhn3dzjkKs+LXIdo5PQUMZutAgy83g5SGxRn8Ra79GjBVBs6+XOEhFun/+7fGj2Ly/AK6BTDpqyYAhAUS7jIaF6/+JWNwPwEYfdQ="
+
install:
- sudo apt-get install libXxf86vm-dev libosmesa6-dev
@@ -11,3 +15,12 @@ script:
os:
- linux
- osx
+
+after_success: |
+ [ $TRAVIS_BRANCH = master ] &&
+ [ $TRAVIS_PULL_REQUEST = false ] &&
+ cargo doc &&
+ echo '<meta http-equiv=refresh content=0;url=glutin/index.html>' > target/doc/index.html &&
+ sudo pip install ghp-import &&
+ ghp-import -n target/doc &&
+ git push -fq https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages
diff --git a/Cargo.toml b/Cargo.toml
index c578d5e..785d170 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -8,6 +8,7 @@ keywords = ["windowing", "opengl"]
license = "Apache-2.0"
readme = "README.md"
repository = "https://github.com/tomaka/glutin"
+documentation = "http://tomaka.github.io/glutin/"
[features]
default = ["window"]
@@ -36,9 +37,9 @@ git = "https://github.com/servo/rust-core-graphics"
git = "https://github.com/servo/rust-core-graphics"
[target.i686-pc-windows-gnu.dependencies.winapi]
-git = "https://github.com/retep998/winapi-rs"
+version = "^0.0.2"
features = ["gdi32", "kernel32", "user32"]
[target.x86_64-pc-windows-gnu.dependencies.winapi]
-git = "https://github.com/retep998/winapi-rs"
+version = "^0.0.2"
features = ["gdi32", "kernel32", "user32"]
diff --git a/README.md b/README.md
index a9c38c9..ab96b92 100644
--- a/README.md
+++ b/README.md
@@ -5,6 +5,8 @@ Alternative to GLFW in pure Rust.
[![Build Status](https://travis-ci.org/tomaka/glutin.png?branch=master)](https://travis-ci.org/tomaka/glutin)
+## [Documentation](http://tomaka.github.io/glutin/)
+
## Try it!
```bash
diff --git a/src/x11/window/mod.rs b/src/x11/window/mod.rs
index f22d1f8..01126e6 100644
--- a/src/x11/window/mod.rs
+++ b/src/x11/window/mod.rs
@@ -102,8 +102,8 @@ impl Window {
}
for i in range(0, mode_num) {
- let mode: ffi::XF86VidModeModeInfo = **modes.offset(i as int);
- if mode.hdisplay == dimensions.val0() as u16 && mode.vdisplay == dimensions.val1() as u16 {
+ let mode: ffi::XF86VidModeModeInfo = ptr::read(*modes.offset(i as int) as *const _);
+ if mode.hdisplay == dimensions.0 as u16 && mode.vdisplay == dimensions.1 as u16 {
best_mode = i;
}
};
@@ -119,12 +119,12 @@ impl Window {
};
// getting the visual infos
- let mut visual_infos = unsafe {
+ let mut visual_infos: ffi::glx::types::XVisualInfo = unsafe {
let vi = ffi::glx::GetVisualFromFBConfig(display, fb_config);
if vi.is_null() {
return Err(OsError(format!("glx::ChooseVisual failed")));
}
- let vi_copy = *vi;
+ let vi_copy = ptr::read(vi as *const _);
ffi::XFree(vi as *const libc::c_void);
vi_copy
};
@@ -165,8 +165,8 @@ impl Window {
// finally creating the window
let window = unsafe {
- let win = ffi::XCreateWindow(display, root, 0, 0, dimensions.val0() as libc::c_uint,
- dimensions.val1() as libc::c_uint, 0, visual_infos.depth, ffi::InputOutput,
+ let win = ffi::XCreateWindow(display, root, 0, 0, dimensions.0 as libc::c_uint,
+ dimensions.1 as libc::c_uint, 0, visual_infos.depth, ffi::InputOutput,
visual_infos.visual, window_attributes,
&mut set_win_attr);
win
@@ -236,9 +236,9 @@ impl Window {
if builder.gl_version.is_some() {
let version = builder.gl_version.as_ref().unwrap();
attributes.push(ffi::GLX_CONTEXT_MAJOR_VERSION);
- attributes.push(version.val0() as libc::c_int);
+ attributes.push(version.0 as libc::c_int);
attributes.push(ffi::GLX_CONTEXT_MINOR_VERSION);
- attributes.push(version.val1() as libc::c_int);
+ attributes.push(version.1 as libc::c_int);
}
if builder.gl_debug {