3 ms·
I don't understand... the documentation says "does not have any dependencies" but still it requires glfw3. Is that alright? Cannot compile the examples withou
by enriquto 6y ago
I don't understand... the documentation says "does not have any dependencies" but still it requires glfw3. Is that alright? Cannot compile the examples without glfw3 but maybe I'm doing something wrong.
- chrisseaton 6y agoI think in this context they mean it doesn't depend on any particular dependencies, but at some point you need a way to render their frame buffer. I guess you could trivially swap out glfw3 for something else, such as using the BIOS video mode directly.
- roblabla 6y agoNuklear doesn't have any dependency, but you must provide it a backend so it can do its drawing. The examples use a glfw3 backend, but you can provide any other backend, it's just a handful of functions to implement and is usually not too hard. See https://immediate-mode-ui.github.io/Nuklear/doc/nuklear.html#nuklear/api/drawing https://immediate-mode-ui.github.io/Nuklear/doc/nuklear.html...
- crazypython 6y agoInteresting. It seems like it would be fairly easy to write a WASM/Canvas2D port of it.
- symlinkk 6y agoThat’s called a dependency.
- enriquto 6y ago> Nuklear doesn't have any dependency, but you must provide it a backend so it can do its drawing. The examples use a glfw3 backend, but you can provide any other backend, it's just a handful of functions to implement and is usually not too hard. The text editor gcc doesn't have any dependency, but you must provide it a backend so it can do its text editing. The example uses a nano backend written in C, but you can provide any other backend like vim or emacs, it's just a handful of functions to implement and is usually not too hard.
- dkersten 6y agoThe difference is that its up to you to provide the backend, so presumably you will be using whatever you're application is already using, rather than pulling in a new dependency just for Nuklear to work. Its still a dependency in my books, but its not the same as saying "this requires DirectX" or whatever: it requires a backend, but you can give it any backend you want, so ideally wouldn't pull in anything you aren't already using.
- enriquto 6y agoI would believe you if Nuklear provided several (say, at least 5) different such backends, easily accessible through different makefiles, say Makefile.glfw3 Makefile.freeglut Makefile.gtk Makefile.x11 Makefile.cocoa Since it is just a handful of lines, that should be easy to do :) Also, it would be a great way to learn how to add new backends. But as it is now, it is presented to be like glfw3 is a hard dependency.
- liuliu 6y agoDear ImGui did that: https://github.com/ocornut/imgui/tree/master/backends https://github.com/ocornut/imgui/tree/master/backends, https://github.com/ocornut/imgui/tree/master/examples https://github.com/ocornut/imgui/tree/master/examples You can probably borrow some of these code and fit with Nuklear. For these imgui toolkit, it is just a few lines of code if you know what you are doing. For the library authors, it is quite a bit of work to maintain different environments and CIs to test all these backends though.
- flohofwoe 6y agoThe library itself doesn't depend on anything, instead it delegates the "platform integration" (rendering and input) to outside code. The examples somehow need to connect to the underlying operating system, and that's why they depend on GLFW as intermediate layer, but this could also be SDL, or - shameless plug - the sokol headers (https://github.com/floooh/sokol https://github.com/floooh/sokol), or (more commonly) a game engine like Unity, Unreal Engine, or your own code.