Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't make it use ImWchar32 #232

Closed
gucio321 opened this issue Apr 4, 2023 · 11 comments · Fixed by #233
Closed

can't make it use ImWchar32 #232

gucio321 opened this issue Apr 4, 2023 · 11 comments · Fixed by #233

Comments

@gucio321
Copy link
Contributor

gucio321 commented Apr 4, 2023

Hi
I generated binding with ./generate.sh -DIMGUI_USE_WHCAR32 (like readme says)
but it still seems to use ImWchar16...

typedef ImWchar16 ImWchar;

what am I doing wrong? Or probably I missunderstood how USE_IMGUI_WHCAR32 works?

@sonoro1234
Copy link
Contributor

You must edit generator.sh to add -DIMGUI_USE_WCHAR32

@gucio321
Copy link
Contributor Author

gucio321 commented Apr 5, 2023

hmm, I see. Maybe there is a way to include command-line arguments in this script by default?

@gucio321
Copy link
Contributor Author

gucio321 commented Apr 5, 2023

maybe a quick edit like this?

diff --git a/generator/generator.sh b/generator/generator.sh
index 92d7ae4..e2840c5 100755
--- a/generator/generator.sh
+++ b/generator/generator.sh
@@ -22,4 +22,4 @@ then
   suffix='.exe'
 fi
 
-luajit$suffix ./generator.lua gcc "internal noimstrv" glfw opengl3 opengl2 sdl2
+luajit$suffix ./generator.lua gcc "internal noimstrv" glfw opengl3 opengl2 sdl2 "$@"

EDIT I've created PR #233

@sonoro1234
Copy link
Contributor

maybe a quick edit like this?

I prefer not because it would only be useful for CFLAGS but not other options that must be edited in generator.sh

@gucio321
Copy link
Contributor Author

gucio321 commented Apr 5, 2023

hmm, I see what... maybe introduce some flags-parser logic in generator.sh?
e.g. ./generator.sh --cflags="-DIMGUI_USE_WCHAR32"?
The point is that using generator in some automatic jobs becomes a bit difficult as long as I need to edit it...

@sonoro1234
Copy link
Contributor

sonoro1234 commented Apr 5, 2023

the best would be for you to have your own generator.bat (sh) outside cimgui repo edited as:

cd cimgui/generator
luajit ./generator.lua gcc "internal noimstrv" glfw opengl3 opengl2 sdl2 -DIMGUI_USE_WCHAR32

That way you are able to update cimgui but keeping your generator options

@gucio321
Copy link
Contributor Author

gucio321 commented Apr 5, 2023

the best would be for you to have your own generator.bat (sh) outside cimgui repo edited as:

cd cimgui/generator
luajit ./generator.lua gcc "internal noimstrv" glfw opengl3 opengl2 sdl2 -DIMGUI_USE_WCHAR32

That way you are able to update cimgui but keeping your generator options

I've considered it, however, note that the current generator.sh already contains more stuff than just luajit call...
I'd rather raly on upstream as long as possible. Let me know what do you think about the solution mentioned above and I can edit my PR.

@sonoro1234
Copy link
Contributor

I'd rather raly on upstream as long as possible.

Yes, but upstream cimgui has some predefined options hardcoded in generator.bat. The only way to have your own options is having your own generator.sh outside cimgui changing this line:

cd cimgui/generator
luajit$suffix ./generator.lua gcc "internal noimstrv" glfw opengl3 opengl2 sdl2 -DIMGUI_USE_WCHAR3

@gucio321
Copy link
Contributor Author

gucio321 commented Apr 5, 2023

I see, I'm just wondering why not add --cflags script flag to generator.sh? Currently hard-coded options may be left as are, or even better could be stored as defaults in some overwritable flag.
And I'll be able to do ./generator.sh --cflags="-DIMGUI_USE_WCHAR32"

@sonoro1234
Copy link
Contributor

Perhaps update your PR so that I can understand how would it be?

@gucio321
Copy link
Contributor Author

gucio321 commented Apr 5, 2023

@sonoro1234 take a look now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants