Replies: 54 comments
-
|
To add, I guess you do not have to add classes like GlfwRenderer in pyimgui, but it would be nice if you could wrap the supported backend, so that you can write code very similar to C++, where i in python could call the equivalent of: That also raises the question if there should perhaps be a bit more hierarchy in the lib, e.g., should I can give you access to the now private repo of my program by the way, should you find that helpful. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the detailed comments! This is the kind of feedback I appreciate. For the moment, I am busy solving a weird windows issue (see last comments in #7).
Hum, I need to ponder whether it is feasible and/or desirable. In the meantime, I added a warning in the readme, that says
Thanks, that was definitely one of the main goals, as well as to keep the header file documentation intact (can you see it?)
Hum, I think not, since users might want to do flags manipulations like: flags: ImGuiTableFlags = ImGuiTableFlags_.flag_a | ImGuiTableFlags_.flag_b
Hum, this one is not easy. For the moment, glfw is statically linked into the library.
Definitely, and I think it will be awesome. I will keep you posted once it is ready.
Hum, I had not thought of that. Would you be willing to do some tests on this on your side? void py_init_module_imgui_main(py::module& m)
{
// Add your manual bindings there, before the autogenerated code |
Beta Was this translation helpful? Give feedback.
-
|
v0.6.6 is out. Support for callbacks was added (see links in release notes) Please tell me if it works. Have a nice day! |
Beta Was this translation helpful? Give feedback.
-
|
Hi Pascal, I just looked through the diffs a bit, super cool! I really look forward to trying this out, hopefully still today. A debate: should Feedback soon! |
Beta Was this translation helpful? Give feedback.
-
|
I see the enums still have an ImGui prefix. Did you run into some issue changing that? edit removed the |
Beta Was this translation helpful? Give feedback.
-
|
However, both |
Beta Was this translation helpful? Give feedback.
-
|
Did you git submodule update —init? |
Beta Was this translation helpful? Give feedback.
-
|
Did it to be sure. It doesn't fix the pip build, still get missing include
even though `\imgui_bundle\external` is populated. But i'll wait for the
wheel.
…On Mon, Nov 21, 2022 at 1:51 PM Pascal Thomet ***@***.***> wrote:
Did you git submodule update —init?
—
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANUOGPM2Q63RH77NGQLQ7TWJNV5NANCNFSM6AAAAAASBDBRUY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
Humm.. Once again, I cannot reproduce the issue here. I messaged you by phone, tell me if you have a few minutes |
Beta Was this translation helpful? Give feedback.
-
|
I don't right now, on the way out. Will try a fresh clone first, to be sure.
…On Mon, Nov 21, 2022 at 3:58 PM Pascal Thomet ***@***.***> wrote:
Humm.. Once again, I cannot reproduce the issue here.
It does work on my windows virtual machine with msvc.
I messaged you by phone, tell me if you have a few minutes
—
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANUOGJF7KJVZ2CFAYE3JGLWJOEZFANCNFSM6AAAAAASBDBRUY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
k |
Beta Was this translation helpful? Give feedback.
-
|
hmm, with clean clone and new venv it all builds just fine. Maybe some stale cache was left after i pulled the latest version? |
Beta Was this translation helpful? Give feedback.
-
|
There is a folder named _skbuild where some compilation artifacts are stored. May be it was the culprit
|
Beta Was this translation helpful? Give feedback.
-
|
Should the all in ? Further things i ran into (some repeats):
6 in particular is a blocking error for me, so i had to stop further porting. I have just committed step 2 (and hey, got a bunch further!) in my private repo that you have access to, so have a look what i did. |
Beta Was this translation helpful? Give feedback.
-
|
In ? thats what imgui example code does |
Beta Was this translation helpful? Give feedback.
-
Same for KeysDown (should be |
Beta Was this translation helpful? Give feedback.
-
|
Another thing i ran into, might be user error. I have an image i want to draw. It is uploaded through OpenGL and i have a texture id. I then call Removing
|
Beta Was this translation helpful? Give feedback.
-
|
I think |
Beta Was this translation helpful? Give feedback.
-
|
Ok, last comment for now. Nice work man on the wrapper, i got my first windows to show even though not everything works yet. Anyway, what i run in now is that there are two versions of ´imgui.selectable´ (and i guess there are more like this one) where one takes a bool and returns a bool, and the other takes a pointer to bool and returns a tuple of two bools. Here i made it error so you can see the signatures: I want to use the latter, but get the former. Even though both are defined in the generated pybind code. I guess that is because their python function syntax is identical? Both just take a bool. Perhaps this is user error. How do i call the latter one with signature returning By the way, it would be nice to provide |
Beta Was this translation helpful? Give feedback.
-
|
Well, some more: calling it with e.g. 1000 as argument works fine. And in my port i don't get font loading to work. That is, my icons show up as question marks. I have tried adding after the calls to |
Beta Was this translation helpful? Give feedback.
-
We had a closely related discussion about this before, IIRC. The two functions are redundant for the python binding, so we have to choose one style. for pyimgui compatibility (and because i know of no other good reason) and additional flexibility (this form is more informative) i vote to only expose version 2. I'm not sure if this case can be automatically detected (that two different c++ function lead to a python function with the same arguments) and the choice automated. By the way, I'll go through all this and make separate issues of each thing, so its possible to track them. Right now its become a mess thanks to me. |
Beta Was this translation helpful? Give feedback.
-
|
I think i have now poored all this into separate issues. Hope i didn't miss anything. Thanks again for the hard work, i'm excited where this is heading! |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for taking the time to separate this into issues, this is helpful! I will answer in those |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for looking at all the requests and your offers of help. I hope to
look at them later today! Else probably friday or latest the weekend.
… Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
I get a whole bunch of compile errors right now, despite a completely clean
check out of dev. some excerpts of what `pip install .` gives me (rather
baffling):
```
FAILED:
CMakeFiles/imgui_color_text_edit.dir/external/ImGuiColorTextEdit/TextEditor.cpp.obj
C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1434~1.319\bin\Hostx86\x64\cl.exe
/nologo /TP -DIMGUI_BUNDLE_BUILD_PYTHON -DIMGUI_BUNDLE_PYTHON_API
-DIMGUI_USER_CONFIG=\"C:/Users/huml-dkn/Desktop/imgui_bundle/cmake/imgui_bundle_config.h\"
-DImTextureID=int
-IC:\Users\huml-dkn\Desktop\imgui_bundle\external\ImGuiColorTextEdit\..
-IC:\Users\huml-dkn\Desktop\imgui_bundle\cmake\..\external
-IC:\Users\huml-dkn\Desktop\imgui_bundle\external\imgui /DWIN32 /D_WINDOWS
/GR /EHsc /O2 /Ob2 /DNDEBUG -MD -std:c++17 /showIncludes
/FoCMakeFiles\imgui_color_text_edit.dir\external\ImGuiColorTextEdit\TextEditor.cpp.obj
/FdCMakeFiles\imgui_color_text_edit.dir\imgui_color_text_edit.pdb /FS -c
C:\Users\huml-dkn\Desktop\imgui_bundle\external\ImGuiColorTextEdit\TextEditor.cpp
C:\Users\huml-dkn\Desktop\imgui_bundle\external\ImGuiColorTextEdit\TextEditor.h(75):
error C3861: 'assert': identifier not found
C:\Users\huml-dkn\Desktop\imgui_bundle\external\ImGuiColorTextEdit\TextEditor.cpp(228):
error C3861: 'assert': identifier not found
```
```
FAILED: CMakeFiles/imgui_bundle.dir/src/imgui_bundle/imgui_bundle.cpp.obj
[...]
C:\Users\huml-dkn\Desktop\imgui_bundle\external\imgui\imgui.h(3067):
warning C4297: 'ImGuiViewport::~ImGuiViewport': function assumed not to
throw an exception but does
C:\Users\huml-dkn\Desktop\imgui_bundle\external\imgui\imgui.h(3067): note:
destructor or deallocator has a (possibly implicit) non-throwing exception
specification
C:\Users\huml-dkn\Desktop\imgui_bundle\src\imgui_bundle\imgui_bundle.cpp(28):
error C2440: '=': cannot convert from 'int' to 'void *'
C:\Users\huml-dkn\Desktop\imgui_bundle\src\imgui_bundle\imgui_bundle.cpp(28):
note: Conversion from integral type to pointer type requires
reinterpret_cast, C-style cast or parenthesized function-style cast
```
```
FAILED: CMakeFiles/imgui_md.dir/external/imgui_md/imgui_md/imgui_md.cpp.obj
C:\Users\huml-dkn\Desktop\imgui_bundle\external\imgui_md\imgui_md\imgui_md.cpp(699):
error C3861: 'assert': identifier not found
```
Will try again later.
…On Wed, Dec 7, 2022 at 9:01 AM Diederick C. Niehorster ***@***.***> wrote:
Thanks for looking at all the requests and your offers of help. I hope to
look at them later today! Else probably friday or latest the weekend.
> Message ID: ***@***.***>
>
|
Beta Was this translation helpful? Give feedback.
-
|
It should be solved now. I don't know why suddenly this include became necessary, but it is cleaner with it. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks, installed fine now :)
… Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
If you want to test immvision, install like this: |
Beta Was this translation helpful? Give feedback.
-
|
I will do so later, don't need it for glassesValidator but for another
(C++) project. That one will be more involved to port to hello_imgui
with all bells and whistles, but also very worth it!
Man, I am tantalizingly close now to making it all work! Mostly fixing
small things now where pyimgui deviated from the imgui api, and i have to
now change names of arguments or so. Those are great kinds of problems to
have :)
… Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
I will transfer this issue to discussions. This will be a good way for us to exchange on the subject. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This is using pip-installed v0.6.5
I decided to port a project from pyimgui to imgui_bundle as I would like to post it to pypi and I can’t do that with direct dependencies (like pyimgui version 2.0).
So, some observations from porting this program (not yet available online).
First it tried to simple replace
import imguiwithfrom pyimgui to imgui_bundle.imgui. Obviously a bunch of code adjustments are needed, mostly for the different flags (e.g.imgui.TABLE_SCROLL_X->imgui.ImGuiTableFlags_.scroll_x). These all get a bit long, even if they are very tight to the original imgui header. That said, this naming is not ideal I think and we have some freedom here since in C++ you’d simply directly useImGuiTableFlags_ScrollX.imgui.TableFlags.scroll_xwould be nice, orimgui.table_flags.scroll_xto be more pythonic and have consistent change from camel to snake case. So that’s no double imgui, and no trailing underscore.Relatedly, autocomplete works very nicely, but is a little confusing as you have each enum twice (e.g.
imgui.ImGuiTableFlagsandimgui.ImGuiTableFlags_. The former is just an int if I understand correctly. Shall we just have the latter (ideally renamed like above)?My biggest problem: how do I use imgui by itself? Or is that not the idea? I have no equivalent of
from imgui.integrations.glfw import GlfwRendererin imgui_bundle. Is the idea that you must use the hello_imgui wrapper? That makes it much less of a drop-in replacement. And I think I cannot use that, because I use glfw callbacks for my app, but can’t access those, I think? I have set up:And other interaction with glfw (such as window scaling when moving between dpi monitors).
Can I set these up? How?
Does imgui_bundle also expose its opengl binding? Can I port
import OpenGL.GL as glto something in the imgui_bundle, or is that out of scope? I’m asking as my code for instance does:Some small observations:
imgui_internal.ImGuiSelectableFlagsPrivate_.im_gui_selectable_flags_select_on_clickis a bit over the top, some conversion error?FLT_MIN(pyimgui:imgui.FLOAT_MIN) is unavailable. Is ok, can be replaced withnp.finfo('single').tiny(untested), but seems a bit heavy to require numpy for just that. That pyimgui provides imgui.FLOAT_MIN is a good solution I think. Users may well get this wrong otherwise, since a python float is a double.Beta Was this translation helpful? Give feedback.
All reactions