Nuklear icon indicating copy to clipboard operation
Nuklear copied to clipboard

What are the .c files (under /src/) used for if the whole library is in nuklear.h?

Open mavavilj opened this issue 2 years ago • 4 comments

What are the .c files used for if the whole library is in nuklear.h?

mavavilj avatar Apr 02 '22 14:04 mavavilj

It is the source of the "compiled" header. You edit the source files to make changes to Nuklear, and generate the single header file for usage.

RobertLemmens avatar Apr 02 '22 17:04 RobertLemmens

It is the source of the "compiled" header. You edit the source files to make changes to Nuklear, and generate the single header file for usage.

Oh yes:

https://github.com/Immediate-Mode-UI/Nuklear/blob/master/src/Readme.md

Pardon, if this is a newbie question, but why cannot one edit nuklear.h directly?

mavavilj avatar Apr 03 '22 05:04 mavavilj

You could but its not recommended. The idea is that distribution and usage becomes easier. For development you usually want some form of structure. I recommend reading the STB FAQ in their readme to find out more about why single header libraries exist, its a really good write up! https://github.com/nothings/stb

RobertLemmens avatar Apr 03 '22 16:04 RobertLemmens

Pardon, if this is a newbie question, but why cannot one edit nuklear.h directly?

You could edit nuklear.h directly, however, nuklear.h is a combination of all the .c files in the src directory. If you change nuklear.h, your changes may be lost in the next update when it gets updated with paq.sh.

RobLoach avatar Apr 15 '22 19:04 RobLoach