@@ -11,7 +11,8 @@ public final class ImGui {
11
11
private static final ImDrawData DRAW_DATA = new ImDrawData (100_000 , 100_000 , 1000 );
12
12
private static final ImGuiIO IMGUI_IO = new ImGuiIO ();
13
13
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 );
15
16
private static final ImDrawList IM_DRAW_LIST_BACKGROUND = new ImDrawList (ImDrawList .TYPE_BACKGROUND );
16
17
private static final ImDrawList IM_DRAW_LIST_FOREGROUND = new ImDrawList (ImDrawList .TYPE_FOREGROUND );
17
18
@@ -32,7 +33,7 @@ private ImGui() {
32
33
#include "jni_common.h"
33
34
*/
34
35
35
- private native static void initJniCommon (); /*
36
+ private static native void initJniCommon (); /*
36
37
Jni::InitCommon(env);
37
38
*/
38
39
@@ -43,13 +44,13 @@ private ImGui() {
43
44
//
44
45
// BINDING NOTICE: Getting of the current context is not implemented since it's a part of internal API which is not exposed here.
45
46
46
- public native static void CreateContext (); /*
47
+ public static native void CreateContext (); /*
47
48
ImGui::CreateContext();
48
49
*/
49
50
50
51
// public static void CreateContext(ImFontAtlas sharedFontAtlas) TODO create context with fonts
51
52
52
- public native static void DestroyContext (); /*
53
+ public static native void DestroyContext (); /*
53
54
ImGui::DestroyContext();
54
55
*/
55
56
@@ -72,7 +73,7 @@ public static ImGuiStyle GetStyle() {
72
73
/**
73
74
* Start a new Dear ImGui frame, you can submit any command from this point until Render()/EndFrame().
74
75
*/
75
- public native static void NewFrame (); /*
76
+ public static native void NewFrame (); /*
76
77
ImGui::NewFrame();
77
78
*/
78
79
@@ -81,15 +82,15 @@ public static ImGuiStyle GetStyle() {
81
82
* If you don't need to render data (skipping rendering) you may call EndFrame() but you'll have wasted CPU already!
82
83
* If you don't need to render, better to not create any imgui windows and not call NewFrame() at all!
83
84
*/
84
- public native static void EndFrame (); /*
85
+ public static native void EndFrame (); /*
85
86
ImGui::EndFrame();
86
87
*/
87
88
88
89
/**
89
90
* Ends the Dear ImGui frame, finalize the draw data.
90
91
* You can get call GetDrawData() to obtain it and run your rendering function.
91
92
*/
92
- public native static void Render (); /*
93
+ public static native void Render (); /*
93
94
ImGui::Render();
94
95
*/
95
96
@@ -113,82 +114,82 @@ public static ImDrawData GetDrawData() {
113
114
* Create Demo window (previously called ShowTestWindow). demonstrate most ImGui features.
114
115
* Call this to learn about the library!
115
116
*/
116
- public native static void ShowDemoWindow (); /*
117
+ public static native void ShowDemoWindow (); /*
117
118
ImGui::ShowDemoWindow();
118
119
*/
119
120
120
121
public static void ShowDemoWindow (ImBool pOpen ) {
121
122
nShowDemoWindow (pOpen .data );
122
123
}
123
124
124
- private native static void nShowDemoWindow (boolean [] pOpen ); /*
125
+ private static native void nShowDemoWindow (boolean [] pOpen ); /*
125
126
ImGui::ShowDemoWindow(&pOpen[0]);
126
127
*/
127
128
128
129
/**
129
130
* Create About window. display Dear ImGui version, credits and build/system information.
130
131
*/
131
- public native static void ShowAboutWindow (); /*
132
+ public static native void ShowAboutWindow (); /*
132
133
ImGui::ShowAboutWindow();
133
134
*/
134
135
135
136
public static void ShowAboutWindow (ImBool pOpen ) {
136
137
nShowAboutWindow (pOpen .data );
137
138
}
138
139
139
- private native static void nShowAboutWindow (boolean [] pOpen ); /*
140
+ private static native void nShowAboutWindow (boolean [] pOpen ); /*
140
141
ImGui::ShowAboutWindow(&pOpen[0]);
141
142
*/
142
143
143
144
/**
144
145
* Create Metrics/Debug window.
145
146
* Display Dear ImGui internals: draw commands (with individual draw calls and vertices), window list, basic internal state, etc.
146
147
*/
147
- public native static void ShowMetricsWindow (); /*
148
+ public static native void ShowMetricsWindow (); /*
148
149
ImGui::ShowMetricsWindow();
149
150
*/
150
151
151
152
public static void ShowMetricsWindow (ImBool pOpen ) {
152
153
nShowMetricsWindow (pOpen .data );
153
154
}
154
155
155
- private native static void nShowMetricsWindow (boolean [] pOpen ); /*
156
+ private static native void nShowMetricsWindow (boolean [] pOpen ); /*
156
157
ImGui::ShowMetricsWindow(&pOpen[0]);
157
158
*/
158
159
159
160
/**
160
161
* Add style editor block (not a window).
161
162
* You can pass in a reference ImGuiStyle structure to compare to, revert to and save to (else it uses the default style)
162
163
*/
163
- public native static void ShowStyleEditor (); /*
164
+ public static native void ShowStyleEditor (); /*
164
165
ImGui::ShowStyleEditor();
165
166
*/
166
167
167
168
/**
168
169
* Add style selector block (not a window), essentially a combo listing the default styles.
169
170
*/
170
- public native static boolean ShowStyleSelector (String label ); /*
171
+ public static native boolean ShowStyleSelector (String label ); /*
171
172
return ImGui::ShowStyleSelector(label);
172
173
*/
173
174
174
175
/**
175
176
* Add font selector block (not a window), essentially a combo listing the loaded fonts.
176
177
*/
177
- public native static void ShowFontSelector (String label ); /*
178
+ public static native void ShowFontSelector (String label ); /*
178
179
ImGui::ShowFontSelector(label);
179
180
*/
180
181
181
182
/**
182
183
* Add basic help/info block (not a window): how to manipulate ImGui as a end-user (mouse/keyboard controls).
183
184
*/
184
- public native static void ShowUserGuide (); /*
185
+ public static native void ShowUserGuide (); /*
185
186
ImGui::ShowUserGuide();
186
187
*/
187
188
188
189
/**
189
190
* Get the compiled version string e.g. "1.23" (essentially the compiled value for IMGUI_VERSION)
190
191
*/
191
- public native static String GetVersion (); /*
192
+ public static native String GetVersion (); /*
192
193
return env->NewStringUTF(ImGui::GetVersion());
193
194
*/
194
195
@@ -197,21 +198,21 @@ public static void ShowMetricsWindow(ImBool pOpen) {
197
198
/**
198
199
* New, recommended style (default)
199
200
*/
200
- public native static void StyleColorsDark (); /*
201
+ public static native void StyleColorsDark (); /*
201
202
ImGui::StyleColorsDark();
202
203
*/
203
204
204
205
/**
205
206
* Classic imgui style
206
207
*/
207
- public native static void StyleColorsClassic (); /*
208
+ public static native void StyleColorsClassic (); /*
208
209
ImGui::StyleColorsClassic();
209
210
*/
210
211
211
212
/**
212
213
* Best used with borders and a custom, thicker font
213
214
*/
214
- public native static void StyleColorsLight (); /*
215
+ public static native void StyleColorsLight (); /*
215
216
ImGui::StyleColorsLight();
216
217
*/
217
218
@@ -227,7 +228,7 @@ public static void ShowMetricsWindow(ImBool pOpen) {
227
228
// returned true. Begin and BeginChild are the only odd ones out. Will be fixed in a future update.]
228
229
// - Note that the bottom of window stack always contains a window called "Debug".
229
230
230
- public native static boolean Begin (String title ); /*
231
+ public static native boolean Begin (String title ); /*
231
232
return ImGui::Begin(title);
232
233
*/
233
234
@@ -239,11 +240,11 @@ public static boolean Begin(String title, ImBool pOpen, int imGuiWindowFlags) {
239
240
return nBegin (title , pOpen .data , imGuiWindowFlags );
240
241
}
241
242
242
- private native static boolean nBegin (String title , boolean [] pOpen , int imGuiWindowFlags ); /*
243
+ private static native boolean nBegin (String title , boolean [] pOpen , int imGuiWindowFlags ); /*
243
244
return ImGui::Begin(title, &pOpen[0], imGuiWindowFlags);
244
245
*/
245
246
246
- public native static void End (); /*
247
+ public static native void End (); /*
247
248
ImGui::End();
248
249
*/
249
250
@@ -253,7 +254,7 @@ public static boolean Begin(String title, ImBool pOpen, int imGuiWindowFlags) {
253
254
// - BeginChild() returns false to indicate the window is collapsed or fully clipped, so you may early out and omit submitting anything to the window.
254
255
// 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.]
255
256
256
- public native static boolean BeginChild (String strId ); /*
257
+ public static native boolean BeginChild (String strId ); /*
257
258
return ImGui::BeginChild(strId);
258
259
*/
259
260
@@ -332,13 +333,13 @@ public static boolean Begin(String title, ImBool pOpen, int imGuiWindowFlags) {
332
333
* Get draw list associated to the current window, to append your own drawing primitives
333
334
*/
334
335
public static ImDrawList GetWindowDrawList () {
335
- return IM_DRAW_LIST ;
336
+ return IM_DRAW_LIST_WINDOW ;
336
337
}
337
338
338
339
/**
339
340
* Get current window position in screen space (useful if you want to do your own drawing via the DrawList API)
340
341
*/
341
- public native static void GetWindowPos (ImVec2 dstImVec2 ); /*
342
+ public static native void GetWindowPos (ImVec2 dstImVec2 ); /*
342
343
Jni::ImVec2Cpy(env, ImGui::GetWindowPos(), dstImVec2);
343
344
*/
344
345
@@ -3033,68 +3034,68 @@ public static boolean InputScalarN(String label, int data_type, ImShort p_data,
3033
3034
// - 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.
3034
3035
// - You can pass the address of a first float element out of a contiguous structure, e.g. &myvector.x
3035
3036
3036
- public native static boolean ColorEdit3 (String label , float [] col ); /*
3037
+ public static native boolean ColorEdit3 (String label , float [] col ); /*
3037
3038
return ImGui::ColorEdit3(label, col);
3038
3039
*/
3039
3040
3040
- public native static boolean ColorEdit3 (String label , float [] col , int imGuiColorEditFlags ); /*
3041
+ public static native boolean ColorEdit3 (String label , float [] col , int imGuiColorEditFlags ); /*
3041
3042
return ImGui::ColorEdit3(label, col, imGuiColorEditFlags);
3042
3043
*/
3043
3044
3044
- public native static boolean ColorEdit4 (String label , float [] col ); /*
3045
+ public static native boolean ColorEdit4 (String label , float [] col ); /*
3045
3046
return ImGui::ColorEdit4(label, col);
3046
3047
*/
3047
3048
3048
- public native static boolean ColorEdit4 (String label , float [] col , int imGuiColorEditFlags ); /*
3049
+ public static native boolean ColorEdit4 (String label , float [] col , int imGuiColorEditFlags ); /*
3049
3050
return ImGui::ColorEdit4(label, col, imGuiColorEditFlags);
3050
3051
*/
3051
3052
3052
- public native static boolean ColorPicker3 (String label , float [] col ); /*
3053
+ public static native boolean ColorPicker3 (String label , float [] col ); /*
3053
3054
return ImGui::ColorPicker3(label, col);
3054
3055
*/
3055
3056
3056
- public native static boolean ColorPicker3 (String label , float [] col , int imGuiColorEditFlags ); /*
3057
+ public static native boolean ColorPicker3 (String label , float [] col , int imGuiColorEditFlags ); /*
3057
3058
return ImGui::ColorPicker3(label, col, imGuiColorEditFlags);
3058
3059
*/
3059
3060
3060
- public native static boolean ColorPicker4 (String label , float [] col ); /*
3061
+ public static native boolean ColorPicker4 (String label , float [] col ); /*
3061
3062
return ImGui::ColorPicker4(label, col);
3062
3063
*/
3063
3064
3064
- public native static boolean ColorPicker4 (String label , float [] col , int imGuiColorEditFlags ); /*
3065
+ public static native boolean ColorPicker4 (String label , float [] col , int imGuiColorEditFlags ); /*
3065
3066
return ImGui::ColorPicker4(label, col, imGuiColorEditFlags);
3066
3067
*/
3067
3068
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 ); /*
3069
3070
return ImGui::ColorPicker4(label, col, imGuiColorEditFlags, &ref_col);
3070
3071
*/
3071
3072
3072
3073
/**
3073
3074
* Display a colored square/button, hover for details, return true when pressed.
3074
3075
*/
3075
- public native static boolean ColorButton (String desc_id , float [] col ); /*
3076
+ public static native boolean ColorButton (String desc_id , float [] col ); /*
3076
3077
return ImGui::ColorButton(desc_id, ImVec4(col[0], col[1], col[2], col[3]));
3077
3078
*/
3078
3079
3079
3080
/**
3080
3081
* Display a colored square/button, hover for details, return true when pressed.
3081
3082
*/
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 ); /*
3083
3084
return ImGui::ColorButton(desc_id, ImVec4(col[0], col[1], col[2], col[3]), imGuiColorEditFlags);
3084
3085
*/
3085
3086
3086
3087
/**
3087
3088
* Display a colored square/button, hover for details, return true when pressed.
3088
3089
*/
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 ); /*
3090
3091
return ImGui::ColorButton(desc_id, ImVec4(col[0], col[1], col[2], col[3]), imGuiColorEditFlags, ImVec2(width, height));
3091
3092
*/
3092
3093
3093
3094
/**
3094
3095
* Initialize current options (generally on application startup) if you want to select a default format,
3095
3096
* picker type, etc. User will be able to change many settings, unless you pass the _NoOptions flag to your calls.
3096
3097
*/
3097
- public native static void SetColorEditOptions (int imGuiColorEditFlags ); /*
3098
+ public static native void SetColorEditOptions (int imGuiColorEditFlags ); /*
3098
3099
ImGui::SetColorEditOptions(imGuiColorEditFlags);
3099
3100
*/
3100
3101
0 commit comments