Fixed Unix incorrect get_window_handle

Closes #18
This commit is contained in:
Daniel Collin 2016-04-25 18:11:50 +02:00
parent 5d9ca9e585
commit d000e199e5
2 changed files with 9 additions and 1 deletions

View file

@ -495,3 +495,10 @@ unsigned int mfb_get_screen_size() {
return (s_screen_width << 16) | s_screen_height;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void* mfb_get_window_handle(void* window) {
WindowInfo* win = (WindowInfo*)window;
return (void*)(uintptr_t)win->window;
}

View file

@ -32,6 +32,7 @@ extern {
fn mfb_set_shared_data(window: *mut c_void, target: *mut SharedData);
fn mfb_should_close(window: *mut c_void) -> i32;
fn mfb_get_screen_size() -> u32;
fn mfb_get_window_handle(window: *mut c_void) -> *mut c_void;
}
#[derive(Default)]
@ -224,7 +225,7 @@ impl Window {
#[inline]
pub fn get_window_handle(&self) -> *mut raw::c_void {
self.window_handle as *mut raw::c_void
unsafe { mfb_get_window_handle(self.window_handle) as *mut raw::c_void }
}
#[inline]