[API] Remove lazy-created sructs and add methods to verify struct pointer

This commit is contained in:
SpaiR committed 2021-02-27 16:15:11 +02:00
1 parent c33331e13b
commit 91d636a659
8 files changed
+60 -75

No files matched your search

@@ -12,7 +12,7 @@ import imgui.type.ImInt;
* Refer to the library's Github page for examples and support
*/
public final class ImNodes {
private static ImNodesStyle style;
private static final ImNodesStyle STYLE = new ImNodesStyle(0);
private ImNodes() {
}
@@ -61,10 +61,8 @@ public final class ImNodes {
* Returns the global style struct. See the struct declaration for default values.
*/
public static ImNodesStyle getStyle() {
if (style == null) {
style = new ImNodesStyle(nGetStyle());
}
return style;
STYLE.ptr = nGetStyle();
return STYLE;
}
private static native long nGetStyle(); /*