Skip to content

Commit 3534f29

Browse files
author
patrickriordan
authored
Merge pull request #2 from idbrii/style-inl
Use .inl for included (inline) files
2 parents 1486a82 + 3c2b1c6 commit 3534f29

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ Note you must specifiy the color in hex for now
9393

9494
Generate iterator file (or use the one for 1.50 WIP already in the repo)
9595
```
96-
./generate_imgui_bindings.pl <../imgui/imgui.h >imgui_iterator.cpp
96+
./generate_imgui_bindings.pl <../imgui/imgui.h >imgui_iterator.inl
9797
```
9898

9999
This creates a file with info about imgui functions from the imgui.h file.
100100

101-
Then copy the macro definitions in imgui_lua_bindings.cpp and include imgui_iterator.cpp in that the cpp file. This will generate static int impl_FunctionName(lua_State*L) {} functions for each imgui function. Bind these to lua functions and you're good to go. (Check out imgui_lua_bindings.cpp for a full example)
101+
Then copy the macro definitions in imgui_lua_bindings.cpp and include imgui_iterator.inl in that the cpp file. This will generate static int impl_FunctionName(lua_State*L) {} functions for each imgui function. Bind these to lua functions and you're good to go. (Check out imgui_lua_bindings.cpp for a full example)
102102

103103
The imgui_lua_bindings.cpp has two functions RunString and LoadImguiBindings
104104

generate_imgui_bindings.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use diagnostics;
55
# This works for IMGUI 1.50 WIP and does not get all functions
66
#
7-
# to use ./generate_imgui_bindings.pl <imgui.h >imgui_iterator.cpp
7+
# to use ./generate_imgui_bindings.pl <imgui.h >imgui_iterator.inl
88
# and define macros properly as in example imgui_lua_bindings.cpp
99
#
1010
# check imgui_iterator for explanations of why some functions are not supported yet
File renamed without changes.

imgui_lua_bindings.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ static void ImEndStack(int type) { \
283283
#define POP_END_STACK(type)
284284
#endif
285285

286-
#include "imgui_iterator.cpp"
286+
#include "imgui_iterator.inl"
287287

288288

289289
static const struct luaL_Reg imguilib [] = {
@@ -368,7 +368,7 @@ static const struct luaL_Reg imguilib [] = {
368368
#undef POP_END_STACK
369369
#define POP_END_STACK(type)
370370

371-
#include "imgui_iterator.cpp"
371+
#include "imgui_iterator.inl"
372372
{"Button", impl_Button},
373373
{NULL, NULL}
374374
};

0 commit comments

Comments
 (0)