Hi yall, struggling with getting https://github.com/SpaiR/imgui-java/ to work. Using version 1.89.0, code attached as it is too long to paste into the body of this post
#InGui ImGuiImplGl3.init("#version core 330") throwing NumberFormatException
1 messages · Page 1 of 1 (latest)
<@&987246399047479336> please have a look, thanks.
#version refers to the openGL version, see for reference the JavaDoc. https://github.com/SpaiR/imgui-java/blob/main/imgui-lwjgl3/src/main/java/imgui/gl3/ImGuiImplGl3.java
is "#version 330 core" not what should be passed in?
Look at the first column.
i should also mention, the line in the documentation that throws the error is here:
final String glVersion = glGetString(GL_VERSION);
if (glVersion != null) {
final String[] glVersions = glVersion.split("\\.");
major = Integer.parseInt(glVersions[0]);
minor = Integer.parseInt(glVersions[1]);
}```
GL_VERSION is defined as follows:
public static final int
GL_VENDOR = 0x1F00,
GL_RENDERER = 0x1F01,
GL_VERSION = 0x1F02, //7938 in decimal
GL_EXTENSIONS = 0x1F03;```
and the glGetString when followed through the documentation ends up here:
public static native long nglGetString(int name);
@NativeType("GLubyte const *")
public static @Nullable String glGetString(@NativeType("GLenum") int name) {
long __result = nglGetString(name);
return memUTF8Safe(__result);
}```
the reason why i'm so confused is because GL_VERSION and everything after seems to have nothing to do with my input
unless somehow nglGetString ends up doing something that somehow reads my input from an entirely separate class
So just place a breakpoint and look at what the value of glVersion is.
"2.1 Metal - 89.3"
i'm not sure what i can do about this, it seems like what it's supposed to be getting is either major = 2, minor = 1
and none of it depends on what my input to init() is
So I guess you're using an Apple device, in general why not post an issue on their GitHub? I would look at an FFM based alternative by the way rather than JNI.
because i thought it was my fault lol
Even then, it's their API they can better tell you what.