From f05ff1e57190dc3f3354f67e4ac2028268edcb25 Mon Sep 17 00:00:00 2001 From: SpaiR Date: Tue, 11 Feb 2020 01:10:08 +0300 Subject: [PATCH] Fix windows64 compilation --- imgui-binding/src/main/java/imgui/ImFont.java | 5 ++- .../src/main/java/imgui/ImFontAtlas.java | 42 +++++++++---------- .../src/main/java/imgui/ImFontConfig.java | 3 +- .../src/main/java/imgui/ImFontGlyph.java | 3 +- imgui-binding/src/main/java/imgui/ImGui.java | 2 +- .../src/main/java/imgui/ImGuiIO.java | 3 +- 6 files changed, 31 insertions(+), 27 deletions(-) diff --git a/imgui-binding/src/main/java/imgui/ImFont.java b/imgui-binding/src/main/java/imgui/ImFont.java index 31be5ac..c7ddc03 100644 --- a/imgui-binding/src/main/java/imgui/ImFont.java +++ b/imgui-binding/src/main/java/imgui/ImFont.java @@ -28,6 +28,7 @@ public final class ImFont implements ImDestroyable { } /*JNI + #include #include #include "jni_common.h" @@ -43,7 +44,7 @@ public final class ImFont implements ImDestroyable { private native long nCreate(); /* ImFont* imFont = new ImFont(); - return (long)imFont; + return (long)(intptr_t)imFont; */ private native void nDestroy(long ptr); /* @@ -86,7 +87,7 @@ public final class ImFont implements ImDestroyable { } private native long nGetFallbackGlyphPtr(); /* - return (long)IM_FONT->FallbackGlyph; + return (long)(intptr_t)IM_FONT->FallbackGlyph; */ /** diff --git a/imgui-binding/src/main/java/imgui/ImFontAtlas.java b/imgui-binding/src/main/java/imgui/ImFontAtlas.java index 2d302a5..2972e12 100644 --- a/imgui-binding/src/main/java/imgui/ImFontAtlas.java +++ b/imgui-binding/src/main/java/imgui/ImFontAtlas.java @@ -59,7 +59,7 @@ public final class ImFontAtlas implements ImDestroyable { private native long nCreate(); /* ImFontAtlas* imFontAtlas = new ImFontAtlas(); - return (long)imFontAtlas; + return (long)(intptr_t)imFontAtlas; */ private native void nDestroy(long ptr); /* @@ -71,7 +71,7 @@ public final class ImFontAtlas implements ImDestroyable { } private native long nAddFont(long imFontConfigPtr); /* - return (long)IM_FONT_ATLAS->AddFont((ImFontConfig*)imFontConfigPtr); + return (long)(intptr_t)IM_FONT_ATLAS->AddFont((ImFontConfig*)imFontConfigPtr); */ public ImFont addFontDefault() { @@ -79,7 +79,7 @@ public final class ImFontAtlas implements ImDestroyable { } private native long nAddFontDefault(); /* - return (long)IM_FONT_ATLAS->AddFontDefault(); + return (long)(intptr_t)IM_FONT_ATLAS->AddFontDefault(); */ public ImFont addFontDefault(final ImFontConfig imFontConfig) { @@ -87,7 +87,7 @@ public final class ImFontAtlas implements ImDestroyable { } private native long nAddFontDefault(long imFontConfigPtr); /* - return (long)IM_FONT_ATLAS->AddFontDefault((ImFontConfig*)imFontConfigPtr); + return (long)(intptr_t)IM_FONT_ATLAS->AddFontDefault((ImFontConfig*)imFontConfigPtr); */ public ImFont addFontFromFileTTF(final String filename, final float sizePixels) { @@ -95,7 +95,7 @@ public final class ImFontAtlas implements ImDestroyable { } private native long nAddFontFromFileTTF(String filename, float sizePixels); /* - return (long)IM_FONT_ATLAS->AddFontFromFileTTF(filename, sizePixels); + return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromFileTTF(filename, sizePixels); */ public ImFont addFontFromFileTTF(final String filename, final float sizePixels, final ImFontConfig imFontConfig) { @@ -103,7 +103,7 @@ public final class ImFontAtlas implements ImDestroyable { } private native long nAddFontFromFileTTF(String filename, float sizePixels, long imFontConfigPtr); /* - return (long)IM_FONT_ATLAS->AddFontFromFileTTF(filename, sizePixels, (ImFontConfig*)imFontConfigPtr); + return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromFileTTF(filename, sizePixels, (ImFontConfig*)imFontConfigPtr); */ public ImFont addFontFromFileTTF(final String filename, final float sizePixels, final short[] glyphRanges) { @@ -111,7 +111,7 @@ public final class ImFontAtlas implements ImDestroyable { } private native long nAddFontFromFileTTF(String filename, float sizePixels, short[] glyphRanges); /* - return (long)IM_FONT_ATLAS->AddFontFromFileTTF(filename, sizePixels, NULL, (ImWchar*)&glyphRanges[0]); + return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromFileTTF(filename, sizePixels, NULL, (ImWchar*)&glyphRanges[0]); */ public ImFont addFontFromFileTTF(final String filename, final float sizePixels, final ImFontConfig imFontConfig, final short[] glyphRanges) { @@ -119,7 +119,7 @@ public final class ImFontAtlas implements ImDestroyable { } private native long nAddFontFromFileTTF(String filename, float sizePixels, long imFontConfigPtr, short[] glyphRanges); /* - return (long)IM_FONT_ATLAS->AddFontFromFileTTF(filename, sizePixels, (ImFontConfig*)imFontConfigPtr, (ImWchar*)&glyphRanges[0]); + return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromFileTTF(filename, sizePixels, (ImFontConfig*)imFontConfigPtr, (ImWchar*)&glyphRanges[0]); */ /** @@ -131,7 +131,7 @@ public final class ImFontAtlas implements ImDestroyable { } private native long nAddFontFromMemoryTTF(byte[] fontData, int fontSize, float sizePixels); /* - return (long)IM_FONT_ATLAS->AddFontFromMemoryTTF(&fontData[0], fontSize, sizePixels); + return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromMemoryTTF(&fontData[0], fontSize, sizePixels); */ @@ -144,7 +144,7 @@ public final class ImFontAtlas implements ImDestroyable { } private native long nAddFontFromMemoryTTF(byte[] fontData, int fontSize, float sizePixels, long imFontConfigPtr); /* - return (long)IM_FONT_ATLAS->AddFontFromMemoryTTF(&fontData[0], fontSize, sizePixels, (ImFontConfig*)imFontConfigPtr); + return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromMemoryTTF(&fontData[0], fontSize, sizePixels, (ImFontConfig*)imFontConfigPtr); */ /** @@ -156,7 +156,7 @@ public final class ImFontAtlas implements ImDestroyable { } private native long nAddFontFromMemoryTTF(byte[] fontData, int fontSize, float sizePixels, short[] glyphRanges); /* - return (long)IM_FONT_ATLAS->AddFontFromMemoryTTF(&fontData[0], fontSize, sizePixels, NULL, (ImWchar*)&glyphRanges[0]); + return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromMemoryTTF(&fontData[0], fontSize, sizePixels, NULL, (ImWchar*)&glyphRanges[0]); */ /** @@ -168,7 +168,7 @@ public final class ImFontAtlas implements ImDestroyable { } private native long nAddFontFromMemoryTTF(byte[] fontData, int fontSize, float sizePixels, long imFontConfigPtr, short[] glyphRanges); /* - return (long)IM_FONT_ATLAS->AddFontFromMemoryTTF(&fontData[0], fontSize, sizePixels, (ImFontConfig*)imFontConfigPtr, (ImWchar*)&glyphRanges[0]); + return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromMemoryTTF(&fontData[0], fontSize, sizePixels, (ImFontConfig*)imFontConfigPtr, (ImWchar*)&glyphRanges[0]); */ /** @@ -179,7 +179,7 @@ public final class ImFontAtlas implements ImDestroyable { } private native long nAddFontFromMemoryCompressedTTF(byte[] compressedFontData, int fontSize, float sizePixels); /* - return (long)IM_FONT_ATLAS->AddFontFromMemoryCompressedTTF(&compressedFontData[0], fontSize, sizePixels); + return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromMemoryCompressedTTF(&compressedFontData[0], fontSize, sizePixels); */ /** @@ -190,7 +190,7 @@ public final class ImFontAtlas implements ImDestroyable { } private native long nAddFontFromMemoryCompressedTTF(byte[] compressedFontData, int fontSize, float sizePixels, long imFontConfigPtr); /* - return (long)IM_FONT_ATLAS->AddFontFromMemoryCompressedTTF(&compressedFontData[0], fontSize, sizePixels, (ImFontConfig*)imFontConfigPtr); + return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromMemoryCompressedTTF(&compressedFontData[0], fontSize, sizePixels, (ImFontConfig*)imFontConfigPtr); */ /** @@ -201,7 +201,7 @@ public final class ImFontAtlas implements ImDestroyable { } private native long nAddFontFromMemoryCompressedTTF(byte[] compressedFontData, int fontSize, float sizePixels, short[] glyphRanges); /* - return (long)IM_FONT_ATLAS->AddFontFromMemoryCompressedTTF(&compressedFontData[0], fontSize, sizePixels, NULL, (ImWchar*)&glyphRanges[0]); + return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromMemoryCompressedTTF(&compressedFontData[0], fontSize, sizePixels, NULL, (ImWchar*)&glyphRanges[0]); */ /** @@ -212,7 +212,7 @@ public final class ImFontAtlas implements ImDestroyable { } private native long nAddFontFromMemoryCompressedTTF(byte[] compressedFontData, int fontSize, float sizePixels, long imFontConfigPtr, short[] glyphRanges); /* - return (long)IM_FONT_ATLAS->AddFontFromMemoryCompressedTTF(&compressedFontData[0], fontSize, sizePixels, (ImFontConfig*)imFontConfigPtr, (ImWchar*)&glyphRanges[0]); + return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromMemoryCompressedTTF(&compressedFontData[0], fontSize, sizePixels, (ImFontConfig*)imFontConfigPtr, (ImWchar*)&glyphRanges[0]); */ /** @@ -223,7 +223,7 @@ public final class ImFontAtlas implements ImDestroyable { } private native long nAddFontFromMemoryCompressedBase85TTF(String compressedFontDataBase85, float sizePixels); /* - return (long)IM_FONT_ATLAS->AddFontFromMemoryCompressedBase85TTF(compressedFontDataBase85, sizePixels); + return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromMemoryCompressedBase85TTF(compressedFontDataBase85, sizePixels); */ /** @@ -234,7 +234,7 @@ public final class ImFontAtlas implements ImDestroyable { } private native long nAddFontFromMemoryCompressedBase85TTF(String compressedFontDataBase85, float sizePixels, long imFontConfigPtr); /* - return (long)IM_FONT_ATLAS->AddFontFromMemoryCompressedBase85TTF(compressedFontDataBase85, sizePixels, (ImFontConfig*)imFontConfigPtr); + return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromMemoryCompressedBase85TTF(compressedFontDataBase85, sizePixels, (ImFontConfig*)imFontConfigPtr); */ /** @@ -245,7 +245,7 @@ public final class ImFontAtlas implements ImDestroyable { } private native long nAddFontFromMemoryCompressedBase85TTF(String compressedFontDataBase85, float sizePixels, short[] glyphRanges); /* - return (long)IM_FONT_ATLAS->AddFontFromMemoryCompressedBase85TTF(compressedFontDataBase85, sizePixels, NULL, (ImWchar*)&glyphRanges[0]); + return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromMemoryCompressedBase85TTF(compressedFontDataBase85, sizePixels, NULL, (ImWchar*)&glyphRanges[0]); */ /** @@ -256,7 +256,7 @@ public final class ImFontAtlas implements ImDestroyable { } private native long nAddFontFromMemoryCompressedBase85TTF(String compressedFontDataBase85, float sizePixels, long imFontConfigPtr, short[] glyphRanges); /* - return (long)IM_FONT_ATLAS->AddFontFromMemoryCompressedBase85TTF(compressedFontDataBase85, sizePixels, (ImFontConfig*)imFontConfigPtr, (ImWchar*)&glyphRanges[0]); + return (long)(intptr_t)IM_FONT_ATLAS->AddFontFromMemoryCompressedBase85TTF(compressedFontDataBase85, sizePixels, (ImFontConfig*)imFontConfigPtr, (ImWchar*)&glyphRanges[0]); */ /** @@ -512,7 +512,7 @@ public final class ImFontAtlas implements ImDestroyable { * It is passed back to you during rendering via the ImDrawCmd structure. */ public native int getTexID(); /* - return (int)(long)(void*)IM_FONT_ATLAS->TexID; + return (int)(long)(intptr_t)(void*)IM_FONT_ATLAS->TexID; */ /** diff --git a/imgui-binding/src/main/java/imgui/ImFontConfig.java b/imgui-binding/src/main/java/imgui/ImFontConfig.java index c072ec1..6aaea85 100644 --- a/imgui-binding/src/main/java/imgui/ImFontConfig.java +++ b/imgui-binding/src/main/java/imgui/ImFontConfig.java @@ -26,6 +26,7 @@ public final class ImFontConfig implements ImDestroyable { } /*JNI + #include #include #include "jni_common.h" @@ -41,7 +42,7 @@ public final class ImFontConfig implements ImDestroyable { private native long nCreate(); /* ImFontConfig* imFontConfig = new ImFontConfig(); - return (long)imFontConfig; + return (long)(intptr_t)imFontConfig; */ private native void nDestroy(long ptr); /* diff --git a/imgui-binding/src/main/java/imgui/ImFontGlyph.java b/imgui-binding/src/main/java/imgui/ImFontGlyph.java index 6d620f0..117ede9 100644 --- a/imgui-binding/src/main/java/imgui/ImFontGlyph.java +++ b/imgui-binding/src/main/java/imgui/ImFontGlyph.java @@ -22,6 +22,7 @@ public final class ImFontGlyph implements ImDestroyable { } /*JNI + #include #include #include "jni_common.h" @@ -37,7 +38,7 @@ public final class ImFontGlyph implements ImDestroyable { private native long nCreate(); /* ImFontConfig* imFontConfig = new ImFontConfig(); - return (long)imFontConfig; + return (long)(intptr_t)imFontConfig; */ private native void nDestroy(long ptr); /* diff --git a/imgui-binding/src/main/java/imgui/ImGui.java b/imgui-binding/src/main/java/imgui/ImGui.java index d254cb6..121589a 100644 --- a/imgui-binding/src/main/java/imgui/ImGui.java +++ b/imgui-binding/src/main/java/imgui/ImGui.java @@ -856,7 +856,7 @@ public final class ImGui { } private static native long nGetFont(); /* - return (long)ImGui::GetFont(); + return (long)(intptr_t)ImGui::GetFont(); */ /** diff --git a/imgui-binding/src/main/java/imgui/ImGuiIO.java b/imgui-binding/src/main/java/imgui/ImGuiIO.java index 5ff23d8..02be48e 100644 --- a/imgui-binding/src/main/java/imgui/ImGuiIO.java +++ b/imgui-binding/src/main/java/imgui/ImGuiIO.java @@ -14,6 +14,7 @@ public final class ImGuiIO { } /*JNI + #include #include #include "jni_common.h" #include "jni_callbacks.h" @@ -167,7 +168,7 @@ public final class ImGuiIO { } private native long nGetFontsPtr(); /* - return (long)ImGui::GetIO().Fonts; + return (long)(intptr_t)ImGui::GetIO().Fonts; */ /**