From 0e52586b08398001d37320ee3f28bf4dd5d4edf0 Mon Sep 17 00:00:00 2001 From: Pixeller <156404+Angluca@users.noreply.github.com> Date: Wed, 17 Jan 2024 02:49:06 +0800 Subject: [PATCH] Add 'var' to converter --- README.md | 2 +- demo/mui-sdl2ogl/main.nim | 26 ++--- demo/mui-sokol/atlas.nim | 202 +++++++++++++++++++------------------- demo/mui-sokol/main.nim | 10 +- doc/usage.md | 4 +- mui.nim | 4 +- mui.nimble | 5 +- 7 files changed, 128 insertions(+), 125 deletions(-) diff --git a/README.md b/README.md index 183ba0e..af9b465 100755 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ nimble test ```nim #if ctx.begin_window("My Window", mu.Rect(x:10, y:10, w:140, h:86))!=0: if ctx.begin_window("My Window", mu.rect(10, 10, 140, 86))!=0: - ctx.layout_row(2, [60, -1], 0) + ctx.layout_row(2, [60.cint, -1], 0) ctx.label("First:") if button(ctx, "Button1")!=0: # c call func diff --git a/demo/mui-sdl2ogl/main.nim b/demo/mui-sdl2ogl/main.nim index 6a18018..92b8fb7 100755 --- a/demo/mui-sdl2ogl/main.nim +++ b/demo/mui-sdl2ogl/main.nim @@ -24,7 +24,7 @@ proc test_window(ctx: PContext) = # window info if ctx.header("win info")!=0: win = get_current_container(ctx) - ctx.layout_row(2,[54, -1], 0) + ctx.layout_row(2,[54.cint, -1], 0) ctx.label("position:") buf = $win.rect.x & "," & $win.rect.y ctx.label(buf.cstring) @@ -34,7 +34,7 @@ proc test_window(ctx: PContext) = # lable + buttons if ctx.header_ex("test buttons", OPT_EXPANDED)!=0: - ctx.layout_row(3, [86, -110, -1], 0) + ctx.layout_row(3, [86.cint, -110, -1], 0) ctx.label("test btn1:") if ctx.button("btn1:")!=0: wlog("pres btn1") if ctx.button("btn2:")!=0: wlog("pres btn2") @@ -48,7 +48,7 @@ proc test_window(ctx: PContext) = # tree if ctx.header_ex("tree and text", OPT_EXPANDED)!=0: - ctx.layout_row(2, [140, -1], 0) + ctx.layout_row(2, [140.cint, -1], 0) ctx.layout_begin_column() if ctx.begin_treenode("test 1")!=0: if ctx.begin_treenode("test 1a")!=0: @@ -62,7 +62,7 @@ proc test_window(ctx: PContext) = ctx.end_treenode() if ctx.begin_treenode("test 2")!=0: - ctx.layout_row(2, [54, 54], 0) + ctx.layout_row(2, [54.cint, 54], 0) if ctx.button("tbtn3:")!=0: wlog("pres tbtn3") if ctx.button("tbtn4:")!=0: wlog("pres tbtn4") if ctx.button("tbtn5:")!=0: wlog("pres tbtn5") @@ -70,7 +70,7 @@ proc test_window(ctx: PContext) = ctx.end_treenode() if ctx.begin_treenode("test 3")!=0: - var chks{.global.} = [1, 0, 1] + var chks{.global.} = [1.cint, 0, 1] discard ctx.checkbox("chkbox1", chks[0].addr) discard ctx.checkbox("chkbox1", chks[1].addr) discard ctx.checkbox("chkbox1", chks[2].addr) @@ -78,16 +78,16 @@ proc test_window(ctx: PContext) = ctx.layout_end_column() ctx.layout_begin_column() - ctx.layout_row(1, [-1], 0) + ctx.layout_row(1, [-1.cint], 0) ctx.text("Lorem ipsum dolor sit amet, consectetur adipiscing \nelit. Maecenas lacinia, sem eu lacinia molestie, mi risus faucibus \nipsum, eu varius magna felis a nulla.") ctx.layout_end_column() # backgroud color sliders if ctx.header_ex("bg color", OPT_EXPANDED)!=0: - ctx.layout_row(2, [-78, -1], 74) + ctx.layout_row(2, [-78.cint, -1], 74) # sliders ctx.layout_begin_column() - ctx.layout_row(2, [46, -1], 0) + ctx.layout_row(2, [46.cint, -1], 0) ctx.label("red:"); discard ctx.slider(bg[0].addr, 0, 255) ctx.label("green:"); discard ctx.slider(bg[1].addr, 0, 255) ctx.label("blue:"); discard ctx.slider(bg[2].addr, 0, 255) @@ -103,10 +103,10 @@ proc test_window(ctx: PContext) = proc log_window(ctx: PContext) = if ctx.begin_window("log win", mu.rect(350, 40, 300, 200))!=0: # output text panel - ctx.layout_row(1, [-1], -25) + ctx.layout_row(1, [-1.cint], -25) ctx.begin_panel("log output") var panel = ctx.get_current_container() - ctx.layout_row(1, [-1], -1) + ctx.layout_row(1, [-1.cint], -1) ctx.text(logbuf.cstring) ctx.end_panel() if logbuf_updated: @@ -116,7 +116,7 @@ proc log_window(ctx: PContext) = var buf {.global.}: array[128, char] bsub = false - ctx.layout_row(2, [-70, -1], 0) + ctx.layout_row(2, [-70.cint, -1], 0) if (ctx.textbox(buf, buf.high) and RES_SUBMIT)!=0: ctx.set_focus(ctx.last_id) bsub = true @@ -140,8 +140,8 @@ proc style_window(ctx: PContext) = const colors = [ "text:", "border:", "windowbg:", "titlebg:", "titletext:", "panelbg:", "button:", "buttonhover:", "buttonfocus:", "base:", "basehover:", "basefocus:", "scrollbase:", "scrollthumb:" ] if ctx.begin_window("style editor", mu.rect(350, 250, 300, 240))!=0: var - sw = (ctx.get_current_container().body.w.float * 0.14).cint - ctx.layout_row(6, [80, sw, sw, sw, sw, -1], 0) + sw = (ctx.get_current_container().body.w.float32 * 0.14).cint + ctx.layout_row(6, [80.cint, sw, sw, sw, sw, -1], 0) for i, v in colors: ctx.label(v) uint8_slider(ctx, ctx.style.colors[i].r.addr, 0, 255) diff --git a/demo/mui-sokol/atlas.nim b/demo/mui-sokol/atlas.nim index 533d318..269566d 100755 --- a/demo/mui-sokol/atlas.nim +++ b/demo/mui-sokol/atlas.nim @@ -900,106 +900,106 @@ const atlas_texture = static: const atlas = static: var self: array[ATLAS_FONT + 128, mu.Rect] - self[ICON_CLOSE] = mu.rect(88,68,16,16) - self[ICON_CHECK] = mu.rect(0,0,18,18) - self[ICON_EXPANDED] = mu.rect(118,68,7,5) - self[ICON_COLLAPSED] = mu.rect(113,68,5,7) - self[ATLAS_WHITE] = mu.rect(125,68,3,3) - self[ATLAS_FONT+32] = mu.rect(84,68,2,17) - self[ATLAS_FONT+33] = mu.rect(39,68,3,17) - self[ATLAS_FONT+34] = mu.rect(114,51,5,17) - self[ATLAS_FONT+35] = mu.rect(34,17,7,17) - self[ATLAS_FONT+36] = mu.rect(28,34,6,17) - self[ATLAS_FONT+37] = mu.rect(58,0,9,17) - self[ATLAS_FONT+38] = mu.rect(103,0,8,17) - self[ATLAS_FONT+39] = mu.rect(86,68,2,17) - self[ATLAS_FONT+40] = mu.rect(42,68,3,17) - self[ATLAS_FONT+41] = mu.rect(45,68,3,17) - self[ATLAS_FONT+42] = mu.rect(34,34,6,17) - self[ATLAS_FONT+43] = mu.rect(40,34,6,17) - self[ATLAS_FONT+44] = mu.rect(48,68,3,17) - self[ATLAS_FONT+45] = mu.rect(51,68,3,17) - self[ATLAS_FONT+46] = mu.rect(54,68,3,17) - self[ATLAS_FONT+47] = mu.rect(124,34,4,17) - self[ATLAS_FONT+48] = mu.rect(46,34,6,17) - self[ATLAS_FONT+49] = mu.rect(52,34,6,17) - self[ATLAS_FONT+50] = mu.rect(58,34,6,17) - self[ATLAS_FONT+51] = mu.rect(64,34,6,17) - self[ATLAS_FONT+52] = mu.rect(70,34,6,17) - self[ATLAS_FONT+53] = mu.rect(76,34,6,17) - self[ATLAS_FONT+54] = mu.rect(82,34,6,17) - self[ATLAS_FONT+55] = mu.rect(88,34,6,17) - self[ATLAS_FONT+56] = mu.rect(94,34,6,17) - self[ATLAS_FONT+57] = mu.rect(100,34,6,17) - self[ATLAS_FONT+58] = mu.rect(57,68,3,17) - self[ATLAS_FONT+59] = mu.rect(60,68,3,17) - self[ATLAS_FONT+60] = mu.rect(106,34,6,17) - self[ATLAS_FONT+61] = mu.rect(112,34,6,17) - self[ATLAS_FONT+62] = mu.rect(118,34,6,17) - self[ATLAS_FONT+63] = mu.rect(119,51,5,17) - self[ATLAS_FONT+64] = mu.rect(18,0,10,17) - self[ATLAS_FONT+65] = mu.rect(41,17,7,17) - self[ATLAS_FONT+66] = mu.rect(48,17,7,17) - self[ATLAS_FONT+67] = mu.rect(55,17,7,17) - self[ATLAS_FONT+68] = mu.rect(111,0,8,17) - self[ATLAS_FONT+69] = mu.rect(0,35,6,17) - self[ATLAS_FONT+70] = mu.rect(6,35,6,17) - self[ATLAS_FONT+71] = mu.rect(119,0,8,17) - self[ATLAS_FONT+72] = mu.rect(18,17,8,17) - self[ATLAS_FONT+73] = mu.rect(63,68,3,17) - self[ATLAS_FONT+74] = mu.rect(66,68,3,17) - self[ATLAS_FONT+75] = mu.rect(62,17,7,17) - self[ATLAS_FONT+76] = mu.rect(12,51,6,17) - self[ATLAS_FONT+77] = mu.rect(28,0,10,17) - self[ATLAS_FONT+78] = mu.rect(67,0,9,17) - self[ATLAS_FONT+79] = mu.rect(76,0,9,17) - self[ATLAS_FONT+80] = mu.rect(69,17,7,17) - self[ATLAS_FONT+81] = mu.rect(85,0,9,17) - self[ATLAS_FONT+82] = mu.rect(76,17,7,17) - self[ATLAS_FONT+83] = mu.rect(18,51,6,17) - self[ATLAS_FONT+84] = mu.rect(24,51,6,17) - self[ATLAS_FONT+85] = mu.rect(26,17,8,17) - self[ATLAS_FONT+86] = mu.rect(83,17,7,17) - self[ATLAS_FONT+87] = mu.rect(38,0,10,17) - self[ATLAS_FONT+88] = mu.rect(90,17,7,17) - self[ATLAS_FONT+89] = mu.rect(30,51,6,17) - self[ATLAS_FONT+90] = mu.rect(36,51,6,17) - self[ATLAS_FONT+91] = mu.rect(69,68,3,17) - self[ATLAS_FONT+92] = mu.rect(124,51,4,17) - self[ATLAS_FONT+93] = mu.rect(72,68,3,17) - self[ATLAS_FONT+94] = mu.rect(42,51,6,17) - self[ATLAS_FONT+95] = mu.rect(15,68,4,17) - self[ATLAS_FONT+96] = mu.rect(48,51,6,17) - self[ATLAS_FONT+97] = mu.rect(54,51,6,17) - self[ATLAS_FONT+98] = mu.rect(97,17,7,17) - self[ATLAS_FONT+99] = mu.rect(0,52,5,17) - self[ATLAS_FONT+100] = mu.rect(104,17,7,17) - self[ATLAS_FONT+101] = mu.rect(60,51,6,17) - self[ATLAS_FONT+102] = mu.rect(19,68,4,17) - self[ATLAS_FONT+103] = mu.rect(66,51,6,17) - self[ATLAS_FONT+104] = mu.rect(111,17,7,17) - self[ATLAS_FONT+105] = mu.rect(75,68,3,17) - self[ATLAS_FONT+106] = mu.rect(78,68,3,17) - self[ATLAS_FONT+107] = mu.rect(72,51,6,17) - self[ATLAS_FONT+108] = mu.rect(81,68,3,17) - self[ATLAS_FONT+109] = mu.rect(48,0,10,17) - self[ATLAS_FONT+110] = mu.rect(118,17,7,17) - self[ATLAS_FONT+111] = mu.rect(0,18,7,17) - self[ATLAS_FONT+112] = mu.rect(7,18,7,17) - self[ATLAS_FONT+113] = mu.rect(14,34,7,17) - self[ATLAS_FONT+114] = mu.rect(23,68,4,17) - self[ATLAS_FONT+115] = mu.rect(5,52,5,17) - self[ATLAS_FONT+116] = mu.rect(27,68,4,17) - self[ATLAS_FONT+117] = mu.rect(21,34,7,17) - self[ATLAS_FONT+118] = mu.rect(78,51,6,17) - self[ATLAS_FONT+119] = mu.rect(94,0,9,17) - self[ATLAS_FONT+120] = mu.rect(84,51,6,17) - self[ATLAS_FONT+121] = mu.rect(90,51,6,17) - self[ATLAS_FONT+122] = mu.rect(10,68,5,17) - self[ATLAS_FONT+123] = mu.rect(31,68,4,17) - self[ATLAS_FONT+124] = mu.rect(96,51,6,17) - self[ATLAS_FONT+125] = mu.rect(35,68,4,17) - self[ATLAS_FONT+126] = mu.rect(102,51,6,17) - self[ATLAS_FONT+127] = mu.rect(108,51,6,17) + self[ICON_CLOSE] = mu.rect(88,68,16,16) + self[ICON_CHECK] = mu.rect(0,0,18,18) + self[ICON_EXPANDED] = mu.rect(118,68,7,5) + self[ICON_COLLAPSED] = mu.rect(113,68,5,7) + self[ATLAS_WHITE] = mu.rect(125,68,3,3) + self[ATLAS_FONT+32] = mu.rect(84,68,2,17) + self[ATLAS_FONT+33] = mu.rect(39,68,3,17) + self[ATLAS_FONT+34] = mu.rect(114,51,5,17) + self[ATLAS_FONT+35] = mu.rect(34,17,7,17) + self[ATLAS_FONT+36] = mu.rect(28,34,6,17) + self[ATLAS_FONT+37] = mu.rect(58,0,9,17) + self[ATLAS_FONT+38] = mu.rect(103,0,8,17) + self[ATLAS_FONT+39] = mu.rect(86,68,2,17) + self[ATLAS_FONT+40] = mu.rect(42,68,3,17) + self[ATLAS_FONT+41] = mu.rect(45,68,3,17) + self[ATLAS_FONT+42] = mu.rect(34,34,6,17) + self[ATLAS_FONT+43] = mu.rect(40,34,6,17) + self[ATLAS_FONT+44] = mu.rect(48,68,3,17) + self[ATLAS_FONT+45] = mu.rect(51,68,3,17) + self[ATLAS_FONT+46] = mu.rect(54,68,3,17) + self[ATLAS_FONT+47] = mu.rect(124,34,4,17) + self[ATLAS_FONT+48] = mu.rect(46,34,6,17) + self[ATLAS_FONT+49] = mu.rect(52,34,6,17) + self[ATLAS_FONT+50] = mu.rect(58,34,6,17) + self[ATLAS_FONT+51] = mu.rect(64,34,6,17) + self[ATLAS_FONT+52] = mu.rect(70,34,6,17) + self[ATLAS_FONT+53] = mu.rect(76,34,6,17) + self[ATLAS_FONT+54] = mu.rect(82,34,6,17) + self[ATLAS_FONT+55] = mu.rect(88,34,6,17) + self[ATLAS_FONT+56] = mu.rect(94,34,6,17) + self[ATLAS_FONT+57] = mu.rect(100,34,6,17) + self[ATLAS_FONT+58] = mu.rect(57,68,3,17) + self[ATLAS_FONT+59] = mu.rect(60,68,3,17) + self[ATLAS_FONT+60] = mu.rect(106,34,6,17) + self[ATLAS_FONT+61] = mu.rect(112,34,6,17) + self[ATLAS_FONT+62] = mu.rect(118,34,6,17) + self[ATLAS_FONT+63] = mu.rect(119,51,5,17) + self[ATLAS_FONT+64] = mu.rect(18,0,10,17) + self[ATLAS_FONT+65] = mu.rect(41,17,7,17) + self[ATLAS_FONT+66] = mu.rect(48,17,7,17) + self[ATLAS_FONT+67] = mu.rect(55,17,7,17) + self[ATLAS_FONT+68] = mu.rect(111,0,8,17) + self[ATLAS_FONT+69] = mu.rect(0,35,6,17) + self[ATLAS_FONT+70] = mu.rect(6,35,6,17) + self[ATLAS_FONT+71] = mu.rect(119,0,8,17) + self[ATLAS_FONT+72] = mu.rect(18,17,8,17) + self[ATLAS_FONT+73] = mu.rect(63,68,3,17) + self[ATLAS_FONT+74] = mu.rect(66,68,3,17) + self[ATLAS_FONT+75] = mu.rect(62,17,7,17) + self[ATLAS_FONT+76] = mu.rect(12,51,6,17) + self[ATLAS_FONT+77] = mu.rect(28,0,10,17) + self[ATLAS_FONT+78] = mu.rect(67,0,9,17) + self[ATLAS_FONT+79] = mu.rect(76,0,9,17) + self[ATLAS_FONT+80] = mu.rect(69,17,7,17) + self[ATLAS_FONT+81] = mu.rect(85,0,9,17) + self[ATLAS_FONT+82] = mu.rect(76,17,7,17) + self[ATLAS_FONT+83] = mu.rect(18,51,6,17) + self[ATLAS_FONT+84] = mu.rect(24,51,6,17) + self[ATLAS_FONT+85] = mu.rect(26,17,8,17) + self[ATLAS_FONT+86] = mu.rect(83,17,7,17) + self[ATLAS_FONT+87] = mu.rect(38,0,10,17) + self[ATLAS_FONT+88] = mu.rect(90,17,7,17) + self[ATLAS_FONT+89] = mu.rect(30,51,6,17) + self[ATLAS_FONT+90] = mu.rect(36,51,6,17) + self[ATLAS_FONT+91] = mu.rect(69,68,3,17) + self[ATLAS_FONT+92] = mu.rect(124,51,4,17) + self[ATLAS_FONT+93] = mu.rect(72,68,3,17) + self[ATLAS_FONT+94] = mu.rect(42,51,6,17) + self[ATLAS_FONT+95] = mu.rect(15,68,4,17) + self[ATLAS_FONT+96] = mu.rect(48,51,6,17) + self[ATLAS_FONT+97] = mu.rect(54,51,6,17) + self[ATLAS_FONT+98] = mu.rect(97,17,7,17) + self[ATLAS_FONT+99] = mu.rect(0,52,5,17) + self[ATLAS_FONT+100] = mu.rect(104,17,7,17) + self[ATLAS_FONT+101] = mu.rect(60,51,6,17) + self[ATLAS_FONT+102] = mu.rect(19,68,4,17) + self[ATLAS_FONT+103] = mu.rect(66,51,6,17) + self[ATLAS_FONT+104] = mu.rect(111,17,7,17) + self[ATLAS_FONT+105] = mu.rect(75,68,3,17) + self[ATLAS_FONT+106] = mu.rect(78,68,3,17) + self[ATLAS_FONT+107] = mu.rect(72,51,6,17) + self[ATLAS_FONT+108] = mu.rect(81,68,3,17) + self[ATLAS_FONT+109] = mu.rect(48,0,10,17) + self[ATLAS_FONT+110] = mu.rect(118,17,7,17) + self[ATLAS_FONT+111] = mu.rect(0,18,7,17) + self[ATLAS_FONT+112] = mu.rect(7,18,7,17) + self[ATLAS_FONT+113] = mu.rect(14,34,7,17) + self[ATLAS_FONT+114] = mu.rect(23,68,4,17) + self[ATLAS_FONT+115] = mu.rect(5,52,5,17) + self[ATLAS_FONT+116] = mu.rect(27,68,4,17) + self[ATLAS_FONT+117] = mu.rect(21,34,7,17) + self[ATLAS_FONT+118] = mu.rect(78,51,6,17) + self[ATLAS_FONT+119] = mu.rect(94,0,9,17) + self[ATLAS_FONT+120] = mu.rect(84,51,6,17) + self[ATLAS_FONT+121] = mu.rect(90,51,6,17) + self[ATLAS_FONT+122] = mu.rect(10,68,5,17) + self[ATLAS_FONT+123] = mu.rect(31,68,4,17) + self[ATLAS_FONT+124] = mu.rect(96,51,6,17) + self[ATLAS_FONT+125] = mu.rect(35,68,4,17) + self[ATLAS_FONT+126] = mu.rect(102,51,6,17) + self[ATLAS_FONT+127] = mu.rect(108,51,6,17) self {.pop.} diff --git a/demo/mui-sokol/main.nim b/demo/mui-sokol/main.nim index 30ee9bb..b49c29d 100755 --- a/demo/mui-sokol/main.nim +++ b/demo/mui-sokol/main.nim @@ -1,5 +1,6 @@ include renderer -import std/strutils +import std/strformat + var ctx_src: mu.Context ctx = ctx_src.addr # PContext @@ -113,9 +114,9 @@ proc test_window(ctx: PContext) = win = get_current_container(ctx) ctx.layout_row(2,[54.cint, -1], 0) ctx.label("Position:") - var buf = "$#, $#" % [$win.rect.x, $win.rect.y]; ctx.label(buf.cstring) + var buf = &"{win.rect.x}, {win.rect.y}"; ctx.label(buf.cstring) ctx.label("Size:") - buf = "$#, $#" % [$win.rect.w, $win.rect.h]; ctx.label(buf.cstring) + buf = &"{win.rect.w}, {win.rect.h}"; ctx.label(buf.cstring) # lable + buttons if ctx.header_ex("Test buttons", OPT_EXPANDED)!=0: @@ -182,9 +183,8 @@ proc test_window(ctx: PContext) = # color preview var r = ctx.layout_next() - var bg = bg ctx.draw_rect(r, mu.color(bg.r, bg.g, bg.b, 255)) - var buf = "$#, $#, $#" % [$bg.r, $bg.g, $bg.b] + var buf = &"#{bg.r.int:02X}{bg.g.int:02X}{bg.b.int:02X}" ctx.draw_control_text(buf.cstring, r, COLOR_TEXT, OPT_ALIGNCENTER) ctx.end_window() discard diff --git a/doc/usage.md b/doc/usage.md index 63a3719..940f029 100755 --- a/doc/usage.md +++ b/doc/usage.md @@ -118,7 +118,7 @@ of the row: ```nim #[ initialise a row of 3 items: the first item with a width ** of 90 and the remaining two with the width of 100 ]# -mu.layout_row(ctx, 3, [90, 100, 100], 0) +mu.layout_row(ctx, 3, [90.cint, 100, 100], 0) ``` When a row is filled the next row is started, for example, in the above @@ -131,7 +131,7 @@ negative value which will size the item relative to the right/bottom edge, thus if we wanted a row with a small button at the left, a textbox filling most the row and a larger button at the right, we could do the following: ```nim -mu.layout_row(ctx, 3, [30, -90, -1], 0) +mu.layout_row(ctx, 3, [30.cint, -90, -1], 0) mu.button(ctx, "X") mu.textbox(ctx, buf, buf.len) mu.button(ctx, "Submit") diff --git a/mui.nim b/mui.nim index 668c37b..70d0f77 100755 --- a/mui.nim +++ b/mui.nim @@ -348,8 +348,8 @@ proc end_panel*(ctx: ptr Context) {.cdecl, importc: "mu_end_panel", mui.} converter tomci*(n: SomeNumber|char|enum): mcint = n.cint converter tomcu*(n: SomeInteger): mcuint = n.cuint converter tomcf*(n: SomeInteger): mcfloat = n.cfloat -converter tomcstr*[I;T=byte](s: string|array[I,T]|seq[T]): mcstring = cast[mcstring](s[0].addr) -converter toAddr*[I;T](a: array[I,T]|seq[T]): ptr T = a[0].addr +converter tomcstr*[I;T=byte](s: var string|array[I,T]|seq[T]): mcstring = cast[mcstring](s[0].addr) +converter toAddr*[I;T](a: var array[I,T]|seq[T]): ptr T = a[0].addr type diff --git a/mui.nimble b/mui.nimble index 5cf506f..7e6a331 100644 --- a/mui.nimble +++ b/mui.nimble @@ -8,10 +8,13 @@ installDirs = @["src"] # Dependencies requires "nim >= 1.6.6" -requires "sokol" +#requires "sokol" #requires "sdl2" #requires "opengl" +taskRequires "test", "sokol" +taskRequires "demo", "sokol" + task demo, "Run demo": withDir "demo/": exec "nim c -d:release -r mui-sokol/main.nim"