Defold -> Retro handhelds?

Just wondering if anyone has successfully targeted retro style handhelds such as Anbernic or Trumi?
And if so which ones? These run versions of Linux or Android so I guess it is doable, assuming input bindings can be done.

For Android handhelds, which are much more expensive than Linux-based, you can build an Android version of the game, install it - it will work just fine.

For Linux handhelds, things are a bit different. First of all, the operating system is Linux, and the devices are built on ARM chips. Accordingly, Defold should support the Linux ARM 32 or 64 bit to start with.

Thanks to @JCash, in the next version 1.9.6 it will be possible to build the engine from source code for Linux ARM64 (Aarch64) by yourself. But the engine still requires:

  • desktop OpenGL.
  • X11 server.

Linux-handhelds based on Rockchip or Allwinner chips support only OpenGL ES and/or Vulkan. Plus, most Linux-based OS builds do not include an X11 server, but require direct image output via “DRM” to maximize performance from the GPU. (Rocknix OS for Rockchip systems does have an X11 server, but this is an exception)

To sum up. To play your own games on most Linux handhelds you need from Defold:

  • switch desktop OpenGL to OpenGL ES, but only for this platform. Support this issue! I guess this is easy to do when @jhonny.goransson will replace GLFW with version 3 for Linux as well.
  • add DRM support. This is a much much more complicated task - I will write a later issue, to discuss variants.

I myself really want to see my games on these devices (I have a Powkiddy RGB30). But since the platform is obviously not commercial, adding support for it depends more on the enthusiasm of the Defold community! :raised_hands: Not everything must be done by the Defold team alone, right?

4 Likes

I don’t think I will be able to build the engine from source any time soon:-) And I definitely don’t wish to invent work for anyone else to do, especially the Defold team. There are so many interesting looking low priced handhelds, I could spend all night researching.

Edit: Right so a Powkiddy RGB30 with Rocknix OS (or one of the others in the Rocknix support list) has a chance once GLFW gets to 3.

Yes, it has a chance! Plus, there is a great website with a catalog of those handhelds - for example, a comparison of RGB30 with the recent handheld by Anbernic - PowKiddy RGB30 vs. RG Cube XX Specs Comparison - Retro Catalog

1 Like

As @JCash wrote, as soon as Github adds ARM support to their CI (promised in the news by the end of this year), it will be possible to get a pre-built Defold binary for Linux ARM64. And probably to the cloud build server too.

P.S. In fact, it’s easy to build the engine from source, on Linux x86 at least. Plus, I described here how to cross-compile it from your x86 machine, for example.

1 Like

I am on Linux so I might give your instructions a go when I am feeling courageous. You make it sound so easy! And I am still on Ubuntu 22.04.5 LTS, even though it keeps suggesting I upgrade to 24.

1 Like

I have researched the question, i.e. does GLFW 3 work on Rocknix or not. Yes! Though I had to dive deep into the GLFW and gtk source codes, but I was able to find the answer.
Basically, Rocknix may have Wayland or X11 depending on the device. On the RGB30 it will be Wayland.
I tried to build an example from GLFW for GL ES (i.e. it’s not a Defold game, just an example from GLFW 3), but it didn’t work right away, unfortunately. It turns out that GLFW tries to create a window using libdecor, and on Rocknix there is some problem with that. If you disable the libdecor definition, the example starts and works!

Anyway, I’ll leave it here - in case it comes in handy.

glfwInitHint(GLFW_WAYLAND_LIBDECOR, GLFW_WAYLAND_DISABLE_LIBDECOR);

4 Likes