Nuklear is graphical user interface toolkit written in ANSI C.
It’s a single header library written in C89 (ANSI C), with small codebase (~18kLOC)
It’s focussed on portability, efficiency and simplicity and have no dependencies.
It’s not hard to generate Julia bindings using Clang.jl, but those backends need to be reimplemented in Julia. Since the codebase is small, should we reimplement everything in Julia? or is it possible to do a source-to-source translation using Clang.jl?
Currently, it still has some limitations(e.g. cannot call vararg APIs) and I feel like it’s not very convenient to work with nuklear in Julia, for example, ctx->style.button.normal = nk_style_item_color(nk_rgb(40,40,40)); is easy in C, but when we do this in Julia either by pure pointer arithmetic or using Blobs.jl, the code looks ugly and redundant. Maybe we need to extend its APIs with more helper C functions? I’ll try to keep this package actively maintained, so feel free to file issues if you’ve any question.
search function is not continued in Julia v1.0, you could use occursin I guess.
It looks like SFML is not actively maintained(last commit is one year ago). It would be great if we could upgrade the build system to BB2 with which installation related issues would be solved spontaneously. To this end, we need to build those missing BB projects from this list: https://www.sfml-dev.org/faq.php#grl-dependencies
I don’t know whether those wrappers were written by hand or generated using old Clang.jl, but maybe we can regenerate those bindings of the latest CSFML using Clang.jl-v0.8.
ERROR: LoadError: ArgumentError: Package Images not found in current path:
- Run `import Pkg; Pkg.add("Images")` to install the Images package.
Could you upload a screenshot? The default font is ProggyClean.ttf which is indeed very tinny. Nuklear’s font baking API is a little bit complex to work with, I need to add some helper functions in the C side.
I use Images.jl to load and manipulate png format images, you need to install Images.jl to run that demo.
Yes, it works after installing Images.
The font issue. What I see is like a font of size ~5 pts but when I do a screen capture, which is at lower resolution, the image looks as if it has larger fonts. In fact I get one that is similar to yours, so no point uploading it.
I also get this error after deleting the image.
ERROR: LoadError: ContextNotAvailable("glDeleteProgram, not available for your driver, or no valid OpenGL context available")
 getprocaddress_e at C:\Users\j\.julia\packages\ModernGL\oi403\src\ModernGL.jl:41 [inlined]
 glDeleteProgram(::UInt32) at C:\Users\j\.julia\packages\ModernGL\oi403\src\functionloading.jl:37
 nk_glfw3_device_destroy() at C:\Users\j\.julia\packages\Nuklear\jYRiH\src\backend\GLFW\impl.jl:307
 nk_glfw3_shutdown() at C:\Users\j\.julia\packages\Nuklear\jYRiH\src\backend\GLFW\impl.jl:324
 top-level scope at none:0
 include at .\boot.jl:317 [inlined]
 include_relative(::Module, ::String) at .\loading.jl:1044
 include(::Module, ::String) at .\sysimg.jl:29
 include(::String) at .\client.jl:392
 top-level scope at none:0
in expression starting at C:\Users\j\.julia\packages\Nuklear\jYRiH\demo\image.jl:101