-
Notifications
You must be signed in to change notification settings - Fork 4
Rendering from Rust's wgpu and Pyo3 #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Digging at the code, the answer is that To provide the same context from Rust, I must implement the I'll document my learnings as I go and submit a PR expanding the docs when I finish the integration. |
Hi @rafaelbeckel ! To answer your first question, you can call the To hook up your own render library, you indeed need to implement the Also have a look at the implementation in wgpu-py: |
Thanks for pointing out the implementation! I managed to get the Window handle from It could be due to AppKit requiring it to be created in the main thread or something else. I'm investigating it, but as far as RenderCanvas' scope goes, this issue is solved. I have another question: When exactly is the I created the hook in my library as a top-level function, but it's never called. When I call Edit:Oh, I got it. The hook is called when I don't specify the class in
This allows me to implement multiple initializers and set a default one. |
The mean reason for the hook is that you can tell your users to just use |
Uh oh!
There was an error while loading. Please reload this page.
Hey team!
I'm writing a rendering library in Rust and want to implement Python support for it with Pyo3.
I'm reading
rendercanvas
's documentation and trying to understand how to get a Window handle in Rust from a RenderCanvas instance from Python.My library controls the wgpu context, so I'm trying to achieve surface creation from a Window handle in Rust. I can already access the RenderCanvas instance from Rust and call its methods. Is there any method in the API that provides a reference to the internal Window handle?
Can I somehow get it from the built-in get_context("wgpu")? Where does this "wgpu" context come from? Will it conflict with my internal wgpu context? Should I implement the
ContextInterface
in my library instead?Thanks in advance!
The text was updated successfully, but these errors were encountered: