libgb.c 1.2021.2 → 1.2021.3

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,62 @@ 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
+ And then compile with `clang` or `gcc` as usual.
41
+
42
+ ```bash
43
+ $ clang main.c # or, use gcc
44
+ $ gcc main.c
28
45
  ```
29
46
 
47
+ You may also use a simpler approach:
48
+
49
+ ```c
50
+ // main.c
51
+ #define GB_IMPLEMENTATION
52
+ #include <gb/gb.h>
53
+ #define GB_MATH_IMPLEMENTATION
54
+ #include <gb/gb_math.h>
55
+ #define GB_STRING_IMPLEMENTATION
56
+ #include <gb/gb_string.h>
57
+ #define GB_INI_IMPLEMENTATION
58
+ #include <gb/gb_ini.h>
59
+ #define GBGL_IMPLEMENTATION
60
+ #include <gb/gb_gl.h>
61
+
62
+ int main() { /* ... */ }
63
+ ```
64
+
65
+ If you add the path `node_modules/libgb.c` to your compiler's include paths.
66
+
67
+ ```bash
68
+ $ clang -I./node_modules/libgb.c main.c # or, use gcc
69
+ $ gcc -I./node_modules/libgb.c main.c
70
+ ```
71
+
72
+ <br>
30
73
 
31
74
  ## FAQ
32
75
 
@@ -64,5 +107,6 @@ I may change it in the future but at the moment it is like this this:
64
107
  <br>
65
108
 
66
109
 
110
+ [![SRC](https://img.shields.io/badge/src-repo-green?logo=Org)](https://github.com/gingerBill/gb)
67
111
  [![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)
112
+ ![](https://ga-beacon.deno.dev/G-RC63DPBH3P:SH3Eq-NoQ9mwgYeHWxu7cw/github.com/nodef/libgb.c)