Hi folks, I have a Low level idea here: I want to ...
# compose-desktop
s
Hi folks, I have a Low level idea here: I want to do a Server Side rendering of Compose Desktop app using Skiko Software render, the idea is to send the Skia Canvas output through the network, this could be doable? Any one can give me some ideas in how can I accomplish this?
s
Out of curiosity - what’s your use case? You’d have to implement something similar to a RecordingCanvas I think. You’d have to save all canvas operations per frame, serialize them, and then re-draw them on the client.
s
RecordingCanvas seems to be a Android specific API. also I'm looking for something that does not create any windowing on the system.
The PoC project that I'm trying to do is use Compose Desktop to create Interactive Menus in Minecraft from Server side, not change anything in the client.
s
yes - you can’t use Recording Canvas, but you’d have to implement a canvas wrapper that did something similar. It’d be a large amount of work.
The other part that increases complexity significantly is handling UI events, like clicks. It’s not just drawing. It’d be very complicated. You’d have more success defining a model for the menus on the server, and then generating / drawing it on the client based on the model provided by the server.
s
The problem is that I do not have access to do client, this UI is based on some tricks in the Minecraft. btw, can you share your approach on Canvas Wrapper?
s
I’ve never done this. Android offers an API where you can precalculate and save all your drawing steps. I used this for an svg animation once 8 years ago. What you are talking about is significantly more complicated
m
This tool https://www.jpro.one/ follows such an approach for JavaFX. It works nicely. Just tried it on my own project a couple of days ago.
t
It would also be interesting what library/tool jetbrains projektor uses to achieve a simular thing 🤔
1