needed-libraries icon indicating copy to clipboard operation
needed-libraries copied to clipboard

A good cross platform graphics library and a UI library built on top of it

Open alehander92 opened this issue 7 years ago • 10 comments

"A good cross platform graphics library and a UI library built on top of it but I’m intending to start working on these in the future as open source projects (based on OpenGL)." (From Nim community survey 2017)

alehander92 avatar Nov 16 '17 09:11 alehander92

I also want an nim based UI library that can work cross platform on osx, win, linux, ios, js and android.

My wish list:

  • I want it to be Immediate Mode with heavy use of Nim macros as controls.
  • I want it to use OS native font rendering so that fonts don't look out of place.
  • I don't want system controls they all sux and would rather make my own controls out of images or rounded rectangles.
  • I don't want auto layout features. I would just rather pixel position everything myself.
  • Don't care if its openGL or not. But I do like openGL.

treeform avatar Nov 16 '17 21:11 treeform

One existing choice is the Skrylar's library nfltk (in testing)

alehander92 avatar Nov 16 '17 21:11 alehander92

There are so many:

  • native (win32, osx, linux) https://github.com/yglukhov/nimx
  • native (win32, linux) https://github.com/trustable-code/NiGui
  • wxWidgets https://github.com/Araq/wxnim
  • QT https://github.com/filcuc/nimqml
  • SDL2 https://github.com/nim-lang/sdl2
  • SDL1 https://github.com/nim-lang/sdl1
  • GLFW https://github.com/ephja/nim-glfw
  • fltk based https://github.com/Skrylar/nfltk
  • libui https://github.com/nim-lang/ui
  • nuklear https://github.com/zacharycarter/nuklear-nim
  • nuklear another https://github.com/genotrance/nimnuklear
  • nimui https://github.com/genotrance/nimui
  • NiGui https://github.com/trustable-code/NiGui

And Mine:

  • Fidget https://github.com/treeform/fidget

treeform avatar Nov 16 '17 22:11 treeform

We can add http://libyue.com/ to the list. Looks really nice based on a quick read through of the docs, and it is CPP, which means binding to Nim shouldn't be terrible. Someone who knows more than I do can verify that

ajusa avatar May 02 '18 01:05 ajusa

We now have updated libui and nuklear wrappers based on nimgen after both existing authors (@araq and @zacharycarter) mentioned updating them on IRC.

https://github.com/genotrance/nimui https://github.com/genotrance/nimnuklear

They are still purely wrappers and could do with contributions. @jyapayne has been helping with nimui and @AlexMax and @gogolxdong on nimnuklear.

genotrance avatar Oct 02 '18 13:10 genotrance

Is there any mac user who would like to implement macOS support for https://github.com/trustable-code/NiGui ?

simonkrauter avatar Oct 02 '18 14:10 simonkrauter

@ajusa we can add it if its grows some Nim bindings.

treeform avatar Dec 14 '19 19:12 treeform

  • It should be fast even for large applications, so no permanent redraw.
  • It needs to integrate into the system, e.g. tray icons with menu on Windows, top-of-the-screen menu on macOS.
  • It should have that support very large datasets (usually, native controls are limited in this area) with free renderings (example: Java/Swings JTable with models, columns)
  • It should use native font rendering.
  • It should support plugable layout managers and ship with a few default ones. Without a layout manager, setting pixel coordinates should work.
  • It should support minimum and preferred sizes for controls (based on, e.g. font sizes, screen scaling) and layout managers should consider them. It makes no sense to shrink controls below their minimum size.
  • It should feel like native controls, e.g. support full keyboard navigation like an C++/ObjectiveC application designed for this very system, a button triggers on mouse-up if still inside the bounds, ...

vmcrash avatar Oct 04 '20 17:10 vmcrash

Let's not couple gfx libraries with UI libraries... This is a mistake that can be avoided.

I don't want to have to use OpenGL and GLFW / SDL just for the sake of using a UI library. Chances are if the UI library requires I use GL / GLFW / SDL I'm not going to use it.

UI libraries can be divided into retained mode and immediate mode libraries. We already have options for immediate mode - Nuklear Dear Imgui

Both of these libraries have C APIs which bindings have been generated for.

On the retained mode side - we don't have many options. Something like Qt would be nice but is a large lift. I think the closest thing we have is - https://github.com/trustable-code/NiGui

IMO making a UI library that mandates the use of a specific drawing API is bad design.

I'm still not really sure what this issue is about - are we talking about UI libraries for desktop applications or games / creative applications? I'm not going to use Qt in a game and I'm not going to use Dear Imgui to create a desktop application...

The best we have as far as non immediate-mode graphics for game user interfaces is NanoVG.

zacharycarter avatar Oct 07 '20 19:10 zacharycarter

I was talking about a library to create desktop applications (for the 3 major systems Linux, macOS and Windows).

vmcrash avatar Oct 08 '20 15:10 vmcrash