raysan5 / raygui

A simple and easy-to-use immediate-mode gui library
zlib License
3.36k stars 289 forks source link

Added preprocessor macro requirement to readme #325

Closed CrackedPixel closed 1 year ago

CrackedPixel commented 1 year ago

This is something that isn't very clear when using the standard header method (the bindings explicitly have it in the example commands)

im not the only one who faced this issue (example1, example2) and thought something like this may be useful. i wasnt sure where in the readme would be best, so i picked this spot

CrackedPixel commented 1 year ago
*       #define RAYGUI_IMPLEMENTATION
*           Generates the implementation of the library into the included file.
*           If not defined, the library is in header only mode and can be included in other headers
*           or source files without problems. But only ONE file should hold the implementation.

i did find this in the .h file, but maybe im not good enough to understand it. i put the macro in my global project settings, not in a specific file

raysan5 commented 1 year ago

@CrackedPixel I'm afraid that comment could be confusing, the macro is only required in one compilation unit but raygui.h can be included in multiple files.

CrackedPixel commented 1 year ago

@CrackedPixel I'm afraid that comment could be confusing, the macro is only required in one compilation unit but raygui.h can be included in multiple files.

That makes sense. would you consider adding some note somewhere in the readme? it would help new users a lot

raysan5 commented 1 year ago

@CrackedPixel Yes, I can add a note to the readme.