From 00351030674abc54572385b0948b8deeeae2e69e Mon Sep 17 00:00:00 2001 From: Jack Moffitt Date: Tue, 11 Jun 2013 14:23:33 -0600 Subject: [PATCH 1/3] Fix typo in linux version of mouse wheel code. --- glut.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glut.rs b/glut.rs index 999823d..6bacb3e 100644 --- a/glut.rs +++ b/glut.rs @@ -296,7 +296,7 @@ pub fn mouse_wheel_callback_tls_key(_callback: @@fn(wheel: c_int, #[cfg(target_os="linux")] pub extern fn mouse_wheel_callback(wheel: c_int, direction: c_int, x: c_int, y: c_int) { unsafe { - let callback = local_data_get(wheel_callback_tls_key).get(); + let callback = local_data_get(mouse_wheel_callback_tls_key).get(); (*callback)(wheel, direction, x, y) } } @@ -304,7 +304,7 @@ pub extern fn mouse_wheel_callback(wheel: c_int, direction: c_int, x: c_int, y: #[cfg(target_os="linux")] pub fn mouse_wheel_func(callback: @fn(wheel: c_int, direction: c_int, x: c_int, y: c_int)) { unsafe { - local_data_set(wheel_callback_tls_key, @callback); + local_data_set(mouse_wheel_callback_tls_key, @callback); glutMouseWheelFunc(mouse_wheel_callback); } } From cb07a6c4368962f1ab84b33ea0fcfc5f8efa434b Mon Sep 17 00:00:00 2001 From: Jack Moffitt Date: Tue, 11 Jun 2013 14:29:52 -0600 Subject: [PATCH 2/3] Add extern glutMouseWheelFunc. --- glut.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/glut.rs b/glut.rs index 6bacb3e..552e7cc 100644 --- a/glut.rs +++ b/glut.rs @@ -9,7 +9,7 @@ /* automatically generated by rust-bindgen */ -use glut::bindgen::{glutCreateWindow, glutDestroyWindow, glutDisplayFunc, glutMouseFunc}; +use glut::bindgen::{glutCreateWindow, glutDestroyWindow, glutDisplayFunc, glutMouseFunc, glutMouseWheelFunc}; use glut::bindgen::{glutKeyboardFunc, glutGetModifiers, glutMotionFunc, glutPassiveMotionFunc}; use glut::bindgen::{glutGet, glutGetWindow}; use glut::bindgen::{glutInit, glutInitDisplayMode, glutPostRedisplay, glutReshapeFunc}; @@ -489,6 +489,8 @@ pub fn glutKeyboardFunc(func: *u8); pub fn glutMouseFunc(func: *u8); +pub fn glutMouseWheelFunc(func: *u8); + pub fn glutMotionFunc(func: *u8); pub fn glutPassiveMotionFunc(func: *u8); From 3120b2a96babf454080b2596e2fc21e9c94bb4fd Mon Sep 17 00:00:00 2001 From: Jack Moffitt Date: Tue, 11 Jun 2013 14:39:25 -0600 Subject: [PATCH 3/3] Fix build warning. --- glut.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glut.rs b/glut.rs index 552e7cc..d82251f 100644 --- a/glut.rs +++ b/glut.rs @@ -111,7 +111,7 @@ pub fn set_window(window: Window) { } } -pub fn set_window_title(window: Window, title: &str) { +pub fn set_window_title(_window: Window, title: &str) { unsafe { let bytes = to_bytes(title); glutSetWindowTitle(to_ptr(bytes) as *c_char);