- I have cloned gideros github to my computer: C:\gideros\my_gideros\ - I opened C:\gideros\my_gideros\plugins\imgui\source\Desktop\imgui.pro with Qt5.10.1 (with MinGW)
The errors come from this line in imgui.pro: 43 LIBS += -L"../../../../Sdk/lib/desktop" -llua -lgideros -lgid -lgvfs
and effectively this folder is empty: C:\gideros\my_gideros\Sdk\lib\desktop\
ok so I copied the missing files from gideros installation folder to my gideros folder (c:/gideros/my_gideros/Sdk/lib/desktop) and that worked I could compile imgui.dll in both debug and release mode. Now I just need to copy the dll to C:\Program Files (x86)\Gideros\Plugins and test Thank you for your help rrraptor EDIT: that seems to work
Every functions seem we should call textColored(0xff0000, 1, "some text") but instead it is used like this: ImGui:textColored(text, color)!?!? How is this possible? I don't understand!? Is there a secret file?
here is a modified imgui.dll https://github.com/mokalux/gideros_various you can paste it in your C:\Program Files (x86)\Gideros\Plugins (make a backup of the original), then call require "ImGuiX". I don't know if that works for all platforms or if I need to build those (which I don't know how to yet!) Let us know if you find other problems.
Every functions seem we should call textColored(0xff0000, 1, "some text") but instead it is used like this: ImGui:textColored(text, color)!?!? How is this possible? I don't understand!? Is there a secret file?
I thought that fmt means format (like LUA string.format), so there is "%s" followed by text argument. And from LUA side it is
oh yes that makes sense now that you wrote it int TextColored(lua_State* L) { const char* text = luaL_checkstring(L, 2); ImGui::TextColored(GColor::toVec4(luaL_checkinteger(L, 3), luaL_optnumber(L, 4, 1.0f)), "%s", text); return 0; }
It's the lua function that wins. First argument = string (the text) and then the color (hex, alpha), and it returns nothing (int = 0). Thank you mister
Fun fact. ImGui draw lists is faster than gideros particles Particles: 1 fps (but when using imgui to show fps text, it says 7 fps, and then it slows down to 1) ImGui draw list: 21-24 fps Demo code:
USE_IMUGI @true-- change this line
GW @256
GH @128
TILE @4
HTILE @&TILE/2&require"FastNoise"local perlin = Noise.new()
perlin:setNoiseType(Noise.PERLIN)
perlin:setFrequency(0.06)
perlin:setFractalOctaves(5)local ps = Particles.new()local tf = TextField.new()
tf:setPosition(10,20)local timer =0require"ImGui"local ui = ImGui.new()local IO = ui:getIO()if(not USE_IMUGI)then
stage:addChild(ps)
stage:addChild(tf)else
stage:addChild(ui)end-- actual area sizelocal REAL = Pixel.new(0xff0000, 0.2, GW,GH)
REAL:setY(11* TILE)
REAL:setScale(TILE)
stage:addChild(REAL)localfunction onEnterFrame(e)local dt = e.deltaTime
tf:setText(1//dt)
timer += dt
ps:removeParticles()for y =1, GH dofor x =1, GW dolocal v =(perlin:noise(x, y, timer*10)+1)/2-- math.random(1, 5) - 1if(v >0)thenlocal sx =(x - 1)* TILE
local sy =(y + 10)* TILE
local c = v *255
ps:addParticles{{
x = sx + HTILE,
y = sy + HTILE,
size = -TILE,
color =("0x%02x%02x%02x"):format(c,c,c)}}endendendend--localfunction onDrawGui(e)
ui:newFrame(e)
ui:value("FPS",IO:getFramerate())local list = ui:getBackgroundDrawList()for y =1, GH dofor x =1, GW dolocal v =(perlin:noise(x, y, ui:getTime()*10)+1)/2-- math.random(1, 5) - 1if(v >0)thenlocal sx =(x - 1)* TILE
local sy =(y + 10)* TILE
local c = v *255
list:addRectFilled(sx, sy, sx + TILE, sy + TILE, ("0x%02x%02x%02x"):format(c,c,c))endendend
ui:render()
ui:endFrame()endlocalfunction onAppResize()local minX, minY, maxX, maxY = application:getLogicalBounds()local W, H = maxX - minX, maxY - minY
ui:setPosition(minX, minY)
IO:setDisplaySize(W, H)end--if(USE_IMUGI)then
onAppResize()
stage:addEventListener("enterFrame", onDrawGui)else
stage:addEventListener("enterFrame", onEnterFrame)end
stage:addEventListener("applicationResize", onAppResize)
Also, it seems that gideros have limited amount of triangles that it can draw in a single frame because in this demo actual grid size must be 1024x512, but it shows a 1024x256 rectangle
Fun fact. ImGui draw lists is faster than gideros particles ... Also, it seems that gideros have limited amount of triangles that it can draw in a single frame because in this demo actual grid size must be 1024x512, but it shows a 1024x256 rectangle
Interesting. Actually the particle shader is quite convoluted, and probably not efficient for bare rectangles. That may explain the difference.
Gideros isn't limited in number of triangles it can draw in a frame, but it is limited in number of indices it can send to the GPU in a single draw call. I thought it was 64k indices, but 512k triangles would already exceed this. Interesting issue...
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
latest imgui doesn't work for me on android and html5 what could be the problem please? On both html5 and android I have got the same error message:
Uploading finished.
bad argument #3 to '?'(number expected, got string)
stack traceback:
scenes/levelX.lua:65: infunction
line 46 is: self.imgui:render() ! line 65 is: onEnterFrame() !
Not very helpful!? so I disabled all imgui buttons, text, ... one by one to see if I can catch it but no result, always the same error even with no imgui UI only imgui render
Any help would be nice please
PS: player and win export work fine
PS2: I think I found the problem, ImGui.dll was updated (built) for windows only. Now we need to build the updated ImGui for the other platforms (html5, android, ios?, ...). I am trying to set my system up see if I can build those and hopefully make awesome ImGui work on ALL platforms
If you export a project to HTML5, then replace the GApp.gidz file with that one, you should be able to test any HTML5 code modifications to your plugin.
(I'm using the test build of Gideros, so I have your latest version submitted to github)
I am hitting the same wall (see previous post) SinisterSoft I think the problem is we didn't build the new ImGui for html5, nor android, ios, ... Do you think you can build those? I am stuck with installing python and emsdk That should solve the issue?
I always build all parts of Gideros with the same source code, and it seems that the one in Gideros repository is more recent than the one managed by @rrraptor, so I guess Gideros is actually up to date. Unless some changes weren't commited.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
@rrraptor , the above issue with Android would be nice to resolve.
on the other hand finally i started to rework the gui of my app in imgui. when i had separate test project it only had the imgui menu. but now trying to put the whole thing into my app i need to stop mouse (or keyboard) event propagation whenever the mouse click/move/hover etc. is inside an imgui window, but should not stop propagation when i click etc. outside windows. how can i do this? thanks
EDIT: this mouse event capture i could resolve by using IO:wantCaptureMouse() to check if imgui 'has' the mouse.
i also don't understand how i can set the size of the visible area (outside which things are cropped), similarly the width of mainmenubar (the two questions probably have the same solution).
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
@SinisterSoft could you post a minimum sample that works on android please? I tried a couple of things but was not able to use imgui on my old android samsung S5 (maybe that's the problem ). Hope we will get imgui working on all platforms .
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
I think It's important that we get imgui html5 fixed - as pwa is also now working ( https://forum.gideros.rocks/discussion/comment/64963#Comment_64963 ), it means that possibly (in the future) an editor, recoded in Gideros using imgui, could be used to code on any platform.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Is there an example of a modal (popup window) for Gideros using imgui?
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
i'm also finally working on redoing my animation app's gui with imgui and it is going well. but then i will depend on it so it would be great to have a perfectly working imgui plugin.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
local temp=(application:getTextureMemoryUsage()/1024)if temp~=oldUsage then
oldUsage=temp
print("Texture usage: "..temp.."MB")end
When I use imgui in combination with sceneManager there appears to be a texture memory leek, in my case about 2MB each time a new imgui is created and destroyed.
Any ideas?
Update:
It looks like it's the fonts. Maybe the font texture space is not freed somehow?
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Comments
error: cannot find -llua
error: cannot find -lgideros...
collect2.exe error: error: ld returned 1 exit status
C:/Qt/Tools/mingw530_32/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -llua
C:/Qt/Tools/mingw530_32/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lgideros...
collect2.exe: error: ld returned 1 exit status
mingw32-make[1]: *** [debug\imgui.dll] Error 1
mingw32-make: *** [debug] Error 2
- I have cloned gideros github to my computer: C:\gideros\my_gideros\
- I opened C:\gideros\my_gideros\plugins\imgui\source\Desktop\imgui.pro with Qt5.10.1 (with MinGW)
The errors come from this line in imgui.pro:
43 LIBS += -L"../../../../Sdk/lib/desktop" -llua -lgideros -lgid -lgvfs
and effectively this folder is empty:
C:\gideros\my_gideros\Sdk\lib\desktop\
What am I missing? Any help please
Likes: MoKaLux
ok so I copied the missing files from gideros installation folder to my gideros folder (c:/gideros/my_gideros/Sdk/lib/desktop) and that worked I could compile imgui.dll in both debug and release mode.
Now I just need to copy the dll to C:\Program Files (x86)\Gideros\Plugins and test Thank you for your help rrraptor
EDIT: that seems to work
imgui.h IMGUI_API void TextColored(const ImVec4& col, const char* fmt, ...) IM_FMTARGS(2);
imgui.cpp ImGui::TextColored(GetStyleColorVec4(hovered_id ? ImGuiCol_Text : ImGuiCol_TextDisabled), "Click to break in debugger!");
TextColored(ImVec4(1.0f, 0.4f, 0.4f, 1.0f), "CURRENTLY APPENDING");
imgui_demo.cpp ImGui::TextColored(ImVec4(1.0f, 0.0f, 1.0f, 1.0f), "Pink");
imgui_widgets.cpp
void ImGui::TextColored(const ImVec4& col, const char* fmt, ...)
{ va_list args; va_start(args, fmt); TextColoredV(col, fmt, args); va_end(args); }
imgui_bindings.cpp
int TextColored(lua_State* L) {
const char* text = luaL_checkstring(L, 2);
ImGui::TextColored(GColor::toVec4(luaL_checkinteger(L, 3), luaL_optnumber(L, 4, 1.0f)), "%s", text);
return 0;
}
Every functions seem we should call textColored(0xff0000, 1, "some text") but instead it is used like this: ImGui:textColored(text, color)!?!?
How is this possible? I don't understand!? Is there a secret file?
here is a modified imgui.dll https://github.com/mokalux/gideros_various you can paste it in your C:\Program Files (x86)\Gideros\Plugins (make a backup of the original), then call require "ImGuiX". I don't know if that works for all platforms or if I need to build those (which I don't know how to yet!)
Let us know if you find other problems.
int TextColored(lua_State* L)
{
const char* text = luaL_checkstring(L, 2);
ImGui::TextColored(GColor::toVec4(luaL_checkinteger(L, 3), luaL_optnumber(L, 4, 1.0f)), "%s", text);
return 0;
}
It's the lua function that wins. First argument = string (the text) and then the color (hex, alpha), and it returns nothing (int = 0). Thank you mister
Particles: 1 fps (but when using imgui to show fps text, it says 7 fps, and then it slows down to 1)
ImGui draw list: 21-24 fps
Demo code:
Also, it seems that gideros have limited amount of triangles that it can draw in a single frame because in this demo actual grid size must be 1024x512, but it shows a 1024x256 rectangle
Likes: MoKaLux
Gideros isn't limited in number of triangles it can draw in a frame, but it is limited in number of indices it can send to the GPU in a single draw call. I thought it was 64k indices, but 512k triangles would already exceed this. Interesting issue...
Likes: MoKaLux
glGet with argument GL_MAX_ELEMENTS_INDICES"
https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glDrawRangeElements.xhtml
https://deluxepixel.com
On both html5 and android I have got the same error message:
line 65 is: onEnterFrame() !
Not very helpful!? so I disabled all imgui buttons, text, ... one by one to see if I can catch it but no result, always the same error even with no imgui UI only imgui render
Any help would be nice please
PS: player and win export work fine
PS2: I think I found the problem, ImGui.dll was updated (built) for windows only. Now we need to build the updated ImGui for the other platforms (html5, android, ios?, ...). I am trying to set my system up see if I can build those and hopefully make awesome ImGui work on ALL platforms
SinisterSoft I think the problem is we didn't build the new ImGui for html5, nor android, ios, ... Do you think you can build those? I am stuck with installing python and emsdk That should solve the issue?
Likes: MoKaLux
Likes: MoKaLux
https://deluxepixel.com
on the other hand finally i started to rework the gui of my app in imgui. when i had separate test project it only had the imgui menu. but now trying to put the whole thing into my app i need to stop mouse (or keyboard) event propagation whenever the mouse click/move/hover etc. is inside an imgui window, but should not stop propagation when i click etc. outside windows. how can i do this? thanks
EDIT: this mouse event capture i could resolve by using IO:wantCaptureMouse() to check if imgui 'has' the mouse.
Likes: MoKaLux
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
https://web.reportcomplete.com
https://deluxepixel.com
I tried a couple of things but was not able to use imgui on my old android samsung S5 (maybe that's the problem ). Hope we will get imgui working on all platforms .
Likes: MoKaLux
https://deluxepixel.com
Likes: keszegh
https://deluxepixel.com
Likes: keszegh, SinisterSoft
https://deluxepixel.com
Likes: keszegh, MoKaLux
https://deluxepixel.com
Likes: SinisterSoft, MoKaLux
Fragmenter - animated loop machine and IKONOMIKON - the memory game
https://deluxepixel.com
DELETEDuseless commentThe problem here seems to be with your \r\r thing:
-'\n' = Linux
-'\r\n' = Windows
-'\r' = Mac
Without those \r TextWrapped works fine
Likes: SinisterSoft
Any ideas?
Update:
It looks like it's the fonts. Maybe the font texture space is not freed somehow?
https://deluxepixel.com