TASEmulators / freej2me-plus

A free J2ME emulator with libretro, awt and sdl2 frontends.
https://tasemulators.github.io/freej2me-plus/
Other
0 stars 0 forks source link

SDL Interface should behave like the Libretro core #8

Open AShiningRay opened 2 days ago

AShiningRay commented 2 days ago

What i mean by this is: SDL_interface should be loading freej2me-sdl.jar, not the other way around. This should allow, or at least help the SDL window be much more than, well, just a window. Most of libretro's code (especially in Java's side) could probably be just pasted over to Anbu with minor adjustments.

As for the interface, there are some lightweight GUI libraries such as kiss_sdl and nanogui-sdl which have very little dependencies outside of SDL (i think kiss_sdl has no external deps whatsoever) which should fit nicely into FreeJ2ME, as we only need a basic GUI of sorts for now, and if needed, we can expand on those libraries instead of writing everything from scratch.

Now... why go through all that trouble in the first place? The main reason is native Joystick support, which SDL already has by default and non-libretro FreeJ2ME can benefit immensely from. This cannot be done in pure Java+AWT without adding external libraries that will introduce portability concerns, and since SDL seems to run even on toasters these days, it is a much more interesting avenue to explore.

The other reason is that we have more control over the UI itself. AWT's interface appeared rather limited in customization to me, and Swing, while better, would require a complete GUI overhaul on standalone anyway, just to still lack Joystick support while restricting FreeJ2ME to JVMs that implement Swing.