aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Cargo.toml6
-rw-r--r--build.rs1
-rw-r--r--src/cocoa/mod.rs4
-rw-r--r--src/cocoa/monitor.rs2
-rw-r--r--src/lib.rs4
-rw-r--r--src/win32/callback.rs5
-rw-r--r--src/win32/mod.rs8
-rw-r--r--src/window.rs1
-rw-r--r--src/x11/window/mod.rs2
-rw-r--r--src/x11/window/monitor.rs2
10 files changed, 21 insertions, 14 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 2271bf6..e83d6a5 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "glutin"
-version = "0.0.9"
+version = "0.0.13"
authors = ["tomaka <pierre.krieger1708@gmail.com>"]
description = "Cross-plaform OpenGL context provider. Important: the crates.io only supports Windows and Linux for the moment."
keywords = ["windowing", "opengl"]
@@ -42,10 +42,10 @@ version = "0"
[target.x86_64-apple-darwin.dependencies.glutin_core_graphics]
version = "0"
-[target.i686-apple-darwin.dependencies.core_foundation]
+[target.i686-apple-darwin.dependencies.glutin_core_foundation]
version = "0"
-[target.x86_64-apple-darwin.dependencies.core_foundation]
+[target.x86_64-apple-darwin.dependencies.glutin_core_foundation]
version = "0"
[target.i686-pc-windows-gnu.dependencies]
diff --git a/build.rs b/build.rs
index 867e170..7137d3e 100644
--- a/build.rs
+++ b/build.rs
@@ -1,4 +1,3 @@
-#![feature(path)]
extern crate gl_generator;
extern crate khronos_api;
diff --git a/src/cocoa/mod.rs b/src/cocoa/mod.rs
index 62eedc6..1da5ce1 100644
--- a/src/cocoa/mod.rs
+++ b/src/cocoa/mod.rs
@@ -32,7 +32,7 @@ use std::sync::Mutex;
use std::ascii::AsciiExt;
use std::ops::Deref;
-use events::Event::{MouseInput, MouseMoved, ReceivedCharacter, KeyboardInput, MouseWheel};
+use events::Event::{Awakened, MouseInput, MouseMoved, ReceivedCharacter, KeyboardInput, MouseWheel};
use events::ElementState::{Pressed, Released};
use events::MouseButton;
use events;
@@ -335,6 +335,8 @@ impl<'a> Iterator for WaitEventsIterator<'a> {
// calling poll_events()
if let Some(ev) = self.window.poll_events().next() {
return Some(ev);
+ } else {
+ return Some(Awakened);
}
}
}
diff --git a/src/cocoa/monitor.rs b/src/cocoa/monitor.rs
index bf15665..40c7896 100644
--- a/src/cocoa/monitor.rs
+++ b/src/cocoa/monitor.rs
@@ -13,7 +13,7 @@ pub fn get_available_monitors() -> VecDeque<MonitorID> {
display::CGGetActiveDisplayList(max_displays,
&mut active_displays[0],
&mut display_count);
- for i in range(0, display_count as usize) {
+ for i in 0..display_count as usize {
monitors.push_back(MonitorID(active_displays[i]));
}
}
diff --git a/src/lib.rs b/src/lib.rs
index 76f9fde..c0de089 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -213,7 +213,9 @@ pub struct PixelFormat {
}
/// Attributes
-struct BuilderAttribs<'a> {
+// FIXME: remove `pub` (https://github.com/rust-lang/rust/issues/23585)
+#[doc(hidden)]
+pub struct BuilderAttribs<'a> {
#[allow(dead_code)]
headless: bool,
strict: bool,
diff --git a/src/win32/callback.rs b/src/win32/callback.rs
index 5423fc3..f9ec653 100644
--- a/src/win32/callback.rs
+++ b/src/win32/callback.rs
@@ -36,8 +36,9 @@ fn send_event(input_window: winapi::HWND, event: Event) {
/// This is the callback that is called by `DispatchMessage` in the events loop.
///
/// Returning 0 tells the Win32 API that the message has been processed.
-pub extern "system" fn callback(window: winapi::HWND, msg: winapi::UINT,
- wparam: winapi::WPARAM, lparam: winapi::LPARAM) -> winapi::LRESULT
+pub unsafe extern "system" fn callback(window: winapi::HWND, msg: winapi::UINT,
+ wparam: winapi::WPARAM, lparam: winapi::LPARAM)
+ -> winapi::LRESULT
{
match msg {
winapi::WM_DESTROY => {
diff --git a/src/win32/mod.rs b/src/win32/mod.rs
index 8ba5ed5..07f76e8 100644
--- a/src/win32/mod.rs
+++ b/src/win32/mod.rs
@@ -49,7 +49,9 @@ unsafe impl Send for Window {}
unsafe impl Sync for Window {}
/// A simple wrapper that destroys the context when it is destroyed.
-struct ContextWrapper(pub winapi::HGLRC);
+// FIXME: remove `pub` (https://github.com/rust-lang/rust/issues/23585)
+#[doc(hidden)]
+pub struct ContextWrapper(pub winapi::HGLRC);
impl Drop for ContextWrapper {
fn drop(&mut self) {
@@ -60,7 +62,9 @@ impl Drop for ContextWrapper {
}
/// A simple wrapper that destroys the window when it is destroyed.
-struct WindowWrapper(pub winapi::HWND, pub winapi::HDC);
+// FIXME: remove `pub` (https://github.com/rust-lang/rust/issues/23585)
+#[doc(hidden)]
+pub struct WindowWrapper(pub winapi::HWND, pub winapi::HDC);
impl Drop for WindowWrapper {
fn drop(&mut self) {
diff --git a/src/window.rs b/src/window.rs
index 5cb6e5e..12e8538 100644
--- a/src/window.rs
+++ b/src/window.rs
@@ -98,7 +98,6 @@ impl<'a> WindowBuilder<'a> {
///
/// Will panic if `samples` is not a power of two.
pub fn with_multisampling(mut self, samples: u16) -> WindowBuilder<'a> {
- use std::num::UnsignedInt;
assert!(samples.is_power_of_two());
self.attribs.multisampling = Some(samples);
self
diff --git a/src/x11/window/mod.rs b/src/x11/window/mod.rs
index 7845d07..385a913 100644
--- a/src/x11/window/mod.rs
+++ b/src/x11/window/mod.rs
@@ -348,7 +348,7 @@ impl Window {
return Err(OsError(format!("Could not query the video modes")));
}
- for i in range(0, mode_num) {
+ for i in 0..mode_num {
let mode: ffi::XF86VidModeModeInfo = ptr::read(*modes.offset(i as isize) as *const _);
if mode.hdisplay == dimensions.0 as u16 && mode.vdisplay == dimensions.1 as u16 {
best_mode = i;
diff --git a/src/x11/window/monitor.rs b/src/x11/window/monitor.rs
index 44c5e84..46f2062 100644
--- a/src/x11/window/monitor.rs
+++ b/src/x11/window/monitor.rs
@@ -19,7 +19,7 @@ pub fn get_available_monitors() -> VecDeque<MonitorID> {
};
let mut monitors = VecDeque::new();
- monitors.extend(range(0, nb_monitors).map(|i| MonitorID(i as u32)));
+ monitors.extend((0..nb_monitors).map(|i| MonitorID(i as u32)));
monitors
}