https://kotlinlang.org logo
#gamedev
Title
# gamedev
m

Marc

02/20/2023, 8:38 AM
Has anybody played with building a 2d game with compose or maybe adapt one of the existing kotlin engines (minigdx, littlekt, korge) to render in a compose canvas? Any suggested approach? Having something like flame for flutter would be amazing 🙂
m

Michał Kalinowski

02/20/2023, 4:19 PM
It's a bit more complicated, Compose Desktop perform most rendering on CPU. And that's the reason why it's hardly suitable for anything except the ui. On android you can quite easy inject OpenGL ES/Vulkan when for PC almost nothing has moved to ensure better integration with lwjgl, or to ensure the support for the OpenGL/Vulkan/Directx contex. However, if you would like to do something in these areas then you can start here: https://github.com/JetBrains/compose-jb/tree/master/experimental/lwjgl-integration
However, if you don't want to play with compose magic and want to make your own little engine then I can recommend libgdx(has some cool games in it like Slay the Spire) + lwjgl
m

Marc

02/20/2023, 4:33 PM
Understood… i did a small gdx game back in the day 🤔
Id like something more multiplatform though, maybe korge is worth a shot
m

Michał Kalinowski

02/20/2023, 4:39 PM
From what I have try a one year ago, korge is a bit too new and too limited. But maybe something has changed. For multiplatform game(that's not kotlin multiplatform) libgdx should be fine. I, for example make my own game in Lwjgl+Vulkan + imgui. Can be built on Linux/Windows/Macos, maybe I will add support for Android someday
m

Marc

02/20/2023, 4:40 PM
any thoughts on others like littlekt? a bit worried of new stuff as maybe if stops being maintained one day
m

Michał Kalinowski

02/20/2023, 4:41 PM
I don't know the others :((, but maybe I'll take a look
7 Views