Skip to content

Commit 306461c

Browse files
committed
Change draw list TYPE_DEFAULT to TYPE_WINDOW
1 parent fc74bef commit 306461c

File tree

2 files changed

+44
-43
lines changed

2 files changed

+44
-43
lines changed

imgui-binding/src/main/java/imgui/ImDrawList.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Important: Primitives are always added to the list and not culled (culling is done at higher-level by ImGui:: functions), if you use this API a lot consider coarse culling your drawn objects.
1313
*/
1414
public final class ImDrawList {
15-
public static final int TYPE_DEFAULT = 0;
15+
public static final int TYPE_WINDOW = 0;
1616
public static final int TYPE_BACKGROUND = 1;
1717
public static final int TYPE_FOREGROUND = 2;
1818

@@ -26,13 +26,13 @@ public final class ImDrawList {
2626
#include <imgui.h>
2727
#include "jni_common.h"
2828
29-
const static int DRAWLIST_TYPE_DEFAULT = 0;
29+
const static int DRAWLIST_TYPE_WINDOW = 0;
3030
const static int DRAWLIST_TYPE_BACKGROUND = 1;
3131
const static int DRAWLIST_TYPE_FOREGROUND = 2;
3232
3333
ImDrawList* getDrawList(int drawListType) {
3434
switch (drawListType) {
35-
case DRAWLIST_TYPE_DEFAULT:
35+
case DRAWLIST_TYPE_WINDOW:
3636
return ImGui::GetWindowDrawList();
3737
case DRAWLIST_TYPE_BACKGROUND:
3838
return ImGui::GetBackgroundDrawList();

imgui-binding/src/main/java/imgui/ImGui.java

Lines changed: 41 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ public final class ImGui {
1111
private static final ImDrawData DRAW_DATA = new ImDrawData(100_000, 100_000, 1000);
1212
private static final ImGuiIO IMGUI_IO = new ImGuiIO();
1313
private static final ImGuiStyle IMGUI_STYLE = new ImGuiStyle();
14-
private static final ImDrawList IM_DRAW_LIST = new ImDrawList(ImDrawList.TYPE_DEFAULT);
14+
15+
private static final ImDrawList IM_DRAW_LIST_WINDOW = new ImDrawList(ImDrawList.TYPE_WINDOW);
1516
private static final ImDrawList IM_DRAW_LIST_BACKGROUND = new ImDrawList(ImDrawList.TYPE_BACKGROUND);
1617
private static final ImDrawList IM_DRAW_LIST_FOREGROUND = new ImDrawList(ImDrawList.TYPE_FOREGROUND);
1718

@@ -32,7 +33,7 @@ private ImGui() {
3233
#include "jni_common.h"
3334
*/
3435

35-
private native static void initJniCommon(); /*
36+
private static native void initJniCommon(); /*
3637
Jni::InitCommon(env);
3738
*/
3839

@@ -43,13 +44,13 @@ private ImGui() {
4344
//
4445
// BINDING NOTICE: Getting of the current context is not implemented since it's a part of internal API which is not exposed here.
4546

46-
public native static void CreateContext(); /*
47+
public static native void CreateContext(); /*
4748
ImGui::CreateContext();
4849
*/
4950

5051
// public static void CreateContext(ImFontAtlas sharedFontAtlas) TODO create context with fonts
5152

52-
public native static void DestroyContext(); /*
53+
public static native void DestroyContext(); /*
5354
ImGui::DestroyContext();
5455
*/
5556

@@ -72,7 +73,7 @@ public static ImGuiStyle GetStyle() {
7273
/**
7374
* Start a new Dear ImGui frame, you can submit any command from this point until Render()/EndFrame().
7475
*/
75-
public native static void NewFrame(); /*
76+
public static native void NewFrame(); /*
7677
ImGui::NewFrame();
7778
*/
7879

@@ -81,15 +82,15 @@ public static ImGuiStyle GetStyle() {
8182
* If you don't need to render data (skipping rendering) you may call EndFrame() but you'll have wasted CPU already!
8283
* If you don't need to render, better to not create any imgui windows and not call NewFrame() at all!
8384
*/
84-
public native static void EndFrame(); /*
85+
public static native void EndFrame(); /*
8586
ImGui::EndFrame();
8687
*/
8788

8889
/**
8990
* Ends the Dear ImGui frame, finalize the draw data.
9091
* You can get call GetDrawData() to obtain it and run your rendering function.
9192
*/
92-
public native static void Render(); /*
93+
public static native void Render(); /*
9394
ImGui::Render();
9495
*/
9596

@@ -113,82 +114,82 @@ public static ImDrawData GetDrawData() {
113114
* Create Demo window (previously called ShowTestWindow). demonstrate most ImGui features.
114115
* Call this to learn about the library!
115116
*/
116-
public native static void ShowDemoWindow(); /*
117+
public static native void ShowDemoWindow(); /*
117118
ImGui::ShowDemoWindow();
118119
*/
119120

120121
public static void ShowDemoWindow(ImBool pOpen) {
121122
nShowDemoWindow(pOpen.data);
122123
}
123124

124-
private native static void nShowDemoWindow(boolean[] pOpen); /*
125+
private static native void nShowDemoWindow(boolean[] pOpen); /*
125126
ImGui::ShowDemoWindow(&pOpen[0]);
126127
*/
127128

128129
/**
129130
* Create About window. display Dear ImGui version, credits and build/system information.
130131
*/
131-
public native static void ShowAboutWindow(); /*
132+
public static native void ShowAboutWindow(); /*
132133
ImGui::ShowAboutWindow();
133134
*/
134135

135136
public static void ShowAboutWindow(ImBool pOpen) {
136137
nShowAboutWindow(pOpen.data);
137138
}
138139

139-
private native static void nShowAboutWindow(boolean[] pOpen); /*
140+
private static native void nShowAboutWindow(boolean[] pOpen); /*
140141
ImGui::ShowAboutWindow(&pOpen[0]);
141142
*/
142143

143144
/**
144145
* Create Metrics/Debug window.
145146
* Display Dear ImGui internals: draw commands (with individual draw calls and vertices), window list, basic internal state, etc.
146147
*/
147-
public native static void ShowMetricsWindow(); /*
148+
public static native void ShowMetricsWindow(); /*
148149
ImGui::ShowMetricsWindow();
149150
*/
150151

151152
public static void ShowMetricsWindow(ImBool pOpen) {
152153
nShowMetricsWindow(pOpen.data);
153154
}
154155

155-
private native static void nShowMetricsWindow(boolean[] pOpen); /*
156+
private static native void nShowMetricsWindow(boolean[] pOpen); /*
156157
ImGui::ShowMetricsWindow(&pOpen[0]);
157158
*/
158159

159160
/**
160161
* Add style editor block (not a window).
161162
* You can pass in a reference ImGuiStyle structure to compare to, revert to and save to (else it uses the default style)
162163
*/
163-
public native static void ShowStyleEditor(); /*
164+
public static native void ShowStyleEditor(); /*
164165
ImGui::ShowStyleEditor();
165166
*/
166167

167168
/**
168169
* Add style selector block (not a window), essentially a combo listing the default styles.
169170
*/
170-
public native static boolean ShowStyleSelector(String label); /*
171+
public static native boolean ShowStyleSelector(String label); /*
171172
return ImGui::ShowStyleSelector(label);
172173
*/
173174

174175
/**
175176
* Add font selector block (not a window), essentially a combo listing the loaded fonts.
176177
*/
177-
public native static void ShowFontSelector(String label); /*
178+
public static native void ShowFontSelector(String label); /*
178179
ImGui::ShowFontSelector(label);
179180
*/
180181

181182
/**
182183
* Add basic help/info block (not a window): how to manipulate ImGui as a end-user (mouse/keyboard controls).
183184
*/
184-
public native static void ShowUserGuide(); /*
185+
public static native void ShowUserGuide(); /*
185186
ImGui::ShowUserGuide();
186187
*/
187188

188189
/**
189190
* Get the compiled version string e.g. "1.23" (essentially the compiled value for IMGUI_VERSION)
190191
*/
191-
public native static String GetVersion(); /*
192+
public static native String GetVersion(); /*
192193
return env->NewStringUTF(ImGui::GetVersion());
193194
*/
194195

@@ -197,21 +198,21 @@ public static void ShowMetricsWindow(ImBool pOpen) {
197198
/**
198199
* New, recommended style (default)
199200
*/
200-
public native static void StyleColorsDark(); /*
201+
public static native void StyleColorsDark(); /*
201202
ImGui::StyleColorsDark();
202203
*/
203204

204205
/**
205206
* Classic imgui style
206207
*/
207-
public native static void StyleColorsClassic(); /*
208+
public static native void StyleColorsClassic(); /*
208209
ImGui::StyleColorsClassic();
209210
*/
210211

211212
/**
212213
* Best used with borders and a custom, thicker font
213214
*/
214-
public native static void StyleColorsLight(); /*
215+
public static native void StyleColorsLight(); /*
215216
ImGui::StyleColorsLight();
216217
*/
217218

@@ -227,7 +228,7 @@ public static void ShowMetricsWindow(ImBool pOpen) {
227228
// returned true. Begin and BeginChild are the only odd ones out. Will be fixed in a future update.]
228229
// - Note that the bottom of window stack always contains a window called "Debug".
229230

230-
public native static boolean Begin(String title); /*
231+
public static native boolean Begin(String title); /*
231232
return ImGui::Begin(title);
232233
*/
233234

@@ -239,11 +240,11 @@ public static boolean Begin(String title, ImBool pOpen, int imGuiWindowFlags) {
239240
return nBegin(title, pOpen.data, imGuiWindowFlags);
240241
}
241242

242-
private native static boolean nBegin(String title, boolean[] pOpen, int imGuiWindowFlags); /*
243+
private static native boolean nBegin(String title, boolean[] pOpen, int imGuiWindowFlags); /*
243244
return ImGui::Begin(title, &pOpen[0], imGuiWindowFlags);
244245
*/
245246

246-
public native static void End(); /*
247+
public static native void End(); /*
247248
ImGui::End();
248249
*/
249250

@@ -253,7 +254,7 @@ public static boolean Begin(String title, ImBool pOpen, int imGuiWindowFlags) {
253254
// - BeginChild() returns false to indicate the window is collapsed or fully clipped, so you may early out and omit submitting anything to the window.
254255
// Always call a matching EndChild() for each BeginChild() call, regardless of its return value [this is due to legacy reason and is inconsistent with most other functions such as BeginMenu/EndMenu, BeginPopup/EndPopup, etc. where the EndXXX call should only be called if the corresponding BeginXXX function returned true.]
255256

256-
public native static boolean BeginChild(String strId); /*
257+
public static native boolean BeginChild(String strId); /*
257258
return ImGui::BeginChild(strId);
258259
*/
259260

@@ -332,13 +333,13 @@ public static boolean Begin(String title, ImBool pOpen, int imGuiWindowFlags) {
332333
* Get draw list associated to the current window, to append your own drawing primitives
333334
*/
334335
public static ImDrawList GetWindowDrawList() {
335-
return IM_DRAW_LIST;
336+
return IM_DRAW_LIST_WINDOW;
336337
}
337338

338339
/**
339340
* Get current window position in screen space (useful if you want to do your own drawing via the DrawList API)
340341
*/
341-
public native static void GetWindowPos(ImVec2 dstImVec2); /*
342+
public static native void GetWindowPos(ImVec2 dstImVec2); /*
342343
Jni::ImVec2Cpy(env, ImGui::GetWindowPos(), dstImVec2);
343344
*/
344345

@@ -3033,68 +3034,68 @@ public static boolean InputScalarN(String label, int data_type, ImShort p_data,
30333034
// - Note that in C++ a 'float v[X]' function argument is the _same_ as 'float* v', the array syntax is just a way to document the number of elements that are expected to be accessible.
30343035
// - You can pass the address of a first float element out of a contiguous structure, e.g. &myvector.x
30353036

3036-
public native static boolean ColorEdit3(String label, float[] col); /*
3037+
public static native boolean ColorEdit3(String label, float[] col); /*
30373038
return ImGui::ColorEdit3(label, col);
30383039
*/
30393040

3040-
public native static boolean ColorEdit3(String label, float[] col, int imGuiColorEditFlags); /*
3041+
public static native boolean ColorEdit3(String label, float[] col, int imGuiColorEditFlags); /*
30413042
return ImGui::ColorEdit3(label, col, imGuiColorEditFlags);
30423043
*/
30433044

3044-
public native static boolean ColorEdit4(String label, float[] col); /*
3045+
public static native boolean ColorEdit4(String label, float[] col); /*
30453046
return ImGui::ColorEdit4(label, col);
30463047
*/
30473048

3048-
public native static boolean ColorEdit4(String label, float[] col, int imGuiColorEditFlags); /*
3049+
public static native boolean ColorEdit4(String label, float[] col, int imGuiColorEditFlags); /*
30493050
return ImGui::ColorEdit4(label, col, imGuiColorEditFlags);
30503051
*/
30513052

3052-
public native static boolean ColorPicker3(String label, float[] col); /*
3053+
public static native boolean ColorPicker3(String label, float[] col); /*
30533054
return ImGui::ColorPicker3(label, col);
30543055
*/
30553056

3056-
public native static boolean ColorPicker3(String label, float[] col, int imGuiColorEditFlags); /*
3057+
public static native boolean ColorPicker3(String label, float[] col, int imGuiColorEditFlags); /*
30573058
return ImGui::ColorPicker3(label, col, imGuiColorEditFlags);
30583059
*/
30593060

3060-
public native static boolean ColorPicker4(String label, float[] col); /*
3061+
public static native boolean ColorPicker4(String label, float[] col); /*
30613062
return ImGui::ColorPicker4(label, col);
30623063
*/
30633064

3064-
public native static boolean ColorPicker4(String label, float[] col, int imGuiColorEditFlags); /*
3065+
public static native boolean ColorPicker4(String label, float[] col, int imGuiColorEditFlags); /*
30653066
return ImGui::ColorPicker4(label, col, imGuiColorEditFlags);
30663067
*/
30673068

3068-
public native static boolean ColorPicker4(String label, float[] col, int imGuiColorEditFlags, float ref_col); /*
3069+
public static native boolean ColorPicker4(String label, float[] col, int imGuiColorEditFlags, float ref_col); /*
30693070
return ImGui::ColorPicker4(label, col, imGuiColorEditFlags, &ref_col);
30703071
*/
30713072

30723073
/**
30733074
* Display a colored square/button, hover for details, return true when pressed.
30743075
*/
3075-
public native static boolean ColorButton(String desc_id, float[] col); /*
3076+
public static native boolean ColorButton(String desc_id, float[] col); /*
30763077
return ImGui::ColorButton(desc_id, ImVec4(col[0], col[1], col[2], col[3]));
30773078
*/
30783079

30793080
/**
30803081
* Display a colored square/button, hover for details, return true when pressed.
30813082
*/
3082-
public native static boolean ColorButton(String desc_id, float[] col, int imGuiColorEditFlags); /*
3083+
public static native boolean ColorButton(String desc_id, float[] col, int imGuiColorEditFlags); /*
30833084
return ImGui::ColorButton(desc_id, ImVec4(col[0], col[1], col[2], col[3]), imGuiColorEditFlags);
30843085
*/
30853086

30863087
/**
30873088
* Display a colored square/button, hover for details, return true when pressed.
30883089
*/
3089-
public native static boolean ColorButton(String desc_id, float[] col, int imGuiColorEditFlags, float width, float height); /*
3090+
public static native boolean ColorButton(String desc_id, float[] col, int imGuiColorEditFlags, float width, float height); /*
30903091
return ImGui::ColorButton(desc_id, ImVec4(col[0], col[1], col[2], col[3]), imGuiColorEditFlags, ImVec2(width, height));
30913092
*/
30923093

30933094
/**
30943095
* Initialize current options (generally on application startup) if you want to select a default format,
30953096
* picker type, etc. User will be able to change many settings, unless you pass the _NoOptions flag to your calls.
30963097
*/
3097-
public native static void SetColorEditOptions(int imGuiColorEditFlags); /*
3098+
public static native void SetColorEditOptions(int imGuiColorEditFlags); /*
30983099
ImGui::SetColorEditOptions(imGuiColorEditFlags);
30993100
*/
31003101

0 commit comments

Comments
 (0)