helm icon indicating copy to clipboard operation
helm copied to clipboard

Move to NanoVG for SDL's 2D graphics

Open z0w0 opened this issue 8 years ago • 4 comments

Use the NanoVG haskell bindings to get rid of the Cairo/Pango/Glib dependencies and move towards easier cross platform support


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

z0w0 avatar Jun 14 '17 11:06 z0w0

It seems that Cairo etc for Haskell is actively supported with a last commit 6 days ago, meanwhile NanoVG last commit is 9 month ago. Do we really want to move to it, or there are more reliable options?

nikita-leonov avatar Oct 02 '17 14:10 nikita-leonov

It's a tricky situation. Cairo is well-maintained but we pull in glib and gtk which is a heavy dependency just for a game engine. Nanovg may be undermaintained but it's extremely lightweight in comparison. If there was a middleground, i.e. using Cairo without the glib/gtk dependency, I think that'd work..

z0w0 avatar Oct 02 '17 23:10 z0w0

Interesting. Do you know how gtk is used by Cairo? What I see from various documentation that GTK uses Cairo, but not vice versa. It seems that GTK manages window & surface to draw on, as well as high-level components that are drawn by Cairo, meanwhile Cairo handles low-level drawing logic. It should be easily replaceable by SDL as we already have window & surface as SDL can act as backend for Cairo in the same way as GTK. I am not sure why it depends on GTK, need to dig more.

nikita-leonov avatar Oct 03 '17 03:10 nikita-leonov

OK to clarify we don't depend on GTK directly, however:

  • Cairo is part of the Haskell GTK binding project
  • The Cairo bindings require installing the gtk-buildtools Haskell package or whatever it is, which makes it awkward since it's no longer as simple as just adding helm as a Cabal dependency to get up and running
  • On Windows and some environments, the Cairo shared libraries are bundled with Gtk tools

z0w0 avatar Oct 03 '17 04:10 z0w0