mirror of
https://github.com/italicsjenga/rust_minifb.git
synced 2025-01-11 03:21:32 +11:00
Merge branch 'master' of https://github.com/emoon/rust_minifb
This commit is contained in:
commit
f848eaaee5
|
@ -2,6 +2,11 @@
|
||||||
|
|
||||||
This project follows semantic versioning.
|
This project follows semantic versioning.
|
||||||
|
|
||||||
|
### v0.8.1 (2016-07-07)
|
||||||
|
|
||||||
|
- [fixed] Character callback wouldn't get called on Mac and Linux
|
||||||
|
- [fixed] Resize cursors on Windows was swapped
|
||||||
|
|
||||||
### v0.8.0 (2016-06-24)
|
### v0.8.0 (2016-06-24)
|
||||||
|
|
||||||
- [added] ```window.set_title``` Can now change title after creation
|
- [added] ```window.set_title``` Can now change title after creation
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "minifb"
|
name = "minifb"
|
||||||
version = "0.8.0"
|
version = "0.8.1"
|
||||||
license = "MIT/Apache-2.0"
|
license = "MIT/Apache-2.0"
|
||||||
authors = ["Daniel Collin <daniel@collin.com>"]
|
authors = ["Daniel Collin <daniel@collin.com>"]
|
||||||
description = "Cross-platform window setup with optional bitmap rendering"
|
description = "Cross-platform window setup with optional bitmap rendering"
|
||||||
|
|
|
@ -14,7 +14,7 @@ Usage
|
||||||
```toml
|
```toml
|
||||||
# Cargo.toml
|
# Cargo.toml
|
||||||
[dependencies]
|
[dependencies]
|
||||||
minifb = "0.8.0"
|
minifb = "0.8.1"
|
||||||
```
|
```
|
||||||
|
|
||||||
Example
|
Example
|
||||||
|
|
|
@ -145,6 +145,11 @@ fn update_key_state(window: &mut Window, wparam: u32, state: bool) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn char_down(window: &mut Window, code_point: u32) {
|
||||||
|
if let Some(ref mut callback) = window.key_handler.key_callback {
|
||||||
|
callback.add_char(code_point);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(target_arch = "x86_64")]
|
#[cfg(target_arch = "x86_64")]
|
||||||
unsafe fn set_window_long(window: winapi::HWND, data: winapi::LONG_PTR) -> winapi::LONG_PTR {
|
unsafe fn set_window_long(window: winapi::HWND, data: winapi::LONG_PTR) -> winapi::LONG_PTR {
|
||||||
|
@ -203,6 +208,14 @@ unsafe extern "system" fn wnd_proc(window: winapi::HWND,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
winapi::winuser::WM_CHAR => {
|
||||||
|
char_down(wnd, wparam as u32);
|
||||||
|
}
|
||||||
|
|
||||||
|
winapi::winuser::WM_SYSCHAR => {
|
||||||
|
char_down(wnd, wparam as u32);
|
||||||
|
}
|
||||||
|
|
||||||
winapi::winuser::WM_LBUTTONDOWN => {
|
winapi::winuser::WM_LBUTTONDOWN => {
|
||||||
wnd.mouse.state[0] = true
|
wnd.mouse.state[0] = true
|
||||||
}
|
}
|
||||||
|
@ -463,8 +476,8 @@ impl Window {
|
||||||
user32::LoadCursorW(ptr::null_mut(), winuser::IDC_CROSS),
|
user32::LoadCursorW(ptr::null_mut(), winuser::IDC_CROSS),
|
||||||
user32::LoadCursorW(ptr::null_mut(), winuser::IDC_HAND),
|
user32::LoadCursorW(ptr::null_mut(), winuser::IDC_HAND),
|
||||||
user32::LoadCursorW(ptr::null_mut(), winuser::IDC_HAND),
|
user32::LoadCursorW(ptr::null_mut(), winuser::IDC_HAND),
|
||||||
user32::LoadCursorW(ptr::null_mut(), winuser::IDC_SIZENS),
|
|
||||||
user32::LoadCursorW(ptr::null_mut(), winuser::IDC_SIZEWE),
|
user32::LoadCursorW(ptr::null_mut(), winuser::IDC_SIZEWE),
|
||||||
|
user32::LoadCursorW(ptr::null_mut(), winuser::IDC_SIZENS),
|
||||||
user32::LoadCursorW(ptr::null_mut(), winuser::IDC_SIZEALL),
|
user32::LoadCursorW(ptr::null_mut(), winuser::IDC_SIZEALL),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue