-
Notifications
You must be signed in to change notification settings - Fork 2
/
Nuklear.Draw.cs
570 lines (480 loc) · 28.3 KB
/
Nuklear.Draw.cs
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
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
using System;
using System.Runtime.InteropServices;
using nk_handle = System.IntPtr;
namespace NuklearSharp
{
public enum nk_anti_aliasing {
NK_ANTI_ALIASING_OFF,
NK_ANTI_ALIASING_ON
}
[Flags]
public enum nk_convert_result {
NK_CONVERT_SUCCESS = 0,
NK_CONVERT_INVALID_PARAM = 1,
NK_CONVERT_COMMAND_BUFFER_FULL = (1 << (1)),
NK_CONVERT_VERTEX_BUFFER_FULL = (1 << (2)),
NK_CONVERT_ELEMENT_BUFFER_FULL = (1 << (3))
}
[StructLayout(LayoutKind.Sequential)]
public struct nk_draw_null_texture {
public nk_handle texture;
public nk_vec2 uv;
}
[StructLayout(LayoutKind.Sequential)]
public unsafe struct nk_convert_config {
public float global_alpha;
public nk_anti_aliasing line_AA;
public nk_anti_aliasing shape_AA;
public uint circle_segment_count;
public uint arc_segment_count;
public uint curve_segment_count;
public nk_draw_null_texture null_tex;
public nk_draw_vertex_layout_element* vertex_layout;
public IntPtr vertex_size;
public IntPtr vertex_alignment;
}
public enum nk_command_type {
NK_COMMAND_NOP,
NK_COMMAND_SCISSOR,
NK_COMMAND_LINE,
NK_COMMAND_CURVE,
NK_COMMAND_RECT,
NK_COMMAND_RECT_FILLED,
NK_COMMAND_RECT_MULTI_COLOR,
NK_COMMAND_CIRCLE,
NK_COMMAND_CIRCLE_FILLED,
NK_COMMAND_ARC,
NK_COMMAND_ARC_FILLED,
NK_COMMAND_TRIANGLE,
NK_COMMAND_TRIANGLE_FILLED,
NK_COMMAND_POLYGON,
NK_COMMAND_POLYGON_FILLED,
NK_COMMAND_POLYLINE,
NK_COMMAND_TEXT,
NK_COMMAND_IMAGE,
NK_COMMAND_CUSTOM
}
[StructLayout(LayoutKind.Sequential)]
public struct nk_command {
public nk_command_type ctype;
public IntPtr next_nksize;
public nk_handle userdata;
}
[StructLayout(LayoutKind.Sequential)]
public struct nk_command_scissor {
public nk_command header;
public short x;
public short y;
public ushort w;
public ushort h;
}
[StructLayout(LayoutKind.Sequential)]
public struct nk_command_line {
public nk_command header;
public ushort line_thickness;
public nk_vec2i begin;
public nk_vec2i end;
public nk_color color;
}
[StructLayout(LayoutKind.Sequential)]
public struct nk_command_curve {
public nk_command header;
public ushort line_thickness;
public nk_vec2i begin;
public nk_vec2i end;
public nk_vec2i ctrlA;
public nk_vec2i ctrlB;
public nk_color color;
}
[StructLayout(LayoutKind.Sequential)]
public struct nk_command_rect {
public nk_command header;
public ushort rounding;
public ushort line_thickness;
public short x;
public short y;
public ushort w;
public ushort h;
public nk_color color;
}
[StructLayout(LayoutKind.Sequential)]
public struct nk_command_rect_filled {
public nk_command header;
public ushort rounding;
public short x;
public short y;
public ushort w;
public ushort h;
public nk_color color;
}
[StructLayout(LayoutKind.Sequential)]
public struct nk_command_rect_multi_color {
public nk_command header;
public short x;
public short y;
public ushort w;
public ushort h;
public nk_color left;
public nk_color top;
public nk_color bottom;
public nk_color right;
}
[StructLayout(LayoutKind.Sequential)]
public struct nk_command_triangle {
public nk_command header;
public ushort line_thickness;
public nk_vec2i a;
public nk_vec2i b;
public nk_vec2i c;
public nk_color color;
}
[StructLayout(LayoutKind.Sequential)]
public struct nk_command_triangle_filled {
public nk_command header;
public nk_vec2i a;
public nk_vec2i b;
public nk_vec2i c;
public nk_color color;
}
[StructLayout(LayoutKind.Sequential)]
public struct nk_command_circle {
public nk_command header;
public short x;
public short y;
public ushort line_thickness;
public ushort w;
public ushort h;
public nk_color color;
}
[StructLayout(LayoutKind.Sequential)]
public struct nk_command_circle_filled {
public nk_command header;
public short x;
public short y;
public ushort w;
public ushort h;
public nk_color color;
}
[StructLayout(LayoutKind.Sequential)]
public unsafe struct nk_command_arc {
public nk_command header;
public short cx;
public short cy;
public ushort r;
public ushort line_thickness;
public fixed float a[2];
public nk_color color;
}
[StructLayout(LayoutKind.Sequential)]
public unsafe struct nk_command_arc_filled {
public nk_command header;
public short cx;
public short cy;
public ushort r;
public fixed float a[2];
public nk_color color;
}
[StructLayout(LayoutKind.Sequential)]
public unsafe struct nk_command_polygon {
public nk_command header;
public nk_color color;
public ushort line_thickness;
public ushort point_count;
public nk_vec2i firstPoint; /* (fixed?) struct nk_vec2i points[1]; /* ????? * */
}
[StructLayout(LayoutKind.Sequential)]
public unsafe struct nk_command_polygon_filled {
public nk_command header;
public nk_color color;
public ushort point_count;
public nk_vec2i firstPoint;
}
[StructLayout(LayoutKind.Sequential)]
public struct nk_command_polyline {
public nk_command header;
public nk_color color;
public ushort line_thickness;
public ushort point_count;
public nk_vec2i firstPoint;
}
[StructLayout(LayoutKind.Sequential)]
public struct nk_command_image {
public nk_command header;
public short x;
public short y;
public ushort w;
public ushort h;
public nk_image img;
public nk_color col;
}
public delegate void nk_command_custom_callback(IntPtr canvas, short x, short y, ushort w, ushort h, nk_handle callback_data);
[StructLayout(LayoutKind.Sequential)]
public struct nk_command_custom {
public nk_command header;
public short x;
public short y;
public ushort w;
public ushort h;
public nk_handle callback_data;
public nk_command_custom_callback callback;
}
[StructLayout(LayoutKind.Sequential)]
public unsafe struct nk_command_text {
public nk_command header;
public nk_user_font* font;
public nk_color background;
public nk_color foreground;
public short x;
public short y;
public ushort w;
public ushort h;
public float height;
public int length;
public byte stringFirstByte;
}
public enum nk_command_clipping {
NK_CLIPPING_OFF = nk_bool.nk_false,
NK_CLIPPING_ON = nk_bool.nk_true
}
[StructLayout(LayoutKind.Sequential)]
public unsafe struct nk_command_buffer {
public nk_buffer* baseBuf;
public nk_rect clip;
public int use_clipping;
public nk_handle userdata;
public IntPtr begin_nksize;
public IntPtr end_nksize;
public IntPtr last_nksize;
}
/* nk_draw_index -> nk_ushort */
public enum nk_draw_list_stroke {
NK_STROKE_OPEN = nk_bool.nk_false,
NK_STROKE_CLOSED = nk_bool.nk_true
}
public enum nk_draw_vertex_layout_attribute {
NK_VERTEX_POSITION,
NK_VERTEX_COLOR,
NK_VERTEX_TEXCOORD,
NK_VERTEX_ATTRIBUTE_COUNT
}
public enum nk_draw_vertex_layout_format {
NK_FORMAT_SCHAR,
NK_FORMAT_SSHORT,
NK_FORMAT_SINT,
NK_FORMAT_UCHAR,
NK_FORMAT_USHORT,
NK_FORMAT_UINT,
NK_FORMAT_FLOAT,
NK_FORMAT_DOUBLE,
NK_FORMAT_COLOR_BEGIN,
NK_FORMAT_R8G8B8 = NK_FORMAT_COLOR_BEGIN,
NK_FORMAT_R16G15B16,
NK_FORMAT_R32G32B32,
NK_FORMAT_R8G8B8A8,
NK_FORMAT_B8G8R8A8,
NK_FORMAT_R16G15B16A16,
NK_FORMAT_R32G32B32A32,
NK_FORMAT_R32G32B32A32_FLOAT,
NK_FORMAT_R32G32B32A32_DOUBLE,
NK_FORMAT_RGB32,
NK_FORMAT_RGBA32,
NK_FORMAT_COLOR_END = NK_FORMAT_RGBA32,
NK_FORMAT_COUNT
}
[StructLayout(LayoutKind.Sequential)]
public struct nk_draw_vertex_layout_element {
public nk_draw_vertex_layout_attribute attribute;
public nk_draw_vertex_layout_format format;
public IntPtr offset_nksize;
}
[StructLayout(LayoutKind.Sequential)]
public struct nk_draw_command {
public uint elem_count;
public nk_rect clip_rect;
public nk_handle texture;
public nk_handle userdata;
}
[StructLayout(LayoutKind.Sequential)]
public unsafe struct nk_draw_list {
public nk_rect clip_rect;
public fixed long circle_vtx_CastMeToVec2[12];
public nk_convert_config config;
public nk_buffer* buffer;
public nk_buffer* vertices;
public nk_buffer* elements;
public uint element_count;
public uint vertex_count;
public uint cmd_count;
public IntPtr cmd_offset_nksize;
public uint path_count;
public uint path_offset;
public nk_anti_aliasing line_AA;
public nk_anti_aliasing shape_AA;
public nk_handle userdata;
}
public static unsafe partial class NuklearNative
{
private delegate nk_command* nk__begin_t(nk_context* context);
private static nk__begin_t _nk__begin = LFT<nk__begin_t>();
public static nk_command* nk__begin(nk_context* context) => _nk__begin(context);
private delegate nk_command* nk__next_t(nk_context* context, nk_command* command);
private static nk__next_t _nk__next = LFT<nk__next_t>();
public static nk_command* nk__next(nk_context* context, nk_command* command) => _nk__next(context, command);
private delegate uint nk_convert_t(nk_context* context, nk_buffer* cmds, nk_buffer* vertices, nk_buffer* elements, nk_convert_config* ncc);
private static nk_convert_t _nk_convert = LFT<nk_convert_t>();
public static uint nk_convert(nk_context* context, nk_buffer* cmds, nk_buffer* vertices, nk_buffer* elements, nk_convert_config* ncc) => _nk_convert(context, cmds, vertices, elements, ncc);
private delegate nk_draw_command* nk__draw_begin_t(nk_context* context, nk_buffer* buf);
private static nk__draw_begin_t _nk__draw_begin = LFT<nk__draw_begin_t>();
public static nk_draw_command* nk__draw_begin(nk_context* context, nk_buffer* buf) => _nk__draw_begin(context, buf);
private delegate nk_draw_command* nk__draw_end_t(nk_context* context, nk_buffer* buf);
private static nk__draw_end_t _nk__draw_end = LFT<nk__draw_end_t>();
public static nk_draw_command* nk__draw_end(nk_context* context, nk_buffer* buf) => _nk__draw_end(context, buf);
private delegate nk_draw_command* nk__draw_next_t(nk_draw_command* drawc, nk_buffer* buf, nk_context* context);
private static nk__draw_next_t _nk__draw_next = LFT<nk__draw_next_t>();
public static nk_draw_command* nk__draw_next(nk_draw_command* drawc, nk_buffer* buf, nk_context* context) => _nk__draw_next(drawc, buf, context);
private delegate int nk_begin_t(nk_context* context, byte* title, nk_rect bounds, uint flags_nkflags);
private static nk_begin_t _nk_begin = LFT<nk_begin_t>();
public static int nk_begin(nk_context* context, byte* title, nk_rect bounds, uint flags_nkflags) => _nk_begin(context, title, bounds, flags_nkflags);
private delegate void nk_end_t(nk_context* context);
private static nk_end_t _nk_end = LFT<nk_end_t>();
public static void nk_end(nk_context* context) => _nk_end(context);
private delegate void nk_stroke_line_t(nk_command_buffer* cbuf, float x0, float y0, float x1, float y1, float line_thickness, nk_color color);
private delegate void nk_stroke_curve_t(nk_command_buffer* cbuf, float x, float y, float x1, float y1, float xa, float ya, float xb, float yb, float line_thickness, nk_color col);
private delegate void nk_stroke_rect_t(nk_command_buffer* cbuf, nk_rect r, float rounding, float line_thickness, nk_color col);
private delegate void nk_stroke_circle_t(nk_command_buffer* cbuf, nk_rect r, float line_thickness, nk_color col);
private delegate void nk_stroke_arc_t(nk_command_buffer* cbuf, float cx, float cy, float radius, float a_min, float a_max, float line_thickness, nk_color col);
private delegate void nk_stroke_triangle_t(nk_command_buffer* cbuf, float x0, float y0, float x1, float y1, float x2, float y2, float line_thickness, nk_color col);
private delegate void nk_stroke_polyline_t(nk_command_buffer* cbuf, float* points, int point_count, float line_thickness, nk_color col);
private delegate void nk_stroke_polygon_t(nk_command_buffer* cbuf, float* points, int point_count, float line_thickness, nk_color col);
private delegate void nk_fill_rect_t(nk_command_buffer* cbuf, nk_rect r, float rounding, nk_color col);
private delegate void nk_fill_rect_multi_color_t(nk_command_buffer* cbuf, nk_rect r, nk_color left, nk_color top, nk_color right, nk_color bottom);
private delegate void nk_fill_circle_t(nk_command_buffer* cbuf, nk_rect r, nk_color col);
private delegate void nk_fill_arc_t(nk_command_buffer* cbuf, float cx, float cy, float radius, float a_min, float a_max, nk_color col);
private delegate void nk_fill_triangle_t(nk_command_buffer* cbuf, float x0, float y0, float x1, float y1, float x2, float y2, nk_color col);
private delegate void nk_fill_polygon_t(nk_command_buffer* cbuf, float* pts, int point_count, nk_color col);
private delegate void nk_draw_image_t(nk_command_buffer* cbuf, nk_rect r, nk_image* img, nk_color col);
private delegate void nk_draw_text_t(nk_command_buffer* cbuf, nk_rect r, byte* text, int len, nk_user_font* userfont, nk_color col, nk_color col2);
private delegate void nk_push_scissor_t(nk_command_buffer* cbuf, nk_rect r);
private delegate void nk_push_custom_t(nk_command_buffer* cbuf, nk_rect r, nk_command_custom_callback cb, nk_handle userdata);
private static nk_stroke_line_t _nk_stroke_line = LFT<nk_stroke_line_t>();
private static nk_stroke_curve_t _nk_stroke_curve = LFT<nk_stroke_curve_t>();
private static nk_stroke_rect_t _nk_stroke_rect = LFT<nk_stroke_rect_t>();
private static nk_stroke_circle_t _nk_stroke_circle = LFT<nk_stroke_circle_t>();
private static nk_stroke_arc_t _nk_stroke_arc = LFT<nk_stroke_arc_t>();
private static nk_stroke_triangle_t _nk_stroke_triangle = LFT<nk_stroke_triangle_t>();
private static nk_stroke_polyline_t _nk_stroke_polyline = LFT<nk_stroke_polyline_t>();
private static nk_stroke_polygon_t _nk_stroke_polygon = LFT<nk_stroke_polygon_t>();
private static nk_fill_rect_t _nk_fill_rect = LFT<nk_fill_rect_t>();
private static nk_fill_rect_multi_color_t _nk_fill_rect_multi_color = LFT<nk_fill_rect_multi_color_t>();
private static nk_fill_circle_t _nk_fill_circle = LFT<nk_fill_circle_t>();
private static nk_fill_arc_t _nk_fill_arc = LFT<nk_fill_arc_t>();
private static nk_fill_triangle_t _nk_fill_triangle = LFT<nk_fill_triangle_t>();
private static nk_fill_polygon_t _nk_fill_polygon = LFT<nk_fill_polygon_t>();
private static nk_draw_image_t _nk_draw_image = LFT<nk_draw_image_t>();
private static nk_draw_text_t _nk_draw_text = LFT<nk_draw_text_t>();
private static nk_push_scissor_t _nk_push_scissor = LFT<nk_push_scissor_t>();
private static nk_push_custom_t _nk_push_custom = LFT<nk_push_custom_t>();
public static void nk_stroke_line(nk_command_buffer* cbuf, float x0, float y0, float x1, float y1, float line_thickness, nk_color color) => _nk_stroke_line(cbuf, x0, y0, x1, y1, line_thickness, color);
public static void nk_stroke_curve(nk_command_buffer* cbuf, float x, float y, float x1, float y1, float xa, float ya, float xb, float yb, float line_thickness, nk_color col) => _nk_stroke_curve(cbuf, x, y, x1, y1, xa, ya, xb, yb, line_thickness, col);
public static void nk_stroke_rect(nk_command_buffer* cbuf, nk_rect r, float rounding, float line_thickness, nk_color col) => _nk_stroke_rect(cbuf, r, rounding, line_thickness, col);
public static void nk_stroke_circle(nk_command_buffer* cbuf, nk_rect r, float line_thickness, nk_color col) => _nk_stroke_circle(cbuf, r, line_thickness, col);
public static void nk_stroke_arc(nk_command_buffer* cbuf, float cx, float cy, float radius, float a_min, float a_max, float line_thickness, nk_color col) => _nk_stroke_arc(cbuf, cx, cy, radius, a_min, a_max, line_thickness, col);
public static void nk_stroke_triangle(nk_command_buffer* cbuf, float x0, float y0, float x1, float y1, float x2, float y2, float line_thickness, nk_color col) => _nk_stroke_triangle(cbuf, x0, y0, x1, y1, x2, y2, line_thickness, col);
public static void nk_stroke_polyline(nk_command_buffer* cbuf, float* points, int point_count, float line_thickness, nk_color col) => _nk_stroke_polyline(cbuf, points, point_count, line_thickness, col);
public static void nk_stroke_polygon(nk_command_buffer* cbuf, float* points, int point_count, float line_thickness, nk_color col) => _nk_stroke_polygon(cbuf, points, point_count, line_thickness, col);
public static void nk_fill_rect(nk_command_buffer* cbuf, nk_rect r, float rounding, nk_color col) => _nk_fill_rect(cbuf, r, rounding, col);
public static void nk_fill_rect_multi_color(nk_command_buffer* cbuf, nk_rect r, nk_color left, nk_color top, nk_color right, nk_color bottom) => _nk_fill_rect_multi_color(cbuf, r, left, top, right, bottom);
public static void nk_fill_circle(nk_command_buffer* cbuf, nk_rect r, nk_color col) => _nk_fill_circle(cbuf, r, col);
public static void nk_fill_arc(nk_command_buffer* cbuf, float cx, float cy, float radius, float a_min, float a_max, nk_color col) => _nk_fill_arc(cbuf, cx, cy, radius, a_min, a_max, col);
public static void nk_fill_triangle(nk_command_buffer* cbuf, float x0, float y0, float x1, float y1, float x2, float y2, nk_color col) => _nk_fill_triangle(cbuf, x0, y0, x1, y1, x2, y2, col);
public static void nk_fill_polygon(nk_command_buffer* cbuf, float* pts, int point_count, nk_color col) => _nk_fill_polygon(cbuf, pts, point_count, col);
public static void nk_draw_image(nk_command_buffer* cbuf, nk_rect r, nk_image* img, nk_color col) => _nk_draw_image(cbuf, r, img, col);
public static void nk_draw_text(nk_command_buffer* cbuf, nk_rect r, byte* text, int len, nk_user_font* userfont, nk_color col, nk_color col2) => _nk_draw_text(cbuf, r, text, len, userfont, col, col2);
public static void nk_push_scissor(nk_command_buffer* cbuf, nk_rect r) => _nk_push_scissor(cbuf, r);
public static void nk_push_custom(nk_command_buffer* cbuf, nk_rect r, nk_command_custom_callback cb, nk_handle userdata) => _nk_push_custom(cbuf, r, cb, userdata);
private delegate void nk_draw_list_init_t(nk_draw_list* dl);
private delegate void nk_draw_list_setup_t(nk_draw_list* dl, nk_convert_config* ncc, nk_buffer* cmds, nk_buffer* vertices, nk_buffer* elements, nk_anti_aliasing line_aa, nk_anti_aliasing shape_aa);
// private delegate void nk_draw_list_clear_t(nk_draw_list* dl);
private delegate nk_draw_command* nk__draw_list_begin_t(nk_draw_list* dl, nk_buffer* buf);
private delegate nk_draw_command* nk__draw_list_next_t(nk_draw_command* drawcmd, nk_buffer* buf, nk_draw_list* dl);
private delegate nk_draw_command* nk__draw_list_end_t(nk_draw_list* dl, nk_buffer* buf);
private delegate void nk_draw_list_path_clear_t(nk_draw_list* dl);
private delegate void nk_draw_list_path_line_to_t(nk_draw_list* dl, nk_vec2 pos);
private delegate void nk_draw_list_path_arc_to_fast_t(nk_draw_list* dl, nk_vec2 center, float radius, int a_min, int a_max);
private delegate void nk_draw_list_path_arc_to_t(nk_draw_list* dl, nk_vec2 center, float radius, float a_min, float a_max, uint segments);
private delegate void nk_draw_list_path_rect_to_t(nk_draw_list* dl, nk_vec2 a, nk_vec2 b, float rounding);
private delegate void nk_draw_list_path_curve_to_t(nk_draw_list* dl, nk_vec2 p2, nk_vec2 p3, nk_vec2 p4, uint num_segments);
private delegate void nk_draw_list_path_fill_t(nk_draw_list* dl, nk_color col);
private delegate void nk_draw_list_path_stroke_t(nk_draw_list* dl, nk_color col, nk_draw_list_stroke closed, float thickness);
private delegate void nk_draw_list_stroke_line_t(nk_draw_list* dl, nk_vec2 a, nk_vec2 b, nk_color col, float thickness);
private delegate void nk_draw_list_stroke_rect_t(nk_draw_list* dl, nk_rect rect, nk_color col, float rounding, float thickness);
private delegate void nk_draw_list_stroke_triangle_t(nk_draw_list* dl, nk_vec2 a, nk_vec2 b, nk_vec2 c, nk_color col, float thickness);
private delegate void nk_draw_list_stroke_circle_t(nk_draw_list* dl, nk_vec2 center, float radius, nk_color col, uint segs, float thickness);
private delegate void nk_draw_list_stroke_curve_t(nk_draw_list* dl, nk_vec2 p0, nk_vec2 cp0, nk_vec2 cp1, nk_vec2 p1, nk_color col, uint segments, float thickness);
private delegate void nk_draw_list_stroke_poly_line_t(nk_draw_list* dl, nk_vec2* pnts, uint cnt, nk_color col, nk_draw_list_stroke stroke, float thickness, nk_anti_aliasing aa);
private delegate void nk_draw_list_fill_rect_t(nk_draw_list* dl, nk_rect rect, nk_color col, float rounding);
private delegate void nk_draw_list_fill_rect_multi_color_t(nk_draw_list* dl, nk_rect rect, nk_color left, nk_color top, nk_color right, nk_color bottom);
private delegate void nk_draw_list_fill_triangle_t(nk_draw_list* dl, nk_vec2 a, nk_vec2 b, nk_vec2 c, nk_color col);
private delegate void nk_draw_list_fill_circle_t(nk_draw_list* dl, nk_vec2 center, float radius, nk_color col, uint segs);
private delegate void nk_draw_list_fill_poly_convex_t(nk_draw_list* dl, nk_vec2* points, uint count, nk_color col, nk_anti_aliasing aa);
private delegate void nk_draw_list_add_image_t(nk_draw_list* dl, nk_image texture, nk_rect rect, nk_color col);
private delegate void nk_draw_list_add_text_t(nk_draw_list* dl, nk_user_font* userfont, nk_rect rect, byte* text, int len, float font_height, nk_color col);
private delegate void nk_draw_list_push_userdata_t(nk_draw_list* dl, nk_handle userdata);
private static nk_draw_list_init_t _nk_draw_list_init = LFT<nk_draw_list_init_t>();
private static nk_draw_list_setup_t _nk_draw_list_setup = LFT<nk_draw_list_setup_t>();
// private static nk_draw_list_clear_t _nk_draw_list_clear = LFT<nk_draw_list_clear_t>();
private static nk__draw_list_begin_t _nk__draw_list_begin = LFT<nk__draw_list_begin_t>();
private static nk__draw_list_next_t _nk__draw_list_next = LFT<nk__draw_list_next_t>();
private static nk__draw_list_end_t _nk__draw_list_end = LFT<nk__draw_list_end_t>();
private static nk_draw_list_path_clear_t _nk_draw_list_path_clear = LFT<nk_draw_list_path_clear_t>();
private static nk_draw_list_path_line_to_t _nk_draw_list_path_line_to = LFT<nk_draw_list_path_line_to_t>();
private static nk_draw_list_path_arc_to_fast_t _nk_draw_list_path_arc_to_fast = LFT<nk_draw_list_path_arc_to_fast_t>();
private static nk_draw_list_path_arc_to_t _nk_draw_list_path_arc_to = LFT<nk_draw_list_path_arc_to_t>();
private static nk_draw_list_path_rect_to_t _nk_draw_list_path_rect_to = LFT<nk_draw_list_path_rect_to_t>();
private static nk_draw_list_path_curve_to_t _nk_draw_list_path_curve_to = LFT<nk_draw_list_path_curve_to_t>();
private static nk_draw_list_path_fill_t _nk_draw_list_path_fill = LFT<nk_draw_list_path_fill_t>();
private static nk_draw_list_path_stroke_t _nk_draw_list_path_stroke = LFT<nk_draw_list_path_stroke_t>();
private static nk_draw_list_stroke_line_t _nk_draw_list_stroke_line = LFT<nk_draw_list_stroke_line_t>();
private static nk_draw_list_stroke_rect_t _nk_draw_list_stroke_rect = LFT<nk_draw_list_stroke_rect_t>();
private static nk_draw_list_stroke_triangle_t _nk_draw_list_stroke_triangle = LFT<nk_draw_list_stroke_triangle_t>();
private static nk_draw_list_stroke_circle_t _nk_draw_list_stroke_circle = LFT<nk_draw_list_stroke_circle_t>();
private static nk_draw_list_stroke_curve_t _nk_draw_list_stroke_curve = LFT<nk_draw_list_stroke_curve_t>();
private static nk_draw_list_stroke_poly_line_t _nk_draw_list_stroke_poly_line = LFT<nk_draw_list_stroke_poly_line_t>();
private static nk_draw_list_fill_rect_t _nk_draw_list_fill_rect = LFT<nk_draw_list_fill_rect_t>();
private static nk_draw_list_fill_rect_multi_color_t _nk_draw_list_fill_rect_multi_color = LFT<nk_draw_list_fill_rect_multi_color_t>();
private static nk_draw_list_fill_triangle_t _nk_draw_list_fill_triangle = LFT<nk_draw_list_fill_triangle_t>();
private static nk_draw_list_fill_circle_t _nk_draw_list_fill_circle = LFT<nk_draw_list_fill_circle_t>();
private static nk_draw_list_fill_poly_convex_t _nk_draw_list_fill_poly_convex = LFT<nk_draw_list_fill_poly_convex_t>();
private static nk_draw_list_add_image_t _nk_draw_list_add_image = LFT<nk_draw_list_add_image_t>();
private static nk_draw_list_add_text_t _nk_draw_list_add_text = LFT<nk_draw_list_add_text_t>();
private static nk_draw_list_push_userdata_t _nk_draw_list_push_userdata = LFT<nk_draw_list_push_userdata_t>();
public static void nk_draw_list_init(nk_draw_list* dl) => _nk_draw_list_init(dl);
public static void nk_draw_list_setup(nk_draw_list* dl, nk_convert_config* ncc, nk_buffer* cmds, nk_buffer* vertices, nk_buffer* elements, nk_anti_aliasing line_aa, nk_anti_aliasing shape_aa) => _nk_draw_list_setup(dl, ncc, cmds, vertices, elements, line_aa, shape_aa);
// public static void nk_draw_list_clear(nk_draw_list* dl) => _nk_draw_list_clear(dl);
public static nk_draw_command* nk__draw_list_begin(nk_draw_list* dl, nk_buffer* buf) => _nk__draw_list_begin(dl, buf);
public static nk_draw_command* nk__draw_list_next(nk_draw_command* drawcmd, nk_buffer* buf, nk_draw_list* dl) => _nk__draw_list_next(drawcmd, buf, dl);
public static nk_draw_command* nk__draw_list_end(nk_draw_list* dl, nk_buffer* buf) => _nk__draw_list_end(dl, buf);
public static void nk_draw_list_path_clear(nk_draw_list* dl) => _nk_draw_list_path_clear(dl);
public static void nk_draw_list_path_line_to(nk_draw_list* dl, nk_vec2 pos) => _nk_draw_list_path_line_to(dl, pos);
public static void nk_draw_list_path_arc_to_fast(nk_draw_list* dl, nk_vec2 center, float radius, int a_min, int a_max) => _nk_draw_list_path_arc_to_fast(dl, center, radius, a_min, a_max);
public static void nk_draw_list_path_arc_to(nk_draw_list* dl, nk_vec2 center, float radius, float a_min, float a_max, uint segments) => _nk_draw_list_path_arc_to(dl, center, radius, a_min, a_max, segments);
public static void nk_draw_list_path_rect_to(nk_draw_list* dl, nk_vec2 a, nk_vec2 b, float rounding) => _nk_draw_list_path_rect_to(dl, a, b, rounding);
public static void nk_draw_list_path_curve_to(nk_draw_list* dl, nk_vec2 p2, nk_vec2 p3, nk_vec2 p4, uint num_segments) => _nk_draw_list_path_curve_to(dl, p2, p3, p4, num_segments);
public static void nk_draw_list_path_fill(nk_draw_list* dl, nk_color col) => _nk_draw_list_path_fill(dl, col);
public static void nk_draw_list_path_stroke(nk_draw_list* dl, nk_color col, nk_draw_list_stroke closed, float thickness) => _nk_draw_list_path_stroke(dl, col, closed, thickness);
public static void nk_draw_list_stroke_line(nk_draw_list* dl, nk_vec2 a, nk_vec2 b, nk_color col, float thickness) => _nk_draw_list_stroke_line(dl, a, b, col, thickness);
public static void nk_draw_list_stroke_rect(nk_draw_list* dl, nk_rect rect, nk_color col, float rounding, float thickness) => _nk_draw_list_stroke_rect(dl, rect, col, rounding, thickness);
public static void nk_draw_list_stroke_triangle(nk_draw_list* dl, nk_vec2 a, nk_vec2 b, nk_vec2 c, nk_color col, float thickness) => _nk_draw_list_stroke_triangle(dl, a, b, c, col, thickness);
public static void nk_draw_list_stroke_circle(nk_draw_list* dl, nk_vec2 center, float radius, nk_color col, uint segs, float thickness) => _nk_draw_list_stroke_circle(dl, center, radius, col, segs, thickness);
public static void nk_draw_list_stroke_curve(nk_draw_list* dl, nk_vec2 p0, nk_vec2 cp0, nk_vec2 cp1, nk_vec2 p1, nk_color col, uint segments, float thickness) => _nk_draw_list_stroke_curve(dl, p0, cp0, cp1, p1, col, segments, thickness);
public static void nk_draw_list_stroke_poly_line(nk_draw_list* dl, nk_vec2* pnts, uint cnt, nk_color col, nk_draw_list_stroke stroke, float thickness, nk_anti_aliasing aa) => _nk_draw_list_stroke_poly_line(dl, pnts, cnt, col, stroke, thickness, aa);
public static void nk_draw_list_fill_rect(nk_draw_list* dl, nk_rect rect, nk_color col, float rounding) => _nk_draw_list_fill_rect(dl, rect, col, rounding);
public static void nk_draw_list_fill_rect_multi_color(nk_draw_list* dl, nk_rect rect, nk_color left, nk_color top, nk_color right, nk_color bottom) => _nk_draw_list_fill_rect_multi_color(dl, rect, left, top, right, bottom);
public static void nk_draw_list_fill_triangle(nk_draw_list* dl, nk_vec2 a, nk_vec2 b, nk_vec2 c, nk_color col) => _nk_draw_list_fill_triangle(dl, a, b, c, col);
public static void nk_draw_list_fill_circle(nk_draw_list* dl, nk_vec2 center, float radius, nk_color col, uint segs) => _nk_draw_list_fill_circle(dl, center, radius, col, segs);
public static void nk_draw_list_fill_poly_convex(nk_draw_list* dl, nk_vec2* points, uint count, nk_color col, nk_anti_aliasing aa) => _nk_draw_list_fill_poly_convex(dl, points, count, col, aa);
public static void nk_draw_list_add_image(nk_draw_list* dl, nk_image texture, nk_rect rect, nk_color col) => _nk_draw_list_add_image(dl, texture, rect, col);
public static void nk_draw_list_add_text(nk_draw_list* dl, nk_user_font* userfont, nk_rect rect, byte* text, int len, float font_height, nk_color col) => _nk_draw_list_add_text(dl, userfont, rect, text, len, font_height, col);
public static void nk_draw_list_push_userdata(nk_draw_list* dl, nk_handle userdata) => _nk_draw_list_push_userdata(dl, userdata);
}
}