aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authortomaka <pierre.krieger1708@gmail.com>2015-01-15 20:26:24 +0100
committertomaka <pierre.krieger1708@gmail.com>2015-01-15 20:26:24 +0100
commit1e2248a441a5b0c70078eb6055266f190ac23bea (patch)
tree8c44feee956ca3686e5f189e49b391fc819d4fa9 /src
parent22a27767d543a3b00a2b4f50b3ef92ebb8b82409 (diff)
parent7652cc58607bc03bbb57f75ad418f8ec87b11541 (diff)
downloadglutin-1e2248a441a5b0c70078eb6055266f190ac23bea.tar.gz
glutin-1e2248a441a5b0c70078eb6055266f190ac23bea.zip
Merge pull request #202 from tomaka/osx-fix-attempt
Blind attempt to fix the OS/X build
Diffstat (limited to 'src')
-rw-r--r--src/osx/headless.rs18
-rw-r--r--src/osx/mod.rs26
-rw-r--r--src/osx/monitor.rs6
3 files changed, 25 insertions, 25 deletions
diff --git a/src/osx/headless.rs b/src/osx/headless.rs
index 39c8f50..ab3c341 100644
--- a/src/osx/headless.rs
+++ b/src/osx/headless.rs
@@ -24,8 +24,8 @@ static mut framebuffer: u32 = 0;
static mut texture: u32 = 0;
pub struct HeadlessContext {
- width: uint,
- height: uint,
+ width: usize,
+ height: usize,
context: id,
}
@@ -34,13 +34,13 @@ impl HeadlessContext {
let (width, height) = builder.dimensions;
let context = unsafe {
let attributes = [
- NSOpenGLPFADoubleBuffer as uint,
- NSOpenGLPFAClosestPolicy as uint,
- NSOpenGLPFAColorSize as uint, 24,
- NSOpenGLPFAAlphaSize as uint, 8,
- NSOpenGLPFADepthSize as uint, 24,
- NSOpenGLPFAStencilSize as uint, 8,
- NSOpenGLPFAOffScreen as uint,
+ NSOpenGLPFADoubleBuffer as usize,
+ NSOpenGLPFAClosestPolicy as usize,
+ NSOpenGLPFAColorSize as usize, 24,
+ NSOpenGLPFAAlphaSize as usize, 8,
+ NSOpenGLPFADepthSize as usize, 24,
+ NSOpenGLPFAStencilSize as usize, 8,
+ NSOpenGLPFAOffScreen as usize,
0
];
diff --git a/src/osx/mod.rs b/src/osx/mod.rs
index 7b362ba..e7cbe42 100644
--- a/src/osx/mod.rs
+++ b/src/osx/mod.rs
@@ -51,7 +51,7 @@ struct DelegateState<'a> {
is_closed: bool,
context: id,
view: id,
- handler: Option<fn(uint, uint)>,
+ handler: Option<fn(usize, usize)>,
}
pub struct Window {
@@ -59,7 +59,7 @@ pub struct Window {
window: id,
context: id,
delegate: id,
- resize: Option<fn(uint, uint)>,
+ resize: Option<fn(usize, usize)>,
is_closed: Cell<bool>,
}
@@ -128,7 +128,7 @@ extern fn window_did_resize(this: id, _: id) -> id {
match state.handler {
Some(handler) => {
let rect = NSView::frame(state.view);
- (handler)(rect.size.width as uint, rect.size.height as uint);
+ (handler)(rect.size.width as usize, rect.size.height as usize);
}
None => {}
}
@@ -137,7 +137,7 @@ extern fn window_did_resize(this: id, _: id) -> id {
}
impl Window {
- fn new_impl(dimensions: Option<(uint, uint)>, title: &str, monitor: Option<MonitorID>,
+ fn new_impl(dimensions: Option<(u32, u32)>, title: &str, monitor: Option<MonitorID>,
vsync: bool, visible: bool) -> Result<Window, CreationError> {
let app = match Window::create_app() {
Some(app) => app,
@@ -210,7 +210,7 @@ impl Window {
}
}
- fn create_window(dimensions: (uint, uint), title: &str, monitor: Option<MonitorID>) -> Option<id> {
+ fn create_window(dimensions: (u32, u32), title: &str, monitor: Option<MonitorID>) -> Option<id> {
unsafe {
let scr_frame = match monitor {
Some(_) => {
@@ -316,24 +316,24 @@ impl Window {
pub fn hide(&self) {
}
- pub fn get_position(&self) -> Option<(int, int)> {
+ pub fn get_position(&self) -> Option<(isize, isize)> {
unimplemented!()
}
- pub fn set_position(&self, _x: int, _y: int) {
+ pub fn set_position(&self, _x: isize, _y: isize) {
unimplemented!()
}
- pub fn get_inner_size(&self) -> Option<(uint, uint)> {
+ pub fn get_inner_size(&self) -> Option<(u32, u32)> {
let rect = unsafe { NSView::frame(self.view) };
- Some((rect.size.width as uint, rect.size.height as uint))
+ Some((rect.size.width as u32, rect.size.height as u32))
}
- pub fn get_outer_size(&self) -> Option<(uint, uint)> {
+ pub fn get_outer_size(&self) -> Option<(u32, u32)> {
unimplemented!()
}
- pub fn set_inner_size(&self, _x: uint, _y: uint) {
+ pub fn set_inner_size(&self, _x: u32, _y: u32) {
unimplemented!()
}
@@ -381,7 +381,7 @@ impl Window {
NSMouseMoved => {
let window_point = event.locationInWindow();
let view_point = self.view.convertPoint_fromView_(window_point, nil);
- events.push_back(MouseMoved((view_point.x as int, view_point.y as int)));
+ events.push_back(MouseMoved((view_point.x as i32, view_point.y as i32)));
},
NSKeyDown => {
let received_c_str = event.characters().UTF8String();
@@ -488,7 +488,7 @@ impl Window {
::Api::OpenGl
}
- pub fn set_window_resize_callback(&mut self, callback: Option<fn(uint, uint)>) {
+ pub fn set_window_resize_callback(&mut self, callback: Option<fn(usize, usize)>) {
self.resize = callback;
}
diff --git a/src/osx/monitor.rs b/src/osx/monitor.rs
index e23336f..912c02d 100644
--- a/src/osx/monitor.rs
+++ b/src/osx/monitor.rs
@@ -12,7 +12,7 @@ pub fn get_available_monitors() -> RingBuf<MonitorID> {
display::CGGetActiveDisplayList(max_displays,
&mut active_displays[0],
&mut display_count);
- for i in range(0u, display_count as uint) {
+ for i in range(0us, display_count as usize) {
monitors.push_back(MonitorID(active_displays[i]));
}
}
@@ -35,12 +35,12 @@ impl MonitorID {
Some(format!("Monitor #{}", screen_num))
}
- pub fn get_dimensions(&self) -> (uint, uint) {
+ pub fn get_dimensions(&self) -> (u32, u32) {
let MonitorID(display_id) = *self;
let dimension = unsafe {
let height = display::CGDisplayPixelsHigh(display_id);
let width = display::CGDisplayPixelsWide(display_id);
- (width as uint, height as uint)
+ (width as u32, height as u32)
};
dimension
}