3 ms·
I first got introduced to the concept by his talk, and this implementation here - http://sol.gfxile.net/imgui/ch01.html http://sol.gfxile.net/imgui/ch01.html (l
by malkia 6y ago
I first got introduced to the concept by his talk, and this implementation here - http://sol.gfxile.net/imgui/ch01.html http://sol.gfxile.net/imgui/ch01.html (latest archive I could find - https://web.archive.org/web/20200428143845/http://sol.gfxile.net/imgui/ch01.html https://web.archive.org/web/20200428143845/http://sol.gfxile...)
I've did some translations of the above C/C++ code to lua longtime here (actually luajit, as it requires the FFI) - https://github.com/malkia/ufo/blob/master/samples/SDL/imgui/ch01.lua https://github.com/malkia/ufo/blob/master/samples/SDL/imgui/... (simplest example) through https://github.com/malkia/ufo/blob/master/samples/SDL/imgui/ch07.lua https://github.com/malkia/ufo/blob/master/samples/SDL/imgui/... though my hack for C/C++'s __LINE__ macro was
local function GEN_ID()
return CURRENT_LINE()
end
e.g. you basically tie the state to the... ahem.. source code line (you need really something unique). Obviously Dear ImGUI has better approaches there (use the widget's contents, like text/label contents, or add your own with ##).