mirror of
https://github.com/italicsjenga/rust_minifb.git
synced 2025-01-26 02:36:32 +11:00
parent
5d9ca9e585
commit
d000e199e5
2 changed files with 9 additions and 1 deletions
|
@ -495,3 +495,10 @@ unsigned int mfb_get_screen_size() {
|
||||||
return (s_screen_width << 16) | s_screen_height;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@ extern {
|
||||||
fn mfb_set_shared_data(window: *mut c_void, target: *mut SharedData);
|
fn mfb_set_shared_data(window: *mut c_void, target: *mut SharedData);
|
||||||
fn mfb_should_close(window: *mut c_void) -> i32;
|
fn mfb_should_close(window: *mut c_void) -> i32;
|
||||||
fn mfb_get_screen_size() -> u32;
|
fn mfb_get_screen_size() -> u32;
|
||||||
|
fn mfb_get_window_handle(window: *mut c_void) -> *mut c_void;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
|
@ -224,7 +225,7 @@ impl Window {
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn get_window_handle(&self) -> *mut raw::c_void {
|
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]
|
#[inline]
|
||||||
|
|
Loading…
Add table
Reference in a new issue