Reputation: 74
I'm currently trying to create a game engine in rust. I have a rust Game
module that generate a framebuffer of pixels every frame. I then display it directly to the screen in the case of the game.
However, I also want to have a game editor interface, so I have another rust project that uses the Game
as an external module. The goal of the editor is to display the framebuffer to the screen, with an external interface to modify the game states.
For the editor, I could use tools such as Qt, ImGui, ... but I wanted to use a web-based interface for easier UI design, so I chose to use Tauri. The problem that I face is that to display the game current frame in Tauri (using React), I need to pass the Framebuffer from the Game
module (and so the server) to the client.
To do that, I'm currently using WebSockets to pass data as a binary array of pixels from the server to the client. The problem is that this method is too slow and so I don't have enough framerate. Do you know a better way or maybe module do achieve that (still based on web-like interfaces) ?
Upvotes: 3
Views: 476
Reputation: 46
PubNub offers a Rust SDK that allows you to connect and integreate real-time features that power a lot of different types of games. Sending/receiving data can be anything you'd like and the platform itself has extremely low latency. It's free to try and very easy to integrate.
You can also check out a guide to see other alternatives to WebSockets other than PubNub, in case you want to explore more options. Hope this helps!
Upvotes: 0