Check-in [c2b9a73492]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Freetype for 32 and 64 bits
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c2b9a7349286d55a865e6fc10ab60103a107629f
User & Date: bernd 2013-11-26 18:23:10
Context
2013-11-26
23:02
Some changes to freetype-gl stuff check-in: fd1cd6736c user: bernd tags: trunk
18:23
Freetype for 32 and 64 bits check-in: c2b9a73492 user: bernd tags: trunk
18:18
Added Freetype-GL swig file check-in: a3a8ae93a7 user: bernd tags: trunk
Changes

Changes to freetype-gl.fs.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172

\ This file has been generated using SWIG and fsi,
\ and is already platform dependent, search for the corresponding
\ fsi-file to compile it where no one has compiled it before ;)
\ GForth has its own dynamic loader and doesn't need addional C-Code.
\ That's why this file contains normal Gforth-code( version 0.6.9 or higher )
\ and could be used directly with include or require.
\ As all comments are stripped during the compilation, please
\ insert the copyright notice of the original file here.

Vocabulary freetype-gl
get-current also freetype-gl definitions
c-library freetype_gl
    s" freetype-gl" add-lib
    [IFDEF] android
        s" ./.libs" add-libpath
        
        \c #include "../../../../../freetype-gl/freetype-gl.h"
    [ELSE]
        \c #include <freetype-gl.h>
    [THEN]
\ -------===< structs >===--------
\ vec4
begin-structure vec4
	drop 0 16 +field vec4-data
	drop 0 16 +field vec4-xyzw
	drop 0 12 +field vec4-rgb
	drop 0 16 +field vec4-rgba
	drop 0 12 +field vec4-xyz
drop 16 end-structure
\ vec3
begin-structure vec3
	drop 0 12 +field vec3-data
	drop 0 12 +field vec3-rgb
	drop 0 12 +field vec3-xyz
	drop 0 8 +field vec3-xy
drop 12 end-structure
\ vec2
begin-structure vec2
	drop 0 8 +field vec2-data
	drop 0 8 +field vec2-xy
drop 8 end-structure
\ ivec4
begin-structure ivec4
	drop 0 16 +field ivec4-data
	drop 0 16 +field ivec4-xyzw
	drop 0 12 +field ivec4-rgb
	drop 0 16 +field ivec4-rgba
	drop 0 12 +field ivec4-xyz
	drop 0 16 +field ivec4-XYZW_
drop 16 end-structure
\ ivec4_XYZW
begin-structure ivec4_XYZW
	drop 12 4 +field ivec4_XYZW-w
	drop 0 4 +field ivec4_XYZW-x
	drop 4 4 +field ivec4_XYZW-y
	drop 8 4 +field ivec4_XYZW-z
drop 16 end-structure
\ ivec3
begin-structure ivec3
	drop 0 12 +field ivec3-data
	drop 0 12 +field ivec3-rgb
	drop 0 12 +field ivec3-xyz
	drop 0 8 +field ivec3-xy
	drop 0 12 +field ivec3-XYZ_
drop 12 end-structure
\ ivec3_XYZ
begin-structure ivec3_XYZ
	drop 0 4 +field ivec3_XYZ-x
	drop 4 4 +field ivec3_XYZ-y
	drop 8 4 +field ivec3_XYZ-z
drop 12 end-structure
\ ivec2
begin-structure ivec2
	drop 0 8 +field ivec2-data
	drop 0 8 +field ivec2-xy
drop 8 end-structure
\ vector_t
begin-structure vector_t
	drop 0 8 +field vector_t-items
	drop 16 8 +field vector_t-size
	drop 24 8 +field vector_t-item_size
	drop 8 8 +field vector_t-capacity
drop 32 end-structure
\ texture_atlas_t
begin-structure texture_atlas_t
	drop 48 8 +field texture_atlas_t-data
	drop 40 4 +field texture_atlas_t-id
	drop 0 8 +field texture_atlas_t-nodes
	drop 16 8 +field texture_atlas_t-height
	drop 32 8 +field texture_atlas_t-used
	drop 8 8 +field texture_atlas_t-width
	drop 24 8 +field texture_atlas_t-depth
drop 56 end-structure
\ kerning_t
begin-structure kerning_t
	drop 0 4 +field kerning_t-charcode
	drop 4 4 +field kerning_t-kerning
drop 8 end-structure
\ texture_glyph_t
begin-structure texture_glyph_t
	drop 16 8 +field texture_glyph_t-height
	drop 44 4 +field texture_glyph_t-t0
	drop 52 4 +field texture_glyph_t-t1
	drop 40 4 +field texture_glyph_t-s0
	drop 68 4 +field texture_glyph_t-outline_thickness
	drop 48 4 +field texture_glyph_t-s1
	drop 24 4 +field texture_glyph_t-offset_x
	drop 28 4 +field texture_glyph_t-offset_y
	drop 64 4 +field texture_glyph_t-outline_type
	drop 32 4 +field texture_glyph_t-advance_x
	drop 36 4 +field texture_glyph_t-advance_y
	drop 4 4 +field texture_glyph_t-id
	drop 8 8 +field texture_glyph_t-width
	drop 0 4 +field texture_glyph_t-charcode
	drop 56 8 +field texture_glyph_t-kerning
drop 72 end-structure
\ texture_font_t
begin-structure texture_font_t
	drop 64 4 +field texture_font_t-descender
	drop 60 4 +field texture_font_t-ascender
	drop 52 4 +field texture_font_t-height
	drop 24 4 +field texture_font_t-size
	drop 0 8 +field texture_font_t-glyphs
	drop 56 4 +field texture_font_t-linegap
	drop 36 4 +field texture_font_t-outline_thickness
	drop 72 4 +field texture_font_t-underline_thickness
	drop 40 4 +field texture_font_t-filtering
	drop 32 4 +field texture_font_t-outline_type
	drop 8 8 +field texture_font_t-atlas
	drop 44 5 +field texture_font_t-lcd_weights
	drop 28 4 +field texture_font_t-hinting
	drop 68 4 +field texture_font_t-underline_position
	drop 16 8 +field texture_font_t-filename
drop 80 end-structure

\ ------===< functions >===-------
c-function vector_new vector_new n -- a
c-function vector_delete vector_delete a -- void
c-function vector_get vector_get a n -- a
c-function vector_front vector_front a -- a
c-function vector_back vector_back a -- a
c-function vector_contains vector_contains a a a -- n
c-function vector_empty vector_empty a -- n
c-function vector_size vector_size a -- n
c-function vector_reserve vector_reserve a n -- void
c-function vector_capacity vector_capacity a -- n
c-function vector_shrink vector_shrink a -- void
c-function vector_clear vector_clear a -- void
c-function vector_set vector_set a n a -- void
c-function vector_erase vector_erase a n -- void
c-function vector_erase_range vector_erase_range a n n -- void
c-function vector_push_back vector_push_back a a -- void
c-function vector_pop_back vector_pop_back a -- void
c-function vector_resize vector_resize a n -- void
c-function vector_insert vector_insert a n a -- void
c-function vector_insert_data vector_insert_data a n a n -- void
c-function vector_push_back_data vector_push_back_data a a n -- void
c-function vector_sort vector_sort a a -- void
c-function texture_atlas_new texture_atlas_new n n n -- a
c-function texture_atlas_delete texture_atlas_delete a -- void
c-function texture_atlas_upload texture_atlas_upload a -- void
\c #define texture_atlas_get_regionp(self, w, h, x) { ivec4* _x=x; *_x=texture_atlas_get_region(self,w,h); }
c-function texture_atlas_get_region texture_atlas_get_regionp a n n a -- void
c-function texture_atlas_set_region texture_atlas_set_region a n n n n a n -- void
c-function texture_atlas_clear texture_atlas_clear a -- void
c-function texture_font_new texture_font_new a a r -- a
c-function texture_font_delete texture_font_delete a -- void
c-function texture_font_get_glyph texture_font_get_glyph a n -- a
c-function texture_font_load_glyphs texture_font_load_glyphs a a -- n
c-function texture_glyph_get_kerning texture_glyph_get_kerning a n -- r
end-c-library
previous set-current

<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
>









1





2




























































































































































3









\ freetype GL wrapper


































































































































































cell 4 = [IF] require freetype-gl32.fs [ELSE] require freetype-gl64.fs [THEN]

Changes to freetype-gl/freetype-gl.fs.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172

\ This file has been generated using SWIG and fsi,
\ and is already platform dependent, search for the corresponding
\ fsi-file to compile it where no one has compiled it before ;)
\ GForth has its own dynamic loader and doesn't need addional C-Code.
\ That's why this file contains normal Gforth-code( version 0.6.9 or higher )
\ and could be used directly with include or require.
\ As all comments are stripped during the compilation, please
\ insert the copyright notice of the original file here.

Vocabulary freetype-gl
get-current also freetype-gl definitions
c-library freetype_gl
    s" freetype-gl" add-lib
    [IFDEF] android
        s" ./.libs" add-libpath
        
        \c #include "../../../../../freetype-gl/freetype-gl.h"
    [ELSE]
        \c #include <freetype-gl.h>
    [THEN]
\ -------===< structs >===--------
\ vec4
begin-structure vec4
	drop 0 16 +field vec4-data
	drop 0 16 +field vec4-xyzw
	drop 0 12 +field vec4-rgb
	drop 0 16 +field vec4-rgba
	drop 0 12 +field vec4-xyz
drop 16 end-structure
\ vec3
begin-structure vec3
	drop 0 12 +field vec3-data
	drop 0 12 +field vec3-rgb
	drop 0 12 +field vec3-xyz
	drop 0 8 +field vec3-xy
drop 12 end-structure
\ vec2
begin-structure vec2
	drop 0 8 +field vec2-data
	drop 0 8 +field vec2-xy
drop 8 end-structure
\ ivec4
begin-structure ivec4
	drop 0 16 +field ivec4-data
	drop 0 16 +field ivec4-xyzw
	drop 0 12 +field ivec4-rgb
	drop 0 16 +field ivec4-rgba
	drop 0 12 +field ivec4-xyz
	drop 0 16 +field ivec4-XYZW_
drop 16 end-structure
\ ivec4_XYZW
begin-structure ivec4_XYZW
	drop 12 4 +field ivec4_XYZW-w
	drop 0 4 +field ivec4_XYZW-x
	drop 4 4 +field ivec4_XYZW-y
	drop 8 4 +field ivec4_XYZW-z
drop 16 end-structure
\ ivec3
begin-structure ivec3
	drop 0 12 +field ivec3-data
	drop 0 12 +field ivec3-rgb
	drop 0 12 +field ivec3-xyz
	drop 0 8 +field ivec3-xy
	drop 0 12 +field ivec3-XYZ_
drop 12 end-structure
\ ivec3_XYZ
begin-structure ivec3_XYZ
	drop 0 4 +field ivec3_XYZ-x
	drop 4 4 +field ivec3_XYZ-y
	drop 8 4 +field ivec3_XYZ-z
drop 12 end-structure
\ ivec2
begin-structure ivec2
	drop 0 8 +field ivec2-data
	drop 0 8 +field ivec2-xy
drop 8 end-structure
\ vector_t
begin-structure vector_t
	drop 0 8 +field vector_t-items
	drop 16 8 +field vector_t-size
	drop 24 8 +field vector_t-item_size
	drop 8 8 +field vector_t-capacity
drop 32 end-structure
\ texture_atlas_t
begin-structure texture_atlas_t
	drop 48 8 +field texture_atlas_t-data
	drop 40 4 +field texture_atlas_t-id
	drop 0 8 +field texture_atlas_t-nodes
	drop 16 8 +field texture_atlas_t-height
	drop 32 8 +field texture_atlas_t-used
	drop 8 8 +field texture_atlas_t-width
	drop 24 8 +field texture_atlas_t-depth
drop 56 end-structure
\ kerning_t
begin-structure kerning_t
	drop 0 4 +field kerning_t-charcode
	drop 4 4 +field kerning_t-kerning
drop 8 end-structure
\ texture_glyph_t
begin-structure texture_glyph_t
	drop 16 8 +field texture_glyph_t-height
	drop 44 4 +field texture_glyph_t-t0
	drop 52 4 +field texture_glyph_t-t1
	drop 40 4 +field texture_glyph_t-s0
	drop 68 4 +field texture_glyph_t-outline_thickness
	drop 48 4 +field texture_glyph_t-s1
	drop 24 4 +field texture_glyph_t-offset_x
	drop 28 4 +field texture_glyph_t-offset_y
	drop 64 4 +field texture_glyph_t-outline_type
	drop 32 4 +field texture_glyph_t-advance_x
	drop 36 4 +field texture_glyph_t-advance_y
	drop 4 4 +field texture_glyph_t-id
	drop 8 8 +field texture_glyph_t-width
	drop 0 4 +field texture_glyph_t-charcode
	drop 56 8 +field texture_glyph_t-kerning
drop 72 end-structure
\ texture_font_t
begin-structure texture_font_t
	drop 64 4 +field texture_font_t-descender
	drop 60 4 +field texture_font_t-ascender
	drop 52 4 +field texture_font_t-height
	drop 24 4 +field texture_font_t-size
	drop 0 8 +field texture_font_t-glyphs
	drop 56 4 +field texture_font_t-linegap
	drop 36 4 +field texture_font_t-outline_thickness
	drop 72 4 +field texture_font_t-underline_thickness
	drop 40 4 +field texture_font_t-filtering
	drop 32 4 +field texture_font_t-outline_type
	drop 8 8 +field texture_font_t-atlas
	drop 44 5 +field texture_font_t-lcd_weights
	drop 28 4 +field texture_font_t-hinting
	drop 68 4 +field texture_font_t-underline_position
	drop 16 8 +field texture_font_t-filename
drop 80 end-structure

\ ------===< functions >===-------
c-function vector_new vector_new n -- a
c-function vector_delete vector_delete a -- void
c-function vector_get vector_get a n -- a
c-function vector_front vector_front a -- a
c-function vector_back vector_back a -- a
c-function vector_contains vector_contains a a a -- n
c-function vector_empty vector_empty a -- n
c-function vector_size vector_size a -- n
c-function vector_reserve vector_reserve a n -- void
c-function vector_capacity vector_capacity a -- n
c-function vector_shrink vector_shrink a -- void
c-function vector_clear vector_clear a -- void
c-function vector_set vector_set a n a -- void
c-function vector_erase vector_erase a n -- void
c-function vector_erase_range vector_erase_range a n n -- void
c-function vector_push_back vector_push_back a a -- void
c-function vector_pop_back vector_pop_back a -- void
c-function vector_resize vector_resize a n -- void
c-function vector_insert vector_insert a n a -- void
c-function vector_insert_data vector_insert_data a n a n -- void
c-function vector_push_back_data vector_push_back_data a a n -- void
c-function vector_sort vector_sort a a -- void
c-function texture_atlas_new texture_atlas_new n n n -- a
c-function texture_atlas_delete texture_atlas_delete a -- void
c-function texture_atlas_upload texture_atlas_upload a -- void
\c #define texture_atlas_get_regionp(self, w, h, x) { ivec4* _x=x; *_x=texture_atlas_get_region(self,w,h); }
c-function texture_atlas_get_region texture_atlas_get_regionp a n n a -- void
c-function texture_atlas_set_region texture_atlas_set_region a n n n n a n -- void
c-function texture_atlas_clear texture_atlas_clear a -- void
c-function texture_font_new texture_font_new a a r -- a
c-function texture_font_delete texture_font_delete a -- void
c-function texture_font_get_glyph texture_font_get_glyph a n -- a
c-function texture_font_load_glyphs texture_font_load_glyphs a a -- n
c-function texture_glyph_get_kerning texture_glyph_get_kerning a n -- r
end-c-library
previous set-current

<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
>









1





2




























































































































































3









\ freetype GL wrapper


































































































































































cell 4 = [IF] require freetype-gl32.fs [ELSE] require freetype-gl64.fs [THEN]

Name change from freetype-gl/freetype-gl.fs to freetype-gl/freetype-gl32.fs.

Added freetype-gl/freetype-gl64.fs.

































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
\ This file has been generated using SWIG and fsi,
\ and is already platform dependent, search for the corresponding
\ fsi-file to compile it where no one has compiled it before ;)
\ GForth has its own dynamic loader and doesn't need addional C-Code.
\ That's why this file contains normal Gforth-code( version 0.6.9 or higher )
\ and could be used directly with include or require.
\ As all comments are stripped during the compilation, please
\ insert the copyright notice of the original file here.

Vocabulary freetype-gl
get-current also freetype-gl definitions
c-library freetype_gl
    s" freetype-gl" add-lib
    [IFDEF] android
        s" ./.libs" add-libpath
        
        \c #include "../../../../../freetype-gl/freetype-gl.h"
    [ELSE]
        \c #include <freetype-gl.h>
    [THEN]
\ -------===< structs >===--------
\ struct vec4
begin-structure struct-vec4
	drop 0 16 +field struct-vec4-VEC4
drop 16 end-structure
\ vec4_VEC4
begin-structure vec4_VEC4
	drop 0 16 +field vec4_VEC4-RGBA
	drop 0 16 +field vec4_VEC4-data
	drop 0 12 +field vec4_VEC4-rgb
	drop 0 16 +field vec4_VEC4-rgba
	drop 0 12 +field vec4_VEC4-xyz
drop 16 end-structure
\ vec4_VEC4_RGBA
begin-structure vec4_VEC4_RGBA
	drop 8 4 +field vec4_VEC4_RGBA-b
	drop 0 4 +field vec4_VEC4_RGBA-r
	drop 4 4 +field vec4_VEC4_RGBA-g
	drop 12 4 +field vec4_VEC4_RGBA-a
drop 16 end-structure
\ vec4_VEC4_RGBA_a
begin-structure vec4_VEC4_RGBA_a
	drop 0 4 +field vec4_VEC4_RGBA_a-w
	drop 0 4 +field vec4_VEC4_RGBA_a-alpha
	drop 0 4 +field vec4_VEC4_RGBA_a-height
	drop 0 4 +field vec4_VEC4_RGBA_a-a
drop 4 end-structure
\ vec4_VEC4_RGBA_b
begin-structure vec4_VEC4_RGBA_b
	drop 0 4 +field vec4_VEC4_RGBA_b-b
	drop 0 4 +field vec4_VEC4_RGBA_b-blue
	drop 0 4 +field vec4_VEC4_RGBA_b-z
	drop 0 4 +field vec4_VEC4_RGBA_b-width
