Skip to content

Commit 212fb89

Browse files
committed
Added support for PushTextureID
1 parent 2b48d01 commit 212fb89

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ This repo only deals with binding ImGui with lua and doesn't deal with setting u
88

99
For LOVE bindings check out https://github.com/slages/love-imgui (uses these C++ bindings and does the rest of the work for you).
1010

11-
Supported functions: 222 Unsupported functions: 77 for 1.50 (WIP)
11+
Function support for dear imgui 1.50 (WIP):
12+
Normal Imgui functions: Supported: 222 Unsupported: 77
13+
Imgui DrawList functions: Supported: 34 Unsupported: 10
1214

1315
##How to call these imgui bindings from lua##
1416

generate_imgui_bindings.pl

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,11 @@ sub generateNamespaceImgui {
196196
push(@before, "UINT_ARG($name)");
197197
}
198198
push(@funcArgs, $name);
199-
#ImTextureID
200-
} elsif ($args[$i] =~ m/^ *ImTextureID ([^ =\[]*) *$/) {
201-
my $name = $1;
199+
#ImTextureID or const ImTextureID&
200+
# const ImTextureID& is the same thing as var
201+
# as lua is concerned
202+
} elsif ($args[$i] =~ m/^ *(ImTextureID|const ImTextureID&) ([^ =\[]*) *$/) {
203+
my $name = $2;
202204
push(@before, "IM_TEXTURE_ID_ARG($name)");
203205
push(@funcArgs, $name);
204206
# bool with default value or not
@@ -491,9 +493,11 @@ sub generateDrawListFunctions {
491493
push(@before, "UINT_ARG($name)");
492494
}
493495
push(@funcArgs, $name);
494-
#ImTextureID
495-
} elsif ($args[$i] =~ m/^ *ImTextureID ([^ =\[]*) *$/) {
496-
my $name = $1;
496+
#ImTextureID or const ImTextureID&
497+
# const ImTextureID& is the same thing as var
498+
# as lua is concerned
499+
} elsif ($args[$i] =~ m/^ *(ImTextureID|const ImTextureID&) ([^ =\[]*) *$/) {
500+
my $name = $2;
497501
push(@before, "IM_TEXTURE_ID_ARG($name)");
498502
push(@funcArgs, $name);
499503
# bool with default value or not

imgui_iterator.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1662,7 +1662,10 @@ IMGUI_FUNCTION_DRAW_LIST(PopClipRect)
16621662
DRAW_LIST_CALL_FUNCTION_NO_RET(PopClipRect)
16631663
END_IMGUI_FUNC
16641664
// IMGUI_API void PushTextureID(const ImTextureID& texture_id);
1665-
// Unsupported arg type const ImTextureID& texture_id
1665+
IMGUI_FUNCTION_DRAW_LIST(PushTextureID)
1666+
IM_TEXTURE_ID_ARG(texture_id)
1667+
DRAW_LIST_CALL_FUNCTION_NO_RET(PushTextureID, texture_id)
1668+
END_IMGUI_FUNC
16661669
// IMGUI_API void PopTextureID();
16671670
IMGUI_FUNCTION_DRAW_LIST(PopTextureID)
16681671
DRAW_LIST_CALL_FUNCTION_NO_RET(PopTextureID)

0 commit comments

Comments
 (0)