1 // machine generated, do not edit 2 3 module sokol.debugtext; 4 import sg = sokol.gfx; 5 6 enum LogItem { 7 Ok, 8 Malloc_failed, 9 Add_commit_listener_failed, 10 Command_buffer_full, 11 Context_pool_exhausted, 12 Cannot_destroy_default_context, 13 } 14 extern(C) 15 struct Logger { 16 extern(C) void function(const(char)*, uint, uint, const(char)*, uint, const(char)*, void*) func = null; 17 void* user_data = null; 18 } 19 extern(C) 20 struct Context { 21 uint id = 0; 22 } 23 extern(C) 24 struct Range { 25 const(void)* ptr = null; 26 size_t size = 0; 27 } 28 extern(C) 29 struct FontDesc { 30 Range data; 31 ubyte first_char = 0; 32 ubyte last_char = 0; 33 } 34 extern(C) 35 struct ContextDesc { 36 int max_commands = 0; 37 int char_buf_size = 0; 38 float canvas_width = 0.0f; 39 float canvas_height = 0.0f; 40 int tab_width = 0; 41 sg.PixelFormat color_format; 42 sg.PixelFormat depth_format; 43 int sample_count = 0; 44 } 45 extern(C) 46 struct Allocator { 47 extern(C) void* function(size_t, void*) alloc_fn = null; 48 extern(C) void function(void*, void*) free_fn = null; 49 void* user_data = null; 50 } 51 extern(C) 52 struct Desc { 53 int context_pool_size = 0; 54 int printf_buf_size = 0; 55 FontDesc[8] fonts; 56 ContextDesc context; 57 Allocator allocator; 58 Logger logger; 59 } 60 extern(C) void sdtx_setup(const Desc *) @system @nogc nothrow; 61 void setup(scope ref Desc desc) @trusted @nogc nothrow { 62 sdtx_setup(&desc); 63 } 64 extern(C) void sdtx_shutdown() @system @nogc nothrow; 65 void shutdown() @trusted @nogc nothrow { 66 sdtx_shutdown(); 67 } 68 extern(C) FontDesc sdtx_font_kc853() @system @nogc nothrow; 69 FontDesc fontKc853() @trusted @nogc nothrow { 70 return sdtx_font_kc853(); 71 } 72 extern(C) FontDesc sdtx_font_kc854() @system @nogc nothrow; 73 FontDesc fontKc854() @trusted @nogc nothrow { 74 return sdtx_font_kc854(); 75 } 76 extern(C) FontDesc sdtx_font_z1013() @system @nogc nothrow; 77 FontDesc fontZ1013() @trusted @nogc nothrow { 78 return sdtx_font_z1013(); 79 } 80 extern(C) FontDesc sdtx_font_cpc() @system @nogc nothrow; 81 FontDesc fontCpc() @trusted @nogc nothrow { 82 return sdtx_font_cpc(); 83 } 84 extern(C) FontDesc sdtx_font_c64() @system @nogc nothrow; 85 FontDesc fontC64() @trusted @nogc nothrow { 86 return sdtx_font_c64(); 87 } 88 extern(C) FontDesc sdtx_font_oric() @system @nogc nothrow; 89 FontDesc fontOric() @trusted @nogc nothrow { 90 return sdtx_font_oric(); 91 } 92 extern(C) Context sdtx_make_context(const ContextDesc *) @system @nogc nothrow; 93 Context makeContext(scope ref ContextDesc desc) @trusted @nogc nothrow { 94 return sdtx_make_context(&desc); 95 } 96 extern(C) void sdtx_destroy_context(Context) @system @nogc nothrow; 97 void destroyContext(Context ctx) @trusted @nogc nothrow { 98 sdtx_destroy_context(ctx); 99 } 100 extern(C) void sdtx_set_context(Context) @system @nogc nothrow; 101 void setContext(Context ctx) @trusted @nogc nothrow { 102 sdtx_set_context(ctx); 103 } 104 extern(C) Context sdtx_get_context() @system @nogc nothrow; 105 Context getContext() @trusted @nogc nothrow { 106 return sdtx_get_context(); 107 } 108 extern(C) Context sdtx_default_context() @system @nogc nothrow; 109 Context defaultContext() @trusted @nogc nothrow { 110 return sdtx_default_context(); 111 } 112 extern(C) void sdtx_draw() @system @nogc nothrow; 113 void draw() @trusted @nogc nothrow { 114 sdtx_draw(); 115 } 116 extern(C) void sdtx_context_draw(Context) @system @nogc nothrow; 117 void contextDraw(Context ctx) @trusted @nogc nothrow { 118 sdtx_context_draw(ctx); 119 } 120 extern(C) void sdtx_draw_layer(int) @system @nogc nothrow; 121 void drawLayer(int layer_id) @trusted @nogc nothrow { 122 sdtx_draw_layer(layer_id); 123 } 124 extern(C) void sdtx_context_draw_layer(Context, int) @system @nogc nothrow; 125 void contextDrawLayer(Context ctx, int layer_id) @trusted @nogc nothrow { 126 sdtx_context_draw_layer(ctx, layer_id); 127 } 128 extern(C) void sdtx_layer(int) @system @nogc nothrow; 129 void layer(int layer_id) @trusted @nogc nothrow { 130 sdtx_layer(layer_id); 131 } 132 extern(C) void sdtx_font(uint) @system @nogc nothrow; 133 void font(uint font_index) @trusted @nogc nothrow { 134 sdtx_font(font_index); 135 } 136 extern(C) void sdtx_canvas(float, float) @system @nogc nothrow; 137 void canvas(float w, float h) @trusted @nogc nothrow { 138 sdtx_canvas(w, h); 139 } 140 extern(C) void sdtx_origin(float, float) @system @nogc nothrow; 141 void origin(float x, float y) @trusted @nogc nothrow { 142 sdtx_origin(x, y); 143 } 144 extern(C) void sdtx_home() @system @nogc nothrow; 145 void home() @trusted @nogc nothrow { 146 sdtx_home(); 147 } 148 extern(C) void sdtx_pos(float, float) @system @nogc nothrow; 149 void pos(float x, float y) @trusted @nogc nothrow { 150 sdtx_pos(x, y); 151 } 152 extern(C) void sdtx_pos_x(float) @system @nogc nothrow; 153 void posX(float x) @trusted @nogc nothrow { 154 sdtx_pos_x(x); 155 } 156 extern(C) void sdtx_pos_y(float) @system @nogc nothrow; 157 void posY(float y) @trusted @nogc nothrow { 158 sdtx_pos_y(y); 159 } 160 extern(C) void sdtx_move(float, float) @system @nogc nothrow; 161 void move(float dx, float dy) @trusted @nogc nothrow { 162 sdtx_move(dx, dy); 163 } 164 extern(C) void sdtx_move_x(float) @system @nogc nothrow; 165 void moveX(float dx) @trusted @nogc nothrow { 166 sdtx_move_x(dx); 167 } 168 extern(C) void sdtx_move_y(float) @system @nogc nothrow; 169 void moveY(float dy) @trusted @nogc nothrow { 170 sdtx_move_y(dy); 171 } 172 extern(C) void sdtx_crlf() @system @nogc nothrow; 173 void crlf() @trusted @nogc nothrow { 174 sdtx_crlf(); 175 } 176 extern(C) void sdtx_color3b(ubyte, ubyte, ubyte) @system @nogc nothrow; 177 void color3b(ubyte r, ubyte g, ubyte b) @trusted @nogc nothrow { 178 sdtx_color3b(r, g, b); 179 } 180 extern(C) void sdtx_color3f(float, float, float) @system @nogc nothrow; 181 void color3f(float r, float g, float b) @trusted @nogc nothrow { 182 sdtx_color3f(r, g, b); 183 } 184 extern(C) void sdtx_color4b(ubyte, ubyte, ubyte, ubyte) @system @nogc nothrow; 185 void color4b(ubyte r, ubyte g, ubyte b, ubyte a) @trusted @nogc nothrow { 186 sdtx_color4b(r, g, b, a); 187 } 188 extern(C) void sdtx_color4f(float, float, float, float) @system @nogc nothrow; 189 void color4f(float r, float g, float b, float a) @trusted @nogc nothrow { 190 sdtx_color4f(r, g, b, a); 191 } 192 extern(C) void sdtx_color1i(uint) @system @nogc nothrow; 193 void color1i(uint rgba) @trusted @nogc nothrow { 194 sdtx_color1i(rgba); 195 } 196 extern(C) void sdtx_putc(char) @system @nogc nothrow; 197 void putc(char c) @trusted @nogc nothrow { 198 sdtx_putc(c); 199 } 200 extern(C) void sdtx_puts(const(char)*) @system @nogc nothrow; 201 void puts(scope const(char)* str) @trusted @nogc nothrow { 202 sdtx_puts(str); 203 } 204 extern(C) void sdtx_putr(const(char)*, int) @system @nogc nothrow; 205 void putr(scope const(char)* str, int len) @trusted @nogc nothrow { 206 sdtx_putr(str, len); 207 }