drop 4 end-structure
\ vec4_VEC4_RGBA_g
begin-structure vec4_VEC4_RGBA_g
	drop 0 4 +field vec4_VEC4_RGBA_g-y
	drop 0 4 +field vec4_VEC4_RGBA_g-green
	drop 0 4 +field vec4_VEC4_RGBA_g-g
drop 4 end-structure
\ vec4_VEC4_RGBA_r
begin-structure vec4_VEC4_RGBA_r
	drop 0 4 +field vec4_VEC4_RGBA_r-x
	drop 0 4 +field vec4_VEC4_RGBA_r-r
	drop 0 4 +field vec4_VEC4_RGBA_r-red
drop 4 end-structure
\ struct vec3
begin-structure struct-vec3
	drop 0 12 +field struct-vec3-VEC3
drop 12 end-structure
\ vec3_VEC3
begin-structure vec3_VEC3
	drop 0 12 +field vec3_VEC3-data
	drop 0 12 +field vec3_VEC3-rgb
	drop 0 12 +field vec3_VEC3-RGB
	drop 0 12 +field vec3_VEC3-xyz
drop 12 end-structure
\ vec3_VEC3_RGB
begin-structure vec3_VEC3_RGB
	drop 8 4 +field vec3_VEC3_RGB-b
	drop 0 4 +field vec3_VEC3_RGB-r
	drop 4 4 +field vec3_VEC3_RGB-g
drop 12 end-structure
\ vec3_VEC3_RGB_b
begin-structure vec3_VEC3_RGB_b
	drop 0 4 +field vec3_VEC3_RGB_b-b
	drop 0 4 +field vec3_VEC3_RGB_b-blue
	drop 0 4 +field vec3_VEC3_RGB_b-z
	drop 0 4 +field vec3_VEC3_RGB_b-depth
drop 4 end-structure
\ vec3_VEC3_RGB_g
begin-structure vec3_VEC3_RGB_g
	drop 0 4 +field vec3_VEC3_RGB_g-y
	drop 0 4 +field vec3_VEC3_RGB_g-green
	drop 0 4 +field vec3_VEC3_RGB_g-height
	drop 0 4 +field vec3_VEC3_RGB_g-g
drop 4 end-structure
\ vec3_VEC3_RGB_r
begin-structure vec3_VEC3_RGB_r
	drop 0 4 +field vec3_VEC3_RGB_r-x
	drop 0 4 +field vec3_VEC3_RGB_r-r
	drop 0 4 +field vec3_VEC3_RGB_r-red
	drop 0 4 +field vec3_VEC3_RGB_r-width
drop 4 end-structure
\ struct vec2
begin-structure struct-vec2
	drop 0 8 +field struct-vec2-VEC2
drop 8 end-structure
\ vec2_VEC2
begin-structure vec2_VEC2
	drop 0 8 +field vec2_VEC2-XY
	drop 0 8 +field vec2_VEC2-data
	drop 0 8 +field vec2_VEC2-xy
drop 8 end-structure
\ vec2_VEC2_XY
begin-structure vec2_VEC2_XY
	drop 0 4 +field vec2_VEC2_XY-x
	drop 4 4 +field vec2_VEC2_XY-y
drop 8 end-structure
\ vec2_VEC2_XY_y
begin-structure vec2_VEC2_XY_y
	drop 0 4 +field vec2_VEC2_XY_y-alpha
	drop 0 4 +field vec2_VEC2_XY_y-y
	drop 0 4 +field vec2_VEC2_XY_y-height
	drop 0 4 +field vec2_VEC2_XY_y-a
drop 4 end-structure
\ vec2_VEC2_XY_x
begin-structure vec2_VEC2_XY_x
	drop 0 4 +field vec2_VEC2_XY_x-x
	drop 0 4 +field vec2_VEC2_XY_x-l
	drop 0 4 +field vec2_VEC2_XY_x-width
	drop 0 4 +field vec2_VEC2_XY_x-luminance
drop 4 end-structure
\ ivec4
begin-structure ivec4
	drop 0 16 +field ivec4-IVEC4
drop 16 end-structure
\ ivec4_IVEC4
begin-structure ivec4_IVEC4
	drop 0 16 +field ivec4_IVEC4-RGBA
	drop 0 16 +field ivec4_IVEC4-data
	drop 0 12 +field ivec4_IVEC4-rgb
	drop 0 16 +field ivec4_IVEC4-rgba
	drop 0 12 +field ivec4_IVEC4-xyz
drop 16 end-structure
\ ivec4_IVEC4_RGBA
begin-structure ivec4_IVEC4_RGBA
	drop 8 4 +field ivec4_IVEC4_RGBA-b
	drop 0 4 +field ivec4_IVEC4_RGBA-r
	drop 4 4 +field ivec4_IVEC4_RGBA-g
	drop 12 4 +field ivec4_IVEC4_RGBA-a
drop 16 end-structure
\ ivec4_IVEC4_RGBA_a
begin-structure ivec4_IVEC4_RGBA_a
	drop 0 4 +field ivec4_IVEC4_RGBA_a-w
	drop 0 4 +field ivec4_IVEC4_RGBA_a-alpha
	drop 0 4 +field ivec4_IVEC4_RGBA_a-height
	drop 0 4 +field ivec4_IVEC4_RGBA_a-a
drop 4 end-structure
\ ivec4_IVEC4_RGBA_b
begin-structure ivec4_IVEC4_RGBA_b
	drop 0 4 +field ivec4_IVEC4_RGBA_b-b
	drop 0 4 +field ivec4_IVEC4_RGBA_b-blue
	drop 0 4 +field ivec4_IVEC4_RGBA_b-z
	drop 0 4 +field ivec4_IVEC4_RGBA_b-width
drop 4 end-structure
\ ivec4_IVEC4_RGBA_g
begin-structure ivec4_IVEC4_RGBA_g
	drop 0 4 +field ivec4_IVEC4_RGBA_g-y
	drop 0 4 +field ivec4_IVEC4_RGBA_g-green
	drop 0 4 +field ivec4_IVEC4_RGBA_g-g
drop 4 end-structure
\ ivec4_IVEC4_RGBA_r
begin-structure ivec4_IVEC4_RGBA_r
	drop 0 4 +field ivec4_IVEC4_RGBA_r-x
	drop 0 4 +field ivec4_IVEC4_RGBA_r-r
	drop 0 4 +field ivec4_IVEC4_RGBA_r-red
drop 4 end-structure
\ ivec3
begin-structure ivec3
	drop 0 12 +field ivec3-IVEC3
drop 12 end-structure
\ ivec3_IVEC3
begin-structure ivec3_IVEC3
	drop 0 12 +field ivec3_IVEC3-data
	drop 0 12 +field ivec3_IVEC3-rgb
	drop 0 12 +field ivec3_IVEC3-RGB
	drop 0 12 +field ivec3_IVEC3-xyz
	drop 0 8 +field ivec3_IVEC3-xy
drop 12 end-structure
\ ivec3_IVEC3_RGB
begin-structure ivec3_IVEC3_RGB
	drop 8 4 +field ivec3_IVEC3_RGB-b
	drop 0 4 +field ivec3_IVEC3_RGB-r
	drop 4 4 +field ivec3_IVEC3_RGB-g
drop 12 end-structure
\ ivec3_IVEC3_RGB_b
begin-structure ivec3_IVEC3_RGB_b
	drop 0 4 +field ivec3_IVEC3_RGB_b-b
	drop 0 4 +field ivec3_IVEC3_RGB_b-blue
	drop 0 4 +field ivec3_IVEC3_RGB_b-z
	drop 0 4 +field ivec3_IVEC3_RGB_b-depth
drop 4 end-structure
\ ivec3_IVEC3_RGB_g
begin-structure ivec3_IVEC3_RGB_g
	drop 0 4 +field ivec3_IVEC3_RGB_g-y
	drop 0 4 +field ivec3_IVEC3_RGB_g-green
	drop 0 4 +field ivec3_IVEC3_RGB_g-height
	drop 0 4 +field ivec3_IVEC3_RGB_g-g
drop 4 end-structure
\ ivec3_IVEC3_RGB_r
begin-structure ivec3_IVEC3_RGB_r
	drop 0 4 +field ivec3_IVEC3_RGB_r-x
	drop 0 4 +field ivec3_IVEC3_RGB_r-r
	drop 0 4 +field ivec3_IVEC3_RGB_r-red
	drop 0 4 +field ivec3_IVEC3_RGB_r-width
drop 4 end-structure
\ ivec2
begin-structure ivec2
	drop 0 8 +field ivec2-IVEC2
drop 8 end-structure
\ ivec2_IVEC2
begin-structure ivec2_IVEC2
	drop 0 8 +field ivec2_IVEC2-XY
	drop 0 8 +field ivec2_IVEC2-data
	drop 0 8 +field ivec2_IVEC2-xy
drop 8 end-structure
\ ivec2_IVEC2_XY
begin-structure ivec2_IVEC2_XY
	drop 0 4 +field ivec2_IVEC2_XY-x
	drop 4 4 +field ivec2_IVEC2_XY-y
drop 8 end-structure
\ ivec2_IVEC2_XY_y
begin-structure ivec2_IVEC2_XY_y
	drop 0 4 +field ivec2_IVEC2_XY_y-alpha
	drop 0 4 +field ivec2_IVEC2_XY_y-y
	drop 0 4 +field ivec2_IVEC2_XY_y-height
	drop 0 4 +field ivec2_IVEC2_XY_y-a
