Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 21 16:47
    abowerman edited #1338
  • Nov 21 14:58
    chrisduerr closed #1338
  • Nov 21 05:47
    abowerman edited #1338
  • Nov 21 05:42
    abowerman opened #1338
  • Nov 12 13:21
    sztomi commented #1337
  • Nov 12 01:17
    chrisduerr labeled #1337
  • Nov 12 01:16
    chrisduerr commented #1337
  • Nov 11 23:38
    sztomi commented #1337
  • Nov 11 23:13
    chrisduerr commented #1337
  • Nov 11 21:39
    sztomi commented #1337
  • Nov 11 21:16
    chrisduerr commented #1337
  • Nov 11 21:12
    sztomi commented #1337
  • Nov 11 19:05
    chrisduerr commented #1337
  • Nov 11 12:16
    sztomi opened #1337
  • Nov 05 20:42
    chrisduerr closed #1335
  • Nov 05 20:42
    chrisduerr commented #1335
  • Nov 05 05:46
    huntiep commented #1335
  • Nov 04 23:42
    chrisduerr commented #1335
  • Nov 04 09:04
    huntiep commented #1335
  • Nov 03 22:31
    BearWithTie commented #1336
matrixbot
@matrixbot
fuzbuz on Freenode Because I don't control where the window comes from. I am given a window and am asked to render to it.
fuzbuz on Freenode If I can somehow convert the raw handle into a winit window, then it fits into the ecosystem nicely. If not, I suppose I can work around it.
UndeadLeech on Freenode Which library gives you that window handle?
fuzbuz on Freenode I'm 95% sure it's coming from Qt
UndeadLeech on Freenode Shouldn't you use Qt then?
fuzbuz on Freenode Nope. For multiple reasons: I really dislike Qt, I'd rather work in Rust, and the rendering library is already written in Rust and I don't feel any need to rewrite it just to satisfy a single use of the library.
UndeadLeech on Freenode If you really dislike Qt, why are you letting it create windows for you?
fuzbuz on Freenode I'm not. Someone else is and then giving me the window handle.
UndeadLeech on Freenode Are you being held hostage?
fuzbuz on Freenode In the literal sense, no. I do like keeping my boss happy, though.
UndeadLeech on Freenode What exactly do you want winit to do for you?
matrixbot
@matrixbot
fuzbuz on Freenode The Rust code takes a winit Window as an argument for the rendering. If there's a nice way to turn a raw handle into a winit Window, I don't have to change the rendering library - it will just fit. If there's not a nice way, I can work around it.
fuzbuz on Freenode At some point the rendering code has to turn it back into a raw handle for OS reasons, I can just add a function that passes an already-raw-handle down to that level.
fuzbuz on Freenode But it would be nice if I didn't have to do that.
UndeadLeech on Freenode Is that a crate, or did you write the rendering library yourself? Fundamentally taking just a winit window for rendering doesn't make a ton of sense.
UndeadLeech on Freenode Winit's purpose is to manage your windows and window events. If you don't have winit manage your windows, there's little point in using it.
matrixbot
@matrixbot
fuzbuz on Freenode I have a rendering crate that is used in several Rust-only projects. The rendering crate takes a winit Window to provide the rendering context as the Rust-only projects use winit for managing the windows and window events. A new project, mostly in C++, wants to also use the rendering code and can provide me with a raw window handle.
fuzbuz on Freenode As I'm making the C FFI interface for the rendering crate, I need to either turn that raw handle into a winit Window or I need to make changes to the rendering to allow using raw handles. The former is cleaner but the latter isn't a problem.
fuzbuz on Freenode I'm just curious if there is a way to do the former that I am failing to discover by reading the docs
Keithcat1
@Keithcat1
Hi. I found winit the other day and it looks like a good alternative for SDL2. My question is, is it generally OK to run the event loop in another thread, send them back to the main thread and actually handle them there?
matrixbot
@matrixbot
UndeadLeech on Freenode If by generally you mean on all platforms, then no.
UndeadLeech on Freenode Which should be documented in winit's documentation.
Keithcat1
@Keithcat1
What happens if I try?
Keithcat1
@Keithcat1
If it's documented, it's not obvious
UndeadLeech on Freenode I don't see how it could be any more clear tbh.
Keithcat1
@Keithcat1
Oh thanks. But all that means is that I create the event loop on the main thread and then start a new thread.
matrixbot
@matrixbot
UndeadLeech on Freenode And then?
UndeadLeech on Freenode You're aware that EventLoop is !Send + !Sync, right?
Keithcat1
@Keithcat1
It seems to work if I run the event loop and send events to another thread.
matrixbot
@matrixbot
UndeadLeech on Freenode I mean you can of course move all the events without a lifetime.
UndeadLeech on Freenode But I don't see why you would ever do that.
UndeadLeech on Freenode Since that just increases latency.
matrixbot
@matrixbot

Ralith > <@freenode_fuzbuz:matrix.org> As I'm making the C FFI interface for the rendering crate, I need to either turn that raw handle into a winit Window or I need to make changes to the rendering to allow using raw handles. The former is cleaner but the latter isn't a problem.

the latter is definitely the idiomatic thing to do, fwiw; this is the problem raw-window-handle was intended to solve in the first place

matrixbot
@matrixbot
arturkovacs I'm trying to figure out how can I get my winit application to open files that the user double-clicks on macOS
arturkovacs Has anyone made a winit app that can do this?
matrixbot
@matrixbot
Ralith I don't know macos in particular, but on most platforms that works by associating your app with a file type in some platform-specific database, nothing to do with winit
matrixbot
@matrixbot
arturkovacs Yeah, not an issue, I can associate the filetype to my app but the problem relies in that macOS doesn't seem to use the program arguments to specify the file that the user selected. Instead there's an event that the application receives that tells the path to the files
matrixbot
@matrixbot
Ralith ah, interesting; might be a missing feature?
matrixbot
@matrixbot
UndeadLeech on Freenode arturkovacs: You sure it sends an event and doesn't reexecute the program?
matrixbot
@matrixbot
arturkovacs UndeadLeech: What I meant by event is that this function gets called: https://developer.apple.com/documentation/appkit/nsapplicationdelegate/1428612-application?language=objc
UndeadLeech on Freenode That seems unnecessarily complicated, so that's probably how it works on macOS, yes. :)
arturkovacs Haha. As I was looking around I found other callback that can be registered for essentially the same thing from what I could tell but this was the one that worked when I tested with a minimal Objective-C test app
arturkovacs * Haha. As I was looking around I found other callbacks that can be registered for essentially the same thing from what I could tell but this was the one that worked when I tested with a minimal Objective-C test app
matrixbot
@matrixbot
arturkovacs Based on the feedback I got so far it seems to me that this is a missing feature so I opened: rust-windowing/winit#1751
Chehui Chou
@deadshot465_gitlab
Will set_inner_size emit WindowEvent::Resized?
matrixbot
@matrixbot
UndeadLeech on Freenode IIRC "on some systems". I don't remember if it does it everywhere.
UndeadLeech on Freenode It certainly can emit it.
matrixbot
@matrixbot
ildar francesca, thank you for inviting me here
ildar Anyone using or aware of https://github.com/rust-windowing/android-ndk-rs/ ?