borodust / bodge-ui

High-level immediate mode user interface library based on Nuklear IM GUI library
MIT License
15 stars 1 forks source link

How use skin in components? #13

Closed noloop closed 4 years ago

noloop commented 4 years ago

I started this week implementing the UmaUI in C that uses Nuklear. My idea was to build in C every structure with the possibility to switch on different backends, and then create a UmaUI wrapper for Lisp. Today I found you, and now I'm wondering whether or not I'm still implementing UmaUI.

So let's see how far you've gone with this UI so I don't redo something that's already been done.

My idea is to build a UI that can compile for Android, IOS, Linux, Mac0S, Windows and WEB (with some C-to-WASM compiler, if possible, I haven't tested it yet). I would use ECL to compile Lisp-to-C, and then I follow the necessary steps to compile for other platforms like Android and IOS ...

So far, with your system, it is possible to work together, I just have to create the functions to compile for the various platforms by calling ECL (I haven't tested it yet, I intend to start this test (Linux and Android first) tomorrow, but in theory it's works).

I also have some questions about your system:

How easy is it to style components (as Figure 8: Using skinning in Nuklear)?

borodust commented 4 years ago

Adding support for android and ios (apart from already supported windows, linux and macosx) to whole bodge library collection is my plan. Although I'm awaiting new ECL release which is ETA December before optimizing and adapting libraries for that particular implementation.

Styling is simple and resembles the one nuklear provides, see https://github.com/borodust/bodge-ui-window/blob/master/examples/styling-example.org

bodge-ui doesn't have a full collection of widgets nuklear provides yet though.

I'm open for collaboration and ideas on how to make bodge-ui better :)

noloop commented 4 years ago

I was not aware of this December release, how good they are still pushing the ECL forward.

Today I try run the example of the bodge-ui and I get a black screen and this error:

:MIDDLE is not defined as a keyword for enum type #<CFFI::FOREIGN-ENUM %NUKLEAR:TEXT-ALIGNMENT>.
   [Condition of type SIMPLE-ERROR]

Restarts:
 0: [ABORT] abort thread (#<THREAD "rendering-thread" RUNNING {10032089B3}>)

Backtrace:
  0: (CFFI::%FOREIGN-ENUM-VALUE #<CFFI::FOREIGN-ENUM %NUKLEAR:TEXT-ALIGNMENT> :MIDDLE :ERRORP T)
  1: ((:METHOD BODGE-UI::COMPOSE (BODGE-UI:LABEL)) #<BODGE-UI:LABEL {1003342433}>) [fast-method]
  2: ((:METHOD BODGE-UI::COMPOSE :AROUND (BODGE-UI::STYLED)) #<BODGE-UI:LABEL {1003342433}>) [fast-method]
  3: ((:METHOD BODGE-UI::COMPOSE-PANE (BODGE-UI:VERTICAL-LAYOUT)) #<BODGE-UI:VERTICAL-LAYOUT {10033411C3}>) [fast-method]
  4: ((:METHOD BODGE-UI::COMPOSE (BODGE-UI::PANE)) #<BODGE-UI:VERTICAL-LAYOUT {10033411C3}>) [fast-method]
  5: ((:METHOD BODGE-UI::COMPOSE :AROUND (BODGE-UI::STYLED)) #<BODGE-UI:VERTICAL-LAYOUT {10033411C3}>) [fast-method]
  6: (BODGE-UI::COMPOSE-HORIZONTAL-FLEX #<BODGE-UI:HORIZONTAL-LAYOUT {1003289BE3}> 90.0)
  7: ((:METHOD BODGE-UI::COMPOSE (BODGE-UI::PANE)) #<BODGE-UI:HORIZONTAL-LAYOUT {1003289BE3}>) [fast-method]
  8: ((:METHOD BODGE-UI::COMPOSE :AROUND (BODGE-UI::STYLED)) #<BODGE-UI:HORIZONTAL-LAYOUT {1003289BE3}>) [fast-method]
  9: (BODGE-UI::COMPOSE-PANEL #<BODGE-UI.EXAMPLE::DEMO-WINDOW {1003039853}>)
 10: ((:METHOD BODGE-UI::COMPOSE (BODGE-UI::PANEL)) #<BODGE-UI.EXAMPLE::DEMO-WINDOW {1003039853}>) [fast-method]
 11: ((:METHOD BODGE-UI::COMPOSE :AROUND (BODGE-UI::PANEL)) #<BODGE-UI.EXAMPLE::DEMO-WINDOW {1003039853}>) [fast-method]
 12: (BODGE-UI:COMPOSE-UI #<BODGE-UI::NUKLEAR-CONTEXT {10030382E3}>)
 13: (BODGE-UI.EXAMPLE::RENDER-EXAMPLE-UI #<BODGE-UI.EXAMPLE::BODGE-UI-APP {1002D8AA23}>)
 14: (BODGE-UI.EXAMPLE::RUN-RENDERING-LOOP #<BODGE-UI.EXAMPLE::BODGE-UI-APP {1002D8AA23}>)
 15: ((LAMBDA NIL :IN BODGE-UI.EXAMPLE::START-RENDERING-THREAD))
 16: ((LAMBDA NIL :IN BORDEAUX-THREADS::BINDING-DEFAULT-SPECIALS))
 17: ((FLET SB-UNIX::BODY :IN SB-THREAD::NEW-LISP-THREAD-TRAMPOLINE))
 18: ((FLET "WITHOUT-INTERRUPTS-BODY-4" :IN SB-THREAD::NEW-LISP-THREAD-TRAMPOLINE))
 19: ((FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::NEW-LISP-THREAD-TRAMPOLINE))
 --more--
borodust commented 4 years ago

This is fixed. For specific problems it is better to create separate issues. Or you can contact me directly either in #lispgames or #gamedev on lisp discrod.

noloop commented 4 years ago

Good evening, it's right. I do git pull and it's fixed, but there is other error in the loading of the example. I will create other issue for this.