drop 4 end-structure
\ ivec2_IVEC2_XY_x
begin-structure ivec2_IVEC2_XY_x
	drop 0 4 +field ivec2_IVEC2_XY_x-x
	drop 0 4 +field ivec2_IVEC2_XY_x-l
	drop 0 4 +field ivec2_IVEC2_XY_x-width
	drop 0 4 +field ivec2_IVEC2_XY_x-luminance
drop 4 end-structure
\ vector_t
begin-structure vector_t
	drop 0 8 +field vector_t-items
	drop 16 8 +field vector_t-size
	drop 24 8 +field vector_t-item_size
	drop 8 8 +field vector_t-capacity
drop 32 end-structure
\ texture_atlas_t
begin-structure texture_atlas_t
	drop 48 8 +field texture_atlas_t-data
	drop 40 4 +field texture_atlas_t-id
	drop 0 8 +field texture_atlas_t-nodes
	drop 16 8 +field texture_atlas_t-height
	drop 32 8 +field texture_atlas_t-used
	drop 8 8 +field texture_atlas_t-width
	drop 24 8 +field texture_atlas_t-depth
drop 56 end-structure
\ kerning_t
begin-structure kerning_t
	drop 0 4 +field kerning_t-charcode
	drop 4 4 +field kerning_t-kerning
drop 8 end-structure
\ texture_glyph_t
begin-structure texture_glyph_t
	drop 0 4 +field texture_glyph_t-charcode
	drop 44 4 +field texture_glyph_t-t0
	drop 4 4 +field texture_glyph_t-id
	drop 52 4 +field texture_glyph_t-t1
	drop 16 8 +field texture_glyph_t-height
	drop 24 4 +field texture_glyph_t-offset_x
	drop 40 4 +field texture_glyph_t-s0
	drop 8 8 +field texture_glyph_t-width
	drop 28 4 +field texture_glyph_t-offset_y
	drop 32 4 +field texture_glyph_t-advance_x
	drop 48 4 +field texture_glyph_t-s1
	drop 36 4 +field texture_glyph_t-advance_y
	drop 56 8 +field texture_glyph_t-kerning
drop 64 end-structure
\ texture_font_t
begin-structure texture_font_t
	drop 0 8 +field texture_font_t-glyphs
	drop 16 8 +field texture_font_t-filename
	drop 32 4 +field texture_font_t-filtering
	drop 24 4 +field texture_font_t-size
	drop 36 5 +field texture_font_t-lcd_weights
	drop 44 4 +field texture_font_t-height
	drop 8 8 +field texture_font_t-atlas
	drop 28 4 +field texture_font_t-hinting
	drop 48 4 +field texture_font_t-linegap
	drop 52 4 +field texture_font_t-ascender
	drop 56 4 +field texture_font_t-descender
drop 64 end-structure

\ ------===< functions >===-------
c-function vector_new vector_new n -- a
c-function vector_delete vector_delete a -- void
c-function vector_get vector_get a n -- a
c-function vector_front vector_front a -- a
c-function vector_back vector_back a -- a
c-function vector_contains vector_contains a a a -- n
c-function vector_empty vector_empty a -- n
c-function vector_size vector_size a -- n
c-function vector_reserve vector_reserve a n -- void
c-function vector_capacity vector_capacity a -- n
c-function vector_shrink vector_shrink a -- void
c-function vector_clear vector_clear a -- void
c-function vector_set vector_set a n a -- void
c-function vector_erase vector_erase a n -- void
c-function vector_erase_range vector_erase_range a n n -- void
c-function vector_push_back vector_push_back a a -- void
c-function vector_pop_back vector_pop_back a -- void
c-function vector_resize vector_resize a n -- void
c-function vector_insert vector_insert a n a -- void
c-function vector_insert_data vector_insert_data a n a n -- void
c-function vector_push_back_data vector_push_back_data a a n -- void
c-function vector_sort vector_sort a a -- void
c-function texture_atlas_new texture_atlas_new n n n -- a
c-function texture_atlas_delete texture_atlas_delete a -- void
c-function texture_atlas_upload texture_atlas_upload a -- void
\c #define texture_atlas_get_regionp(self, w, h, x) { ivec4* _x=x; *_x=texture_atlas_get_region(self,w,h); }
c-function texture_atlas_get_region texture_atlas_get_regionp a n n a -- void
c-function texture_atlas_set_region texture_atlas_set_region a n n n n a n -- void
c-function texture_atlas_clear texture_atlas_clear a -- void
c-function texture_font_new texture_font_new a a r -- a
c-function texture_font_delete texture_font_delete a -- void
c-function texture_font_get_glyph texture_font_get_glyph a n -- a
c-function texture_font_load_glyphs texture_font_load_glyphs a a -- n
c-function texture_glyph_get_kerning texture_glyph_get_kerning a n -- r
end-c-library
previous set-current

Added freetype-gl32.fs.

























































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
\ This file has been generated using SWIG and fsi,
\ and is already platform dependent, search for the corresponding
\ fsi-file to compile it where no one has compiled it before ;)
\ GForth has its own dynamic loader and doesn't need addional C-Code.
\ That's why this file contains normal Gforth-code( version 0.6.9 or higher )
\ and could be used directly with include or require.
\ As all comments are stripped during the compilation, please
\ insert the copyright notice of the original file here.

Vocabulary freetype-gl
get-current also freetype-gl definitions
c-library freetype_gl
    s" freetype-gl" add-lib
    [IFDEF] android
        s" ./.libs" add-libpath
        
        \c #include "../../../../../freetype-gl/freetype-gl.h"
    [ELSE]
        \c #include <freetype-gl.h>
    [THEN]
\ -------===< structs >===--------
\ vec4
begin-structure vec4
	drop 0 16 +field vec4-data
	drop 0 16 +field vec4-xyzw
	drop 0 12 +field vec4-rgb
	drop 0 16 +field vec4-rgba
	drop 0 12 +field vec4-xyz
drop 16 end-structure
\ vec3
begin-structure vec3
	drop 0 12 +field vec3-data
	drop 0 12 +field vec3-rgb
	drop 0 12 +field vec3-xyz
	drop 0 8 +field vec3-xy
drop 12 end-structure
\ vec2
begin-structure vec2
	drop 0 8 +field vec2-data
	drop 0 8 +field vec2-xy
drop 8 end-structure
\ ivec4
begin-structure ivec4
	drop 0 16 +field ivec4-data
	drop 0 16 +field ivec4-xyzw
	drop 0 12 +field ivec4-rgb
	drop 0 16 +field ivec4-rgba
	drop 0 12 +field ivec4-xyz
	drop 0 16 +field ivec4-XYZW_
drop 16 end-structure
\ ivec4_XYZW
begin-structure ivec4_XYZW
	drop 12 4 +field ivec4_XYZW-w
	drop 0 4 +field ivec4_XYZW-x
	drop 4 4 +field ivec4_XYZW-y
	drop 8 4 +field ivec4_XYZW-z
drop 16 end-structure
\ ivec3
begin-structure ivec3
	drop 0 12 +field ivec3-data
	drop 0 12 +field ivec3-rgb
	drop 0 12 +field ivec3-xyz
	drop 0 8 +field ivec3-xy
	drop 0 12 +field ivec3-XYZ_
drop 12 end-structure
\ ivec3_XYZ
begin-structure ivec3_XYZ
	drop 0 4 +field ivec3_XYZ-x
	drop 4 4 +field ivec3_XYZ-y
	drop 8 4 +field ivec3_XYZ-z
drop 12 end-structure
\ ivec2
begin-structure ivec2
	drop 0 8 +field ivec2-data
	drop 0 8 +field ivec2-xy
drop 8 end-structure
\ vector_t
begin-structure vector_t
	drop 0 8 +field vector_t-items
	drop 16 8 +field vector_t-size
	drop 24 8 +field vector_t-item_size
	drop 8 8 +field vector_t-capacity
drop 32 end-structure
\ texture_atlas_t
begin-structure texture_atlas_t
	drop 48 8 +field texture_atlas_t-data
	drop 40 4 +field texture_atlas_t-id
	drop 0 8 +field texture_atlas_t-nodes
	drop 16 8 +field texture_atlas_t-height
	drop 32 8 +field texture_atlas_t-used
	drop 8 8 +field texture_atlas_t-width
	drop 24 8 +field texture_atlas_t-depth
drop 56 end-structure
\ kerning_t
begin-structure kerning_t
	drop 0 4 +field kerning_t-charcode
	drop 4 4 +field kerning_t-kerning
drop 8 end-structure
\ texture_glyph_t
begin-structure texture_glyph_t
	drop 16 8 +field texture_glyph_t-height
	drop 44 4 +field texture_glyph_t-t0
	drop 52 4 +field texture_glyph_t-t1
	drop 40 4 +field texture_glyph_t-s0
	drop 68 4 +field texture_glyph_t-outline_thickness
	drop 48 4 +field texture_glyph_t-s1
	drop 24 4 +field texture_glyph_t-offset_x
	drop 28 4 +field texture_glyph_t-offset_y
	drop 64 4 +field texture_glyph_t-outline_type
	drop 32 4 +field texture_glyph_t-advance_x
	drop 36 4 +field texture_glyph_t-advance_y
	drop 4 4 +field texture_glyph_t-id
	drop 8 8 +field texture_glyph_t-width
	drop 0 4 +field texture_glyph_t-charcode
	drop 56 8 +field texture_glyph_t-kerning
