mirror of
https://github.com/italicsjenga/rust_minifb.git
synced 2025-01-11 03:21:32 +11:00
parent
5d9ca9e585
commit
d000e199e5
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Reference in a new issue