Win a copy of Raising Young Coders: A Parent’s Guide to Teaching Programming at Home this week in the General Computing forum!
Forums Login/signup

Render graphics from Rust into JavaFX/AWT window

+Pie Number of slices to send: Send
I've got a small graphics processing application that I'm writing in Rust. It has various graphics backends (Metal, Vulkan, D3D) depending on the underlying OS. I'd like to create a simple application in Java (probably JavaFX but I could use AWT) as a proof of concept to allow a user to make simple tweaks to the graphics. However, I'm unsure about how to approach this interop. I don't want (or think I need to use LWJGL) because the Rust library handles this. What I really want is to:

1. Create a window.
2. Assign a portion of that window to be the render context for my Rust library.
3. Assign the other parts of that window to be my editing widgets.
4. Be able to detect mouse clicks in (2) to select rendered objects and alter them with (3).

I expect there is some amount of FFI work that needs to be done, which I know I'll need to look into. Where I'm really lost is how I hook up the graphics so that the Java app displays the rendered image and is able to process input.

Any thoughts or suggestions about how to procede?

reply
reply
This thread has been viewed 344 times.
Similar Threads
Insider's Guide to Mixing Swing and JavaFX
End-to-end testing with LWJGL
Threads won't start when starting jar file
In Game Opengl GUI
New here, 3D game engine question
More...

All times above are in ranch (not your local) time.
The current ranch time is
Jun 27, 2025 00:55:08.