drop 72 end-structure
\ texture_font_t
begin-structure texture_font_t
	drop 64 4 +field texture_font_t-descender
	drop 60 4 +field texture_font_t-ascender
	drop 52 4 +field texture_font_t-height
	drop 24 4 +field texture_font_t-size
	drop 0 8 +field texture_font_t-glyphs
	drop 56 4 +field texture_font_t-linegap
	drop 36 4 +field texture_font_t-outline_thickness
	drop 72 4 +field texture_font_t-underline_thickness
	drop 40 4 +field texture_font_t-filtering
	drop 32 4 +field texture_font_t-outline_type
	drop 8 8 +field texture_font_t-atlas
	drop 44 5 +field texture_font_t-lcd_weights
	drop 28 4 +field texture_font_t-hinting
	drop 68 4 +field texture_font_t-underline_position
	drop 16 8 +field texture_font_t-filename
drop 80 end-structure

\ ------===< functions >===-------
c-function vector_new vector_new n -- a
c-function vector_delete vector_delete a -- void
c-function vector_get vector_get a n -- a
c-function vector_front vector_front a -- a
c-function vector_back vector_back a -- a
c-function vector_contains vector_contains a a a -- n
c-function vector_empty vector_empty a -- n
c-function vector_size vector_size a -- n
c-function vector_reserve vector_reserve a n -- void
c-function vector_capacity vector_capacity a -- n
c-function vector_shrink vector_shrink a -- void
c-function vector_clear vector_clear a -- void
c-function vector_set vector_set a n a -- void
c-function vector_erase vector_erase a n -- void
c-function vector_erase_range vector_erase_range a n n -- void
c-function vector_push_back vector_push_back a a -- void
c-function vector_pop_back vector_pop_back a -- void
c-function vector_resize vector_resize a n -- void
c-function vector_insert vector_insert a n a -- void
c-function vector_insert_data vector_insert_data a n a n -- void
c-function vector_push_back_data vector_push_back_data a a n -- void
c-function vector_sort vector_sort a a -- void
c-function texture_atlas_new texture_atlas_new n n n -- a
c-function texture_atlas_delete texture_atlas_delete a -- void
c-function texture_atlas_upload texture_atlas_upload a -- void
\c #define texture_atlas_get_regionp(self, w, h, x) { ivec4* _x=x; *_x=texture_atlas_get_region(self,w,h); }
c-function texture_atlas_get_region texture_atlas_get_regionp a n n a -- void
c-function texture_atlas_set_region texture_atlas_set_region a n n n n a n -- void
c-function texture_atlas_clear texture_atlas_clear a -- void
c-function texture_font_new texture_font_new a a r -- a
c-function texture_font_delete texture_font_delete a -- void
c-function texture_font_get_glyph texture_font_get_glyph a n -- a
c-function texture_font_load_glyphs texture_font_load_glyphs a a -- n
c-function texture_glyph_get_kerning texture_glyph_get_kerning a n -- r
end-c-library
previous set-current

Added freetype-gl64.fs.

































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
\ This file has been generated using SWIG and fsi,
\ and is already platform dependent, search for the corresponding
\ fsi-file to compile it where no one has compiled it before ;)
\ GForth has its own dynamic loader and doesn't need addional C-Code.
\ That's why this file contains normal Gforth-code( version 0.6.9 or higher )
\ and could be used directly with include or require.
\ As all comments are stripped during the compilation, please
\ insert the copyright notice of the original file here.

Vocabulary freetype-gl
get-current also freetype-gl definitions
c-library freetype_gl
    s" freetype-gl" add-lib
    [IFDEF] android
        s" ./.libs" add-libpath
        
        \c #include "../../../../../freetype-gl/freetype-gl.h"
    [ELSE]
        \c #include <freetype-gl.h>
    [THEN]
\ -------===< structs >===--------
\ struct vec4
begin-structure struct-vec4
	drop 0 16 +field struct-vec4-VEC4
drop 16 end-structure
\ vec4_VEC4
begin-structure vec4_VEC4
	drop 0 16 +field vec4_VEC4-RGBA
	drop 0 16 +field vec4_VEC4-data
	drop 0 12 +field vec4_VEC4-rgb
	drop 0 16 +field vec4_VEC4-rgba
	drop 0 12 +field vec4_VEC4-xyz
drop 16 end-structure
\ vec4_VEC4_RGBA
begin-structure vec4_VEC4_RGBA
	drop 8 4 +field vec4_VEC4_RGBA-b
	drop 0 4 +field vec4_VEC4_RGBA-r
	drop 4 4 +field vec4_VEC4_RGBA-g
	drop 12 4 +field vec4_VEC4_RGBA-a
drop 16 end-structure
\ vec4_VEC4_RGBA_a
begin-structure vec4_VEC4_RGBA_a
	drop 0 4 +field vec4_VEC4_RGBA_a-w
	drop 0 4 +field vec4_VEC4_RGBA_a-alpha
	drop 0 4 +field vec4_VEC4_RGBA_a-height
	drop 0 4 +field vec4_VEC4_RGBA_a-a
drop 4 end-structure
\ vec4_VEC4_RGBA_b
begin-structure vec4_VEC4_RGBA_b
	drop 0 4 +field vec4_VEC4_RGBA_b-b
	drop 0 4 +field vec4_VEC4_RGBA_b-blue
	drop 0 4 +field vec4_VEC4_RGBA_b-z
	drop 0 4 +field vec4_VEC4_RGBA_b-width
drop 4 end-structure
\ vec4_VEC4_RGBA_g
begin-structure vec4_VEC4_RGBA_g
	drop 0 4 +field vec4_VEC4_RGBA_g-y
	drop 0 4 +field vec4_VEC4_RGBA_g-green
	drop 0 4 +field vec4_VEC4_RGBA_g-g
drop 4 end-structure
\ vec4_VEC4_RGBA_r
begin-structure vec4_VEC4_RGBA_r
	drop 0 4 +field vec4_VEC4_RGBA_r-x
	drop 0 4 +field vec4_VEC4_RGBA_r-r
	drop 0 4 +field vec4_VEC4_RGBA_r-red
drop 4 end-structure
\ struct vec3
begin-structure struct-vec3
	drop 0 12 +field struct-vec3-VEC3
drop 12 end-structure
\ vec3_VEC3
begin-structure vec3_VEC3
	drop 0 12 +field vec3_VEC3-data
	drop 0 12 +field vec3_VEC3-rgb
	drop 0 12 +field vec3_VEC3-RGB
	drop 0 12 +field vec3_VEC3-xyz
drop 12 end-structure
\ vec3_VEC3_RGB
begin-structure vec3_VEC3_RGB
	drop 8 4 +field vec3_VEC3_RGB-b
	drop 0 4 +field vec3_VEC3_RGB-r
	drop 4 4 +field vec3_VEC3_RGB-g
drop 12 end-structure
\ vec3_VEC3_RGB_b
begin-structure vec3_VEC3_RGB_b
	drop 0 4 +field vec3_VEC3_RGB_b-b
	drop 0 4 +field vec3_VEC3_RGB_b-blue
	drop 0 4 +field vec3_VEC3_RGB_b-z
	drop 0 4 +field vec3_VEC3_RGB_b-depth
drop 4 end-structure
\ vec3_VEC3_RGB_g
begin-structure vec3_VEC3_RGB_g
	drop 0 4 +field vec3_VEC3_RGB_g-y
	drop 0 4 +field vec3_VEC3_RGB_g-green
	drop 0 4 +field vec3_VEC3_RGB_g-height
	drop 0 4 +field vec3_VEC3_RGB_g-g
drop 4 end-structure
\ vec3_VEC3_RGB_r
begin-structure vec3_VEC3_RGB_r
	drop 0 4 +field vec3_VEC3_RGB_r-x
	drop 0 4 +field vec3_VEC3_RGB_r-r
	drop 0 4 +field vec3_VEC3_RGB_r-red
	drop 0 4 +field vec3_VEC3_RGB_r-width
drop 4 end-structure
\ struct vec2
begin-structure struct-vec2
	drop 0 8 +field struct-vec2-VEC2
drop 8 end-structure
\ vec2_VEC2
begin-structure vec2_VEC2
	drop 0 8 +field vec2_VEC2-XY
	drop 0 8 +field vec2_VEC2-data
	drop 0 8 +field vec2_VEC2-xy
drop 8 end-structure
\ vec2_VEC2_XY
begin-structure vec2_VEC2_XY
	drop 0 4 +field vec2_VEC2_XY-x
	drop 4 4 +field vec2_VEC2_XY-y
drop 8 end-structure
\ vec2_VEC2_XY_y
begin-structure vec2_VEC2_XY_y
	drop 0 4 +field vec2_VEC2_XY_y-alpha
	drop 0 4 +field vec2_VEC2_XY_y-y
	drop 0 4 +field vec2_VEC2_XY_y-height
	drop 0 4 +field vec2_VEC2_XY_y-a
drop 4 end-structure
\ vec2_VEC2_XY_x
begin-structure vec2_VEC2_XY_x
	drop 0 4 +field vec2_VEC2_XY_x-x
	drop 0 4 +field vec2_VEC2_XY_x-l
	drop 0 4 +field vec2_VEC2_XY_x-width
	drop 0 4 +field vec2_VEC2_XY_x-luminance
drop 4 end-structure
\ ivec4
begin-structure ivec4
	drop 0 16 +field ivec4-IVEC4
