gsp_rs/gsp_core/gsp_window/
mod.rs

1
2extern crate libc;
3
4use libc::{c_char, uintptr_t};
5
6#[repr(C)]
7pub struct gwindow_event_t {
8    event_id: u8,
9    sub_id: u8,
10    data: u64
11}
12
13pub type gwindow_t = uintptr_t;
14pub type gwindow_event_callback_t = extern "C" fn(gwindow_t, gwindow_event_t);
15
16#[link(name = "GSPCore", kind = "dylib")]
17extern {
18    pub fn gsp_window_poll_events();
19    pub fn gsp_window_is_window_valid(window: gwindow_t) -> bool;
20    pub fn gsp_window_create_window() -> gwindow_t;
21    pub fn gsp_window_set_title(window: gwindow_t, title: *mut c_char);
22    pub fn gsp_window_set_event_callback(window: gwindow_t, event_callback: gwindow_event_callback_t);
23}
24