You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Building the tests and benchmarks is handled by the [tool.bash](tool.bash)
53
+
script, or by [GENie](https://github.com/bkaradzic/GENie). See the section
54
+
below about [building the tests and
55
+
benchmarks](#building-the-tests-and-benchmarks). There's also an example of
56
+
using *Layout* as a Lua `.dll` module. However, you don't need any of that to
57
+
use *Layout* in your own project.
110
58
111
59
Options
112
60
-------
@@ -115,31 +63,20 @@ You can choose to build *Layout* to use either integer (int16) or floating
115
63
point (float) coordinates. Integer is the default, because UI and other 2D
116
64
layouts do not often use units smaller than a single point when aligning and
117
65
positioning elements. You can choose to use floating point instead of integer
118
-
by defining `LAY_FLOAT`. If you are building the tests, benchmarks, or Lua
119
-
module for *Layout*, you can configure this when you invoke GENie:
120
-
121
-
```
122
-
./genie gmake --coords=float
123
-
```
124
-
125
-
or if you want to specify integer (the default):
126
-
127
-
```
128
-
./genie gmake --coords=integer
129
-
```
66
+
by defining `LAY_FLOAT`.
130
67
131
-
Customizations
132
-
--------------
68
+
*`LAY_FLOAT`, when defined, will use `float` instead of `int16` for
69
+
coordinates.
133
70
134
71
In addition to the `LAY_FLOAT` preprocessor option, other behavior in *Layout*
135
72
can be customized by setting preprocessor definitions. Default behavior will be
136
73
used for undefined customizations.
137
74
138
-
*`LAY_ASSERT`, if defined, will replace the use of `assert.h`'s `assert`
75
+
*`LAY_ASSERT` will replace the use of `assert.h`'s `assert`
139
76
140
-
*`LAY_REALLOC`, if defined, will replace the use of `stdlib.h`'s `realloc`
77
+
*`LAY_REALLOC` will replace the use of `stdlib.h`'s `realloc`
141
78
142
-
*`LAY_MEMSET`, if defined, will replace the use of `string.h`'s `memset`
79
+
*`LAY_MEMSET` will replace the use of `string.h`'s `memset`
143
80
144
81
If you define `LAY_REALLOC`, you will also need to define `LAY_FREE`.
145
82
@@ -255,3 +192,81 @@ lay_destroy_context(&ctx);
255
192
// The heap-allocated buffer is now freed. The context is now invalid for use
256
193
// until lay_init_context is called on it again.
257
194
```
195
+
196
+
Building the Tests and Benchmarks
197
+
=================================
198
+
199
+
ⓘ | None of this is necessary to use in your own project. These directions are only for building the tests and benchmarks programs, which you probably don't care about.
200
+
:---: | :---
201
+
202
+
If you have bash and are on a POSIX system, you can use the `tool.bash`
203
+
script to build *Layout*'s standalone tests and benchmarks programs. Run
204
+
`tool.bash` to see the options.
205
+
206
+
<h3>Using GENie</h3>
207
+
208
+
Instead of using the `tool.bash` script, you can use GENie to generate a Visual
209
+
Studio project file, or any of the other project and build system output types
210
+
it supports. The GENie generator also lets you build the example Lua module.
211
+
212
+
<details>
213
+
<summary>Directions for acquiring and using GENie</summary>
214
+
215
+
The [genie.lua](genie.lua) script is mostly tested on Windows, so if you use it
216
+
on another platform, you might need to tweak it.
217
+
218
+
You will first need to get (or make) a GENie binary and place it in your path
0 commit comments