platform api unification: support Windows
This commit is contained in:
parent
4ba64d8f86
commit
f9226c366e
1 changed files with 3 additions and 3 deletions
|
@ -72,7 +72,7 @@ unsafe extern "system" fn wnd_proc<H: WindowHandler>(
|
||||||
let win_ptr = GetWindowLongPtrA(hwnd, GWLP_USERDATA) as *const c_void;
|
let win_ptr = GetWindowLongPtrA(hwnd, GWLP_USERDATA) as *const c_void;
|
||||||
if !win_ptr.is_null() {
|
if !win_ptr.is_null() {
|
||||||
let window_state = &*(win_ptr as *const RefCell<WindowState<H>>);
|
let window_state = &*(win_ptr as *const RefCell<WindowState<H>>);
|
||||||
let mut window = Window { hwnd };
|
let mut window = crate::window::Window(Window { hwnd });
|
||||||
|
|
||||||
match msg {
|
match msg {
|
||||||
WM_MOUSEMOVE => {
|
WM_MOUSEMOVE => {
|
||||||
|
@ -177,7 +177,7 @@ impl WindowHandle {
|
||||||
impl Window {
|
impl Window {
|
||||||
pub fn open<H, B>(options: WindowOpenOptions, build: B) -> WindowHandle
|
pub fn open<H, B>(options: WindowOpenOptions, build: B) -> WindowHandle
|
||||||
where H: WindowHandler,
|
where H: WindowHandler,
|
||||||
B: FnOnce(&mut Window) -> H,
|
B: FnOnce(&mut crate::window::Window) -> H,
|
||||||
B: Send + 'static
|
B: Send + 'static
|
||||||
{
|
{
|
||||||
unsafe {
|
unsafe {
|
||||||
|
@ -240,7 +240,7 @@ impl Window {
|
||||||
);
|
);
|
||||||
// todo: manage error ^
|
// todo: manage error ^
|
||||||
|
|
||||||
let mut window = Window { hwnd };
|
let mut window = crate::window::Window(Window { hwnd });
|
||||||
|
|
||||||
let handler = build(&mut window);
|
let handler = build(&mut window);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue