update deps
This commit is contained in:
parent
e31a11f1c7
commit
0d20459065
28
Cargo.toml
28
Cargo.toml
|
@ -19,16 +19,20 @@ default = ["opengl"]
|
||||||
opengl = ["uuid", "x11/glx"]
|
opengl = ["uuid", "x11/glx"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
keyboard-types = { version = "0.6.1", default-features = false }
|
keyboard-types = { version = "0.7.0", default-features = false }
|
||||||
raw-window-handle = "0.6"
|
raw-window-handle = "0.6.2"
|
||||||
|
|
||||||
[target.'cfg(target_os="linux")'.dependencies]
|
[target.'cfg(target_os="linux")'.dependencies]
|
||||||
x11rb = { version = "0.13.0", features = ["cursor", "resource_manager", "allow-unsafe-code"] }
|
x11rb = { version = "0.13.1", features = [
|
||||||
x11 = { version = "2.21", features = ["xlib", "xlib_xcb"] }
|
"cursor",
|
||||||
nix = "0.22.0"
|
"resource_manager",
|
||||||
|
"allow-unsafe-code",
|
||||||
|
] }
|
||||||
|
x11 = { version = "2.21.0", features = ["xlib", "xlib_xcb"] }
|
||||||
|
nix = { version = "0.29.0", features = ["poll"] }
|
||||||
|
|
||||||
[target.'cfg(target_os="windows")'.dependencies]
|
[target.'cfg(target_os="windows")'.dependencies]
|
||||||
winapi = { version = "0.3.8", features = [
|
winapi = { version = "0.3.9", features = [
|
||||||
"libloaderapi",
|
"libloaderapi",
|
||||||
"winuser",
|
"winuser",
|
||||||
"windef",
|
"windef",
|
||||||
|
@ -42,17 +46,17 @@ winapi = { version = "0.3.8", features = [
|
||||||
"shellapi",
|
"shellapi",
|
||||||
"winerror",
|
"winerror",
|
||||||
] }
|
] }
|
||||||
uuid = { version = "0.8", features = ["v4"], optional = true }
|
uuid = { version = "1.10.0", features = ["v4"], optional = true }
|
||||||
|
|
||||||
[target.'cfg(target_os="macos")'.dependencies]
|
[target.'cfg(target_os="macos")'.dependencies]
|
||||||
cocoa = "0.24.0"
|
cocoa = "0.26.0"
|
||||||
core-foundation = "0.9.1"
|
core-foundation = "0.10.0"
|
||||||
objc = "0.2.7"
|
objc = "0.2.7"
|
||||||
uuid = { version = "0.8", features = ["v4"] }
|
uuid = { version = "1.10.0", features = ["v4"] }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
rtrb = "0.2"
|
rtrb = "0.3.1"
|
||||||
softbuffer = "0.3.4"
|
softbuffer = "0.4.5"
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
members = ["examples/render_femtovg"]
|
members = ["examples/render_femtovg"]
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
msrv = '1.59'
|
msrv = '1.63'
|
||||||
check-private-items = true
|
check-private-items = true
|
||||||
|
|
|
@ -86,7 +86,7 @@ impl GlContext {
|
||||||
|
|
||||||
// Create temporary window and context to load function pointers
|
// Create temporary window and context to load function pointers
|
||||||
|
|
||||||
let class_name_str = format!("raw-gl-context-window-{}", uuid::Uuid::new_v4().to_simple());
|
let class_name_str = format!("raw-gl-context-window-{}", uuid::Uuid::new_v4().simple());
|
||||||
let mut class_name: Vec<WCHAR> = OsStr::new(&class_name_str).encode_wide().collect();
|
let mut class_name: Vec<WCHAR> = OsStr::new(&class_name_str).encode_wide().collect();
|
||||||
class_name.push(0);
|
class_name.push(0);
|
||||||
|
|
||||||
|
|
|
@ -138,7 +138,7 @@ unsafe fn create_view_class() -> &'static Class {
|
||||||
// the class was stored in a OnceCell after creation. This way, we didn't
|
// the class was stored in a OnceCell after creation. This way, we didn't
|
||||||
// have to recreate it each time a view was opened, but now we don't leave
|
// have to recreate it each time a view was opened, but now we don't leave
|
||||||
// any class definitions lying around when the plugin is closed.
|
// any class definitions lying around when the plugin is closed.
|
||||||
let class_name = format!("BaseviewNSView_{}", Uuid::new_v4().to_simple());
|
let class_name = format!("BaseviewNSView_{}", Uuid::new_v4().simple());
|
||||||
let mut class = ClassDecl::new(&class_name, class!(NSView)).unwrap();
|
let mut class = ClassDecl::new(&class_name, class!(NSView)).unwrap();
|
||||||
|
|
||||||
class.add_method(
|
class.add_method(
|
||||||
|
|
|
@ -5,7 +5,7 @@ use crate::{
|
||||||
WindowInfo,
|
WindowInfo,
|
||||||
};
|
};
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::os::fd::AsRawFd;
|
use std::os::fd::AsFd;
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
use x11rb::connection::Connection;
|
use x11rb::connection::Connection;
|
||||||
use x11rb::protocol::Event as XEvent;
|
use x11rb::protocol::Event as XEvent;
|
||||||
|
@ -68,8 +68,6 @@ impl EventLoop {
|
||||||
pub fn run(&mut self) -> Result<(), Box<dyn Error>> {
|
pub fn run(&mut self) -> Result<(), Box<dyn Error>> {
|
||||||
use nix::poll::*;
|
use nix::poll::*;
|
||||||
|
|
||||||
let xcb_fd = self.window.xcb_connection.conn.as_raw_fd();
|
|
||||||
|
|
||||||
let mut last_frame = Instant::now();
|
let mut last_frame = Instant::now();
|
||||||
self.event_loop_running = true;
|
self.event_loop_running = true;
|
||||||
|
|
||||||
|
@ -86,14 +84,14 @@ impl EventLoop {
|
||||||
last_frame = Instant::max(next_frame, Instant::now() - self.frame_interval);
|
last_frame = Instant::max(next_frame, Instant::now() - self.frame_interval);
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut fds = [PollFd::new(xcb_fd, PollFlags::POLLIN)];
|
|
||||||
|
|
||||||
// Check for any events in the internal buffers
|
// Check for any events in the internal buffers
|
||||||
// before going to sleep:
|
// before going to sleep:
|
||||||
self.drain_xcb_events()?;
|
self.drain_xcb_events()?;
|
||||||
|
|
||||||
|
let mut fds = [PollFd::new(self.window.xcb_connection.conn.as_fd(), PollFlags::POLLIN)];
|
||||||
|
|
||||||
// FIXME: handle errors
|
// FIXME: handle errors
|
||||||
poll(&mut fds, next_frame.duration_since(Instant::now()).subsec_millis() as i32)
|
poll(&mut fds, next_frame.duration_since(Instant::now()).subsec_millis() as u16)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
if let Some(revents) = fds[0].revents() {
|
if let Some(revents) = fds[0].revents() {
|
||||||
|
|
Loading…
Reference in a new issue