drop 16 end-structure
\ ivec4_IVEC4
begin-structure ivec4_IVEC4
	drop 0 16 +field ivec4_IVEC4-RGBA
	drop 0 16 +field ivec4_IVEC4-data
	drop 0 12 +field ivec4_IVEC4-rgb
	drop 0 16 +field ivec4_IVEC4-rgba
	drop 0 12 +field ivec4_IVEC4-xyz
drop 16 end-structure
\ ivec4_IVEC4_RGBA
begin-structure ivec4_IVEC4_RGBA
	drop 8 4 +field ivec4_IVEC4_RGBA-b
	drop 0 4 +field ivec4_IVEC4_RGBA-r
	drop 4 4 +field ivec4_IVEC4_RGBA-g
	drop 12 4 +field ivec4_IVEC4_RGBA-a
drop 16 end-structure
\ ivec4_IVEC4_RGBA_a
begin-structure ivec4_IVEC4_RGBA_a
	drop 0 4 +field ivec4_IVEC4_RGBA_a-w
	drop 0 4 +field ivec4_IVEC4_RGBA_a-alpha
	drop 0 4 +field ivec4_IVEC4_RGBA_a-height
	drop 0 4 +field ivec4_IVEC4_RGBA_a-a
drop 4 end-structure
\ ivec4_IVEC4_RGBA_b
begin-structure ivec4_IVEC4_RGBA_b
	drop 0 4 +field ivec4_IVEC4_RGBA_b-b
	drop 0 4 +field ivec4_IVEC4_RGBA_b-blue
	drop 0 4 +field ivec4_IVEC4_RGBA_b-z
	drop 0 4 +field ivec4_IVEC4_RGBA_b-width
drop 4 end-structure
\ ivec4_IVEC4_RGBA_g
begin-structure ivec4_IVEC4_RGBA_g
	drop 0 4 +field ivec4_IVEC4_RGBA_g-y
	drop 0 4 +field ivec4_IVEC4_RGBA_g-green
	drop 0 4 +field ivec4_IVEC4_RGBA_g-g
drop 4 end-structure
\ ivec4_IVEC4_RGBA_r
begin-structure ivec4_IVEC4_RGBA_r
	drop 0 4 +field ivec4_IVEC4_RGBA_r-x
	drop 0 4 +field ivec4_IVEC4_RGBA_r-r
	drop 0 4 +field ivec4_IVEC4_RGBA_r-red
drop 4 end-structure
\ ivec3
begin-structure ivec3
	drop 0 12 +field ivec3-IVEC3
drop 12 end-structure
\ ivec3_IVEC3
begin-structure ivec3_IVEC3
	drop 0 12 +field ivec3_IVEC3-data
	drop 0 12 +field ivec3_IVEC3-rgb
	drop 0 12 +field ivec3_IVEC3-RGB
	drop 0 12 +field ivec3_IVEC3-xyz
	drop 0 8 +field ivec3_IVEC3-xy
drop 12 end-structure
\ ivec3_IVEC3_RGB
begin-structure ivec3_IVEC3_RGB
	drop 8 4 +field ivec3_IVEC3_RGB-b
	drop 0 4 +field ivec3_IVEC3_RGB-r
	drop 4 4 +field ivec3_IVEC3_RGB-g
drop 12 end-structure
\ ivec3_IVEC3_RGB_b
begin-structure ivec3_IVEC3_RGB_b
	drop 0 4 +field ivec3_IVEC3_RGB_b-b
	drop 0 4 +field ivec3_IVEC3_RGB_b-blue
	drop 0 4 +field ivec3_IVEC3_RGB_b-z
	drop 0 4 +field ivec3_IVEC3_RGB_b-depth
drop 4 end-structure
\ ivec3_IVEC3_RGB_g
begin-structure ivec3_IVEC3_RGB_g
	drop 0 4 +field ivec3_IVEC3_RGB_g-y
	drop 0 4 +field ivec3_IVEC3_RGB_g-green
	drop 0 4 +field ivec3_IVEC3_RGB_g-height
	drop 0 4 +field ivec3_IVEC3_RGB_g-g
drop 4 end-structure
\ ivec3_IVEC3_RGB_r
begin-structure ivec3_IVEC3_RGB_r
	drop 0 4 +field ivec3_IVEC3_RGB_r-x
	drop 0 4 +field ivec3_IVEC3_RGB_r-r
	drop 0 4 +field ivec3_IVEC3_RGB_r-red
	drop 0 4 +field ivec3_IVEC3_RGB_r-width
drop 4 end-structure
\ ivec2
begin-structure ivec2
	drop 0 8 +field ivec2-IVEC2
drop 8 end-structure
\ ivec2_IVEC2
begin-structure ivec2_IVEC2
	drop 0 8 +field ivec2_IVEC2-XY
	drop 0 8 +field ivec2_IVEC2-data
	drop 0 8 +field ivec2_IVEC2-xy
drop 8 end-structure
\ ivec2_IVEC2_XY
begin-structure ivec2_IVEC2_XY
	drop 0 4 +field ivec2_IVEC2_XY-x
	drop 4 4 +field ivec2_IVEC2_XY-y
drop 8 end-structure
\ ivec2_IVEC2_XY_y
begin-structure ivec2_IVEC2_XY_y
	drop 0 4 +field ivec2_IVEC2_XY_y-alpha
	drop 0 4 +field ivec2_IVEC2_XY_y-y
	drop 0 4 +field ivec2_IVEC2_XY_y-height
	drop 0 4 +field ivec2_IVEC2_XY_y-a
drop 4 end-structure
\ ivec2_IVEC2_XY_x
begin-structure ivec2_IVEC2_XY_x
	drop 0 4 +field ivec2_IVEC2_XY_x-x
	drop 0 4 +field ivec2_IVEC2_XY_x-l
	drop 0 4 +field ivec2_IVEC2_XY_x-width
	drop 0 4 +field ivec2_IVEC2_XY_x-luminance
drop 4 end-structure
\ vector_t
begin-structure vector_t
	drop 0 8 +field vector_t-items
	drop 16 8 +field vector_t-size
	drop 24 8 +field vector_t-item_size
	drop 8 8 +field vector_t-capacity
drop 32 end-structure
\ texture_atlas_t
begin-structure texture_atlas_t
	drop 48 8 +field texture_atlas_t-data
	drop 40 4 +field texture_atlas_t-id
	drop 0 8 +field texture_atlas_t-nodes
	drop 16 8 +field texture_atlas_t-height
	drop 32 8 +field texture_atlas_t-used
	drop 8 8 +field texture_atlas_t-width
	drop 24 8 +field texture_atlas_t-depth
drop 56 end-structure
\ kerning_t
begin-structure kerning_t
	drop 0 4 +field kerning_t-charcode
	drop 4 4 +field kerning_t-kerning
drop 8 end-structure
\ texture_glyph_t
begin-structure texture_glyph_t
	drop 0 4 +field texture_glyph_t-charcode
	drop 44 4 +field texture_glyph_t-t0
	drop 4 4 +field texture_glyph_t-id
	drop 52 4 +field texture_glyph_t-t1
	drop 16 8 +field texture_glyph_t-height
	drop 24 4 +field texture_glyph_t-offset_x
	drop 40 4 +field texture_glyph_t-s0
	drop 8 8 +field texture_glyph_t-width
	drop 28 4 +field texture_glyph_t-offset_y
	drop 32 4 +field texture_glyph_t-advance_x
	drop 48 4 +field texture_glyph_t-s1
	drop 36 4 +field texture_glyph_t-advance_y
	drop 56 8 +field texture_glyph_t-kerning
drop 64 end-structure
\ texture_font_t
begin-structure texture_font_t
	drop 0 8 +field texture_font_t-glyphs
	drop 16 8 +field texture_font_t-filename
	drop 32 4 +field texture_font_t-filtering
	drop 24 4 +field texture_font_t-size
	drop 36 5 +field texture_font_t-lcd_weights
	drop 44 4 +field texture_font_t-height
	drop 8 8 +field texture_font_t-atlas
	drop 28 4 +field texture_font_t-hinting
	drop 48 4 +field texture_font_t-linegap
	drop 52 4 +field texture_font_t-ascender
	drop 56 4 +field texture_font_t-descender
drop 64 end-structure

\ ------===< functions >===-------
c-function vector_new vector_new n -- a
c-function vector_delete vector_delete a -- void
c-function vector_get vector_get a n -- a
c-function vector_front vector_front a -- a
c-function vector_back vector_back a -- a
c-function vector_contains vector_contains a a a -- n
c-function vector_empty vector_empty a -- n
c-function vector_size vector_size a -- n
c-function vector_reserve vector_reserve a n -- void
c-function vector_capacity vector_capacity a -- n
c-function vector_shrink vector_shrink a -- void
c-function vector_clear vector_clear a -- void
c-function vector_set vector_set a n a -- void
c-function vector_erase vector_erase a n -- void
c-function vector_erase_range vector_erase_range a n n -- void
c-function vector_push_back vector_push_back a a -- void
c-function vector_pop_back vector_pop_back a -- void
c-function vector_resize vector_resize a n -- void
c-function vector_insert vector_insert a n a -- void
c-function vector_insert_data vector_insert_data a n a n -- void
c-function vector_push_back_data vector_push_back_data a a n -- void
c-function vector_sort vector_sort a a -- void
c-function texture_atlas_new texture_atlas_new n n n -- a
c-function texture_atlas_delete texture_atlas_delete a -- void
c-function texture_atlas_upload texture_atlas_upload a -- void
\c #define texture_atlas_get_regionp(self, w, h, x) { ivec4* _x=x; *_x=texture_atlas_get_region(self,w,h); }
c-function texture_atlas_get_region texture_atlas_get_regionp a n n a -- void
c-function texture_atlas_set_region texture_atlas_set_region a n n n n a n -- void
c-function texture_atlas_clear texture_atlas_clear a -- void
c-function texture_font_new texture_font_new a a r -- a
c-function texture_font_delete texture_font_delete a -- void
c-function texture_font_get_glyph texture_font_get_glyph a n -- a
c-function texture_font_load_glyphs texture_font_load_glyphs a a -- n
c-function texture_glyph_get_kerning texture_glyph_get_kerning a n -- r
end-c-library
previous set-current

