libgb.c 1.2021.2 → 1.2021.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -14,19 +14,44 @@ library | latest version | category | description
14
14
  ## Installation
15
15
 
16
16
  Run:
17
+
17
18
  ```bash
18
19
  $ npm i libgb.c
19
20
  ```
20
21
 
21
22
  And then include `gb.h`, and related, as follows:
23
+
22
24
  ```c
23
- #include "node_modules/libgb.c/src/gb.h"
24
- #include "node_modules/libgb.c/src/gb_math.h"
25
- #include "node_modules/libgb.c/src/gb_string.h"
26
- #include "node_modules/libgb.c/src/gb_ini.h"
27
- #include "node_modules/libgb.c/src/gb_gl.h"
25
+ // main.c
26
+ #define GB_IMPLEMENTATION
27
+ #include "node_modules/libgb.c/gb.h"
28
+ #define GB_MATH_IMPLEMENTATION
29
+ #include "node_modules/libgb.c/gb_math.h"
30
+ #define GB_STRING_IMPLEMENTATION
31
+ #include "node_modules/libgb.c/gb_string.h"
32
+ #define GB_INI_IMPLEMENTATION
33
+ #include "node_modules/libgb.c/gb_ini.h"
34
+ #define GBGL_IMPLEMENTATION
35
+ #include "node_modules/libgb.c/gb_gl.h"
36
+
37
+ int main() { /* ... */ }
38
+ ```
39
+
40
+ Finally, compile while adding the path `node_modules/libgb.c` to your compiler's include paths.
41
+
42
+ ```bash
43
+ $ clang -I./node_modules/libgb.c -I./node_modules/stb.c main.c # or, use gcc
44
+ $ gcc -I./node_modules/libgb.c -I./node_modules/stb.c main.c
28
45
  ```
29
46
 
47
+ You may also use a simpler approach with the [cpoach](https://www.npmjs.com/package/cpoach.sh) tool, which automatically adds the necessary include paths of all the installed dependencies for your project.
48
+
49
+ ```bash
50
+ $ cpoach clang main.c # or, use gcc
51
+ $ cpoach gcc main.c
52
+ ```
53
+
54
+ <br>
30
55
 
31
56
  ## FAQ
32
57
 
@@ -64,5 +89,7 @@ I may change it in the future but at the moment it is like this this:
64
89
  <br>
65
90
 
66
91
 
92
+ [![](https://raw.githubusercontent.com/qb40/designs/gh-pages/0/image/11.png)](https://wolfram77.github.io)<br>
93
+ [![SRC](https://img.shields.io/badge/src-repo-green?logo=Org)](https://github.com/gingerBill/gb)
67
94
  [![ORG](https://img.shields.io/badge/org-nodef-green?logo=Org)](https://nodef.github.io)
68
- ![](https://ga-beacon.deno.dev/G-RC63DPBH3P:SH3Eq-NoQ9mwgYeHWxu7cw/github.com/nodef/gb.c)
95
+ ![](https://ga-beacon.deno.dev/G-RC63DPBH3P:SH3Eq-NoQ9mwgYeHWxu7cw/github.com/nodef/libgb.c)