Bevy with custom keyboard and display

I just started looking at the Bevy game engine, I'm not sure what I think, but I am intrigued so far. It looks like it might allow doing simple things to be…simple.

Specific question: I am wondering about using Bevy to drive a dedicated non-standard custom display for output, and connected to a custom non-standard keypad for input. Any idea where best to hook such beasts into Bevy?

My initial guess is I want to extend the winit code.

But to have Bevy rendering into an X-by-Y frame buffer, that then gets mapped through tons of abstractions (that support lots of different platforms that support overlapping windows on configurable plugin displays) only to have the pixels finally land in a dedicated X-by-Y frame buffer…might not be the simplest way to do it.

I am wondering whether there might be someplace simpler to hook in, earlier in the process. Maybe there is a way to write a simple Bevy resource that the render is told to write to and another resource that provides key events to the Bevy system…?

Suggestions on which way to point my Bevy-ignorant self?

Thanks,

-kb

Looking at code…

I suspect for input I want to create a Bevy resource somewhat on the model of bevy/crates/bevy_input/src/gamepad.rs but that reads my input.

Donno yet.

-kb

Is this something you can clarify? Non-standard hardware can mean a lot of things.

My first guess is that you are talking about an embedded system with a small LCD and a USB keyboard. If this is close, you will want to start by looking for existing crates for the specific hardware in question. There are a ton of them, and I won't even hazard a guess which might apply. For instance: ‘lcd’ search // Lib.rs or ‘oled’ search // Lib.rs.

Any more information would be helpful to give you better guidance.

When I say non-standard, I mean non-standard, pretty bare-metal. The "display" is individual LEDs accessed over SPI. (Yes, I realize it is a perversely low-resolution "display".) The keyboard is switches connected to GPIO lines. All connected to a Raspberry Pi Zero.

I know how to talk to this hardware, I'm wondering what the various options are for hooking into Bevy. I'm thinking I am on a path to figure out the keyboard part.

For video, if I can find a spot where I can give Bevy a RAM buffer and have it write pixel values there, I would be happy.

Thanks,

-kb

P.S. This might be exactly what I am looking for: A walkthrough of bevy's rendering · bevyengine/bevy · Discussion #9897 · GitHub, I have some reading to do.

For the most part, bevy expects the platform to have a GPU. It might be possible to use CPU rendering through OpenGL if you install Mesa on the Pi Zero.

An example that uses bevy in a headless environment might be the right place to get started. Something like this one: bevy_gaussian_splatting/examples/headless.rs at main · mosure/bevy_gaussian_splatting (github.com) It renders to a texture, which is the term used in graphics for your frame buffer idea.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.