Changes to ftgl-sample.fs.

1



2
3
4
5
6
7
8
9
10
11
12


13
14
15


16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

32
33
34
35
\ freetype GL example




require ftgl-helper.fs

\ Demo Toplevel

also freetype-gl
also opengl
also android

48e FConstant fontsize#
atlas "/system/fonts/DroidSans.ttf\0" drop


fontsize# texture_font_new Value font1

atlas "/system/fonts/DroidSansFallback.ttf\0" drop


fontsize# texture_font_new Value font2

Variable text1$ "Dös isch a Tägscht." text1$ $!
Variable text2$ "这是一个文本:在德语说" text2$ $!

: glyph-demo ( -- )  hidekb
    1 level# +!  BEGIN
	0.01e 0.02e 0.15e 1.0e glClearColor
	clear
	Ambient 1 ambient% glUniform1fv
	<render
	0. penxy 2!
	font1 to font  text1$ $@ render-string
	-100e penxy sf! -60e penxy sfloat+ sf!
	font2 to font  text2$ $@ render-string
	render>

	sync >looper
    level# @ 0= UNTIL ;

previous previous previous

>
>
>







|


|
>
>


|
>
>





|
<
|
|
|
|
|
|
|
|
|
>
|
|


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

29
30
31
32
33
34
35
36
37
38
39
40
41
42
\ freetype GL example

require gl-helper.fs
window-init

require ftgl-helper.fs

\ Demo Toplevel

also freetype-gl
also opengl
also [IFDEF] android android [THEN]

48e FConstant fontsize#
atlas [IFDEF] android  "/system/fonts/DroidSans.ttf\0" drop
[ELSE] "/usr/share/fonts/truetype/LiberationSans-Regular.ttf\0" drop 
[THEN]
fontsize# texture_font_new Value font1

atlas [IFDEF] android  "/system/fonts/DroidSansFallback.ttf\0" drop
[ELSE] "/usr/share/fonts/truetype/bkai00mp.ttf\0" drop
[THEN]
fontsize# texture_font_new Value font2

Variable text1$ "Dös isch a Tägscht." text1$ $!
Variable text2$ "这是一个文本:在德语说" text2$ $!

: glyph-draw ( -- )

    0.01e 0.02e 0.15e 1.0e glClearColor
    clear
    Ambient 1 ambient% glUniform1fv
    <render
    0. penxy 2!
    font1 to font  text1$ $@ render-string
    -100e penxy sf! -60e penxy sfloat+ sf!
    font2 to font  text2$ $@ render-string
    render> sync ;

: glyph-demo ( -- ) [IFDEF] hidekb  hidekb [THEN]
    1 level# +!  BEGIN  glyph-draw  >looper  level# @ 0= UNTIL ;

previous previous previous

Changes to gl-helper.fs.

518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
...
570
571
572
573
574
575
576

577
578
579
580
581
582
583

584
585
586
587
588
589
590
591

592




593
594
595
596
597
598
599

$8 cells buffer: gl-buffers
: buf@ ( n -- buf ) cells gl-buffers + @ ;
: bind-buf ( type n -- ) buf@ glBindBuffer ;

0 Value array-buf
0 Value index-buf
Variable index#

$1000 Value points# \ 4k points

object class
    sffield: v.x
    sffield: v.y
    sffield: v.z
................................................................................
    glBufferData
    GL_ARRAY_BUFFER 0 bind-buf
    GL_ARRAY_BUFFER points# vertex# * array-buf GL_DYNAMIC_DRAW
    glBufferData
    vertex-init ;

array-buf Value buf^


: draw-elements ( type -- )
    GL_ARRAY_BUFFER 0 buf^ array-buf - array-buf glBufferSubData
    GL_ELEMENT_ARRAY_BUFFER 0 index# @ 2* index-buf glBufferSubData
    index# @ GL_UNSIGNED_SHORT 0 glDrawElements ;

: v0 ( -- ) array-buf to buf^ ;


: >v ( -- o:vertex0 )  ]] buf^ >o [[ ; immediate compile-only
: v+ ( o:vertex -- o:vertex' )
    next-vertex >o rdrop ;
: v> ( o:vertex -- )  ]] o ->buf^ o> [[ ; immediate compile-only
: i0 ( -- )   index# off ;
: i? ( -- n )  buf^ array-buf - vertex# / ;
: i, ( n -- )

    index-buf index# @ 2* + w!  1 index# +! ;





: >xyz ( x y z -- )  v.z sf! v.y sf! v.x sf! 1e v.t sf! ;
\ note: this is a right hand system, therefore the z coordinate is negative
: >xy ( x y -- )  -1e >xyz ;
: color! ( rgba addr -- rgb ) >r dup $FF and s>f $FF fm/ r> sf! 8 rshift ;
: rgba>c ( rgba -- )  c.a color! c.b color! c.g color! c.r color! drop ;
: abgr>c ( abgr -- )  c.r color! c.g color! c.b color! c.a color! drop ;







<







 







>



|
|


>





<


>
|
>
>
>
>







518
519
520
521
522
523
524

525
526
527
528
529
530
531
...
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589

590
591
592
593
594
595
596
597
598
599
600
601
602
603
604

$8 cells buffer: gl-buffers
: buf@ ( n -- buf ) cells gl-buffers + @ ;
: bind-buf ( type n -- ) buf@ glBindBuffer ;

0 Value array-buf
0 Value index-buf


$1000 Value points# \ 4k points

object class
    sffield: v.x
    sffield: v.y
    sffield: v.z
................................................................................
    glBufferData
    GL_ARRAY_BUFFER 0 bind-buf
    GL_ARRAY_BUFFER points# vertex# * array-buf GL_DYNAMIC_DRAW
    glBufferData
    vertex-init ;

array-buf Value buf^
index-buf Value index^

: draw-elements ( type -- )
    GL_ARRAY_BUFFER 0 buf^ array-buf - array-buf glBufferSubData
    GL_ELEMENT_ARRAY_BUFFER 0 index^ index-buf - index-buf glBufferSubData
    index^ index-buf - 2/ GL_UNSIGNED_SHORT 0 glDrawElements ;

: v0 ( -- ) array-buf to buf^ ;
: i0 ( -- ) index-buf to index^ ;

: >v ( -- o:vertex0 )  ]] buf^ >o [[ ; immediate compile-only
: v+ ( o:vertex -- o:vertex' )
    next-vertex >o rdrop ;
: v> ( o:vertex -- )  ]] o ->buf^ o> [[ ; immediate compile-only

: i? ( -- n )  buf^ array-buf - vertex# / ;
: i, ( n -- )
    index^ dup 2 + to index^ w! ;
Variable i-off
: i>off ( -- )  i? i-off ! ;
: ltri ( off -- )  i-off @ dup i, dup 1+ i, + i, ;
: rtri ( off -- )  i-off @ dup 1+ i, + dup i, 1+ i, ;
: quad ( off -- )  dup ltri rtri ;

: >xyz ( x y z -- )  v.z sf! v.y sf! v.x sf! 1e v.t sf! ;
\ note: this is a right hand system, therefore the z coordinate is negative
: >xy ( x y -- )  -1e >xyz ;
: color! ( rgba addr -- rgb ) >r dup $FF and s>f $FF fm/ r> sf! 8 rshift ;
: rgba>c ( rgba -- )  c.a color! c.b color! c.g color! c.r color! drop ;
: abgr>c ( abgr -- )  c.r color! c.g color! c.b color! c.a color! drop ;

Changes to gles2/ftgl-sample.fs.

1



2
3
4
5
6
7
8
9
10
11
12


13
14
15


16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

32
33
34
35
\ freetype GL example




require ftgl-helper.fs

\ Demo Toplevel

also freetype-gl
also opengl
also android

48e FConstant fontsize#
atlas "/system/fonts/DroidSans.ttf\0" drop


fontsize# texture_font_new Value font1

atlas "/system/fonts/DroidSansFallback.ttf\0" drop


fontsize# texture_font_new Value font2

Variable text1$ "Dös isch a Tägscht." text1$ $!
Variable text2$ "这是一个文本:在德语说" text2$ $!

: glyph-demo ( -- )  hidekb
    1 level# +!  BEGIN
	0.01e 0.02e 0.15e 1.0e glClearColor
	clear
	Ambient 1 ambient% glUniform1fv
	<render
	0. penxy 2!
	font1 to font  text1$ $@ render-string
	-100e penxy sf! -60e penxy sfloat+ sf!
	font2 to font  text2$ $@ render-string
	render>

	sync >looper
    level# @ 0= UNTIL ;

previous previous previous

>
>
>







|


|
>
>


|
>
>





|
<
|
|
|
|
|
|
|
|
|
>
|
|


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

29
30
31
32
33
34
35
36
37
38
39
40
41
42
\ freetype GL example

require gl-helper.fs
window-init

require ftgl-helper.fs

\ Demo Toplevel

also freetype-gl
also opengl
also [IFDEF] android android [THEN]

48e FConstant fontsize#
atlas [IFDEF] android  "/system/fonts/DroidSans.ttf\0" drop
[ELSE] "/usr/share/fonts/truetype/LiberationSans-Regular.ttf\0" drop 
[THEN]
fontsize# texture_font_new Value font1

atlas [IFDEF] android  "/system/fonts/DroidSansFallback.ttf\0" drop
[ELSE] "/usr/share/fonts/truetype/bkai00mp.ttf\0" drop
[THEN]
fontsize# texture_font_new Value font2

Variable text1$ "Dös isch a Tägscht." text1$ $!
Variable text2$ "这是一个文本:在德语说" text2$ $!

: glyph-draw ( -- )

    0.01e 0.02e 0.15e 1.0e glClearColor
    clear
    Ambient 1 ambient% glUniform1fv
    <render
    0. penxy 2!
    font1 to font  text1$ $@ render-string
    -100e penxy sf! -60e penxy sfloat+ sf!
    font2 to font  text2$ $@ render-string
    render> sync ;

: glyph-demo ( -- ) [IFDEF] hidekb  hidekb [THEN]
    1 level# +!  BEGIN  glyph-draw  >looper  level# @ 0= UNTIL ;

previous previous previous

Changes to gles2/gl-helper.fs.

518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
...
570
571
572
573
574
575
576

577
578
579
580
581
582
583

584
585
586
587
588
589
590
591

592




593
594
595
596
597
598
599

$8 cells buffer: gl-buffers
: buf@ ( n -- buf ) cells gl-buffers + @ ;
: bind-buf ( type n -- ) buf@ glBindBuffer ;

0 Value array-buf
0 Value index-buf
Variable index#

$1000 Value points# \ 4k points

object class
    sffield: v.x
    sffield: v.y
    sffield: v.z
................................................................................
    glBufferData
    GL_ARRAY_BUFFER 0 bind-buf
    GL_ARRAY_BUFFER points# vertex# * array-buf GL_DYNAMIC_DRAW
    glBufferData
    vertex-init ;

array-buf Value buf^


: draw-elements ( type -- )
    GL_ARRAY_BUFFER 0 buf^ array-buf - array-buf glBufferSubData
    GL_ELEMENT_ARRAY_BUFFER 0 index# @ 2* index-buf glBufferSubData
    index# @ GL_UNSIGNED_SHORT 0 glDrawElements ;

: v0 ( -- ) array-buf to buf^ ;


: >v ( -- o:vertex0 )  ]] buf^ >o [[ ; immediate compile-only
: v+ ( o:vertex -- o:vertex' )
    next-vertex >o rdrop ;
: v> ( o:vertex -- )  ]] o ->buf^ o> [[ ; immediate compile-only
: i0 ( -- )   index# off ;
: i? ( -- n )  buf^ array-buf - vertex# / ;
: i, ( n -- )

    index-buf index# @ 2* + w!  1 index# +! ;





: >xyz ( x y z -- )  v.z sf! v.y sf! v.x sf! 1e v.t sf! ;
\ note: this is a right hand system, therefore the z coordinate is negative
: >xy ( x y -- )  -1e >xyz ;
: color! ( rgba addr -- rgb ) >r dup $FF and s>f $FF fm/ r> sf! 8 rshift ;
: rgba>c ( rgba -- )  c.a color! c.b color! c.g color! c.r color! drop ;
: abgr>c ( abgr -- )  c.r color! c.g color! c.b color! c.a color! drop ;







<







 







>



|
|


>





<


>
|
>
>
>
>







518
519
520
521
522
523
524

525
526
527
528
529
530
531
...
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589

590
591
592
593
594
595
596
597
598
599
600
601
602
603
604

$8 cells buffer: gl-buffers
: buf@ ( n -- buf ) cells gl-buffers + @ ;
: bind-buf ( type n -- ) buf@ glBindBuffer ;

0 Value array-buf
0 Value index-buf


$1000 Value points# \ 4k points

object class
    sffield: v.x
    sffield: v.y
    sffield: v.z
................................................................................
    glBufferData
    GL_ARRAY_BUFFER 0 bind-buf
    GL_ARRAY_BUFFER points# vertex# * array-buf GL_DYNAMIC_DRAW
    glBufferData
    vertex-init ;

array-buf Value buf^
index-buf Value index^

: draw-elements ( type -- )
    GL_ARRAY_BUFFER 0 buf^ array-buf - array-buf glBufferSubData
    GL_ELEMENT_ARRAY_BUFFER 0 index^ index-buf - index-buf glBufferSubData
    index^ index-buf - 2/ GL_UNSIGNED_SHORT 0 glDrawElements ;

: v0 ( -- ) array-buf to buf^ ;
: i0 ( -- ) index-buf to index^ ;

: >v ( -- o:vertex0 )  ]] buf^ >o [[ ; immediate compile-only
: v+ ( o:vertex -- o:vertex' )
    next-vertex >o rdrop ;
: v> ( o:vertex -- )  ]] o ->buf^ o> [[ ; immediate compile-only

: i? ( -- n )  buf^ array-buf - vertex# / ;
: i, ( n -- )
    index^ dup 2 + to index^ w! ;
Variable i-off
: i>off ( -- )  i? i-off ! ;
: ltri ( off -- )  i-off @ dup i, dup 1+ i, + i, ;
: rtri ( off -- )  i-off @ dup 1+ i, + dup i, 1+ i, ;
: quad ( off -- )  dup ltri rtri ;

: >xyz ( x y z -- )  v.z sf! v.y sf! v.x sf! 1e v.t sf! ;
\ note: this is a right hand system, therefore the z coordinate is negative
: >xy ( x y -- )  -1e >xyz ;
: color! ( rgba addr -- rgb ) >r dup $FF and s>f $FF fm/ r> sf! 8 rshift ;
: rgba>c ( rgba -- )  c.a color! c.b color! c.g color! c.r color! drop ;
: abgr>c ( abgr -- )  c.r color! c.g color! c.b color! c.a color! drop ;

Changes to widgets.fs.

87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
' tile-draw tile is draw

tile class
    field: border
end-class frame

Create button-st  0e sf, 0.25e sf, 0.75e sf, 1e sf,
Create button-border 0 c, 1 c, 3 c, 2 c,
Create button-triangles
0 c, 1 c, 4 c,   1 c, 4 c, 5 c,
here button-triangles - Constant button-triangles#
Create button-triangle-off
0 c, 1 c, 2 c,  4 c, 5 c, 6 c,  8 c, 9 c, 10 c,
here button-triangle-off - Constant button-triangle-off#

: frame-draw ( -- )
    frame# @ frame-color @ border @ xywh { f c b x y w h }
    i? >v
    4 0 DO
	4 0 DO
	    x b I button-border + c@ >r
	    r@ 1 and 0= IF drop 0      THEN
	    r> 2 and    IF negate w +  THEN  + s>f
	    y b J button-border + c@ >r
	    r@ 1 and 0= IF drop 0      THEN
	    r> 2 and    IF negate h +  THEN  + s>f >xy
	    c rgba>c
	    n>
	    I sfloats button-st + sf@
	    J sfloats button-st + sf@ f #>st v+
	LOOP
    LOOP
    v>
    button-triangle-off button-triangle-off# bounds DO
	dup I c@ +
	button-triangles button-triangles# bounds DO
	    dup I c@ + i,
	LOOP drop
    LOOP drop
; ' frame-draw frame to draw

: <draw ( -- )  v0 i0
    program glUseProgram  style-tex
    -1e 1e >apxy
    .01e 100e 100e >ap
    0.6e 0.4e 0.2e 1.0e glClearColor clear







|
|
|
|
|
|
<



|


|
<
<
<
<
<
|
<
|
<



|
|
<
<
|
<







87
88
89
90
91
92
93
94
95
96
97
98
99

100
101
102
103
104
105
106





107

108

109
110
111
112
113


114

115
116
117
118
119
120
121
' tile-draw tile is draw

tile class
    field: border
end-class frame

Create button-st  0e sf, 0.25e sf, 0.75e sf, 1e sf,
DOES>  swap sfloats + sf@ ;
: button-border ( n -- gray )  dup 2/ xor ;
: >border ( x b i w -- r ) >r
    button-border >r
    r@ 1 and 0= IF drop 0       THEN
    r> 2 and    IF negate r@ +  THEN  + s>f  rdrop ;


: frame-draw ( -- )
    frame# @ frame-color @ border @ xywh { f c b x y w h }
    i>off >v
    4 0 DO
	4 0 DO
	    x b I w >border  y b J h >border >xy





	    c rgba>c  n>

	    I button-st J button-st f #>st v+

	LOOP
    LOOP
    v>
    9 0  DO
	4 quad  1 I 3 mod 2 = - i-off +!


    LOOP

; ' frame-draw frame to draw

: <draw ( -- )  v0 i0
    program glUseProgram  style-tex
    -1e 1e >apxy
    .01e 100e 100e >ap
    0.6e 0.4e 0.2e 1.0e glClearColor clear