Search code examples
javaopengllwjgl

LWJGL 3 unsupported function


we are trying to draw simple square using LWJGL 3. On one computer it works fine but on my PC it throws an error.

My draw looks like this.

glBegin(GL_QUADS);
{
     glVertex2f(0.02f, 0.02f);
     glVertex2f(0.1f, 0.1f);
     glVertex2f(0.02f, 0.1f);
     glVertex2f(0.1f, 0.02f);
}
glEnd();

It doesn't work also when I, for example, want to draw a simple line.

glBegin(GL_LINES);
{
    glVertex2f(10, 10);
    glVertex2f(20, 20);
}
glEnd();

Every time it throws an exception from this function.

public static long checkFunctionAddress(long pointer) {
    if(pointer == 0L) {
        throw new IllegalStateException("Function is not supported");
    } else {
        return pointer;
    }
}

Error looks like this.

Exception in thread "main" java.lang.IllegalStateException: Function is not supported
    at org.lwjgl.system.Checks.checkFunctionAddress(Checks.java:52)
    at org.lwjgl.opengl.GL11.glBegin(GL11.java:1619)
    at Main.loop(Main.java:105)
    at Main.run(Main.java:26)
    at Main.main(Main.java:121)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)

Does anybody know how to fix this issue?


Solution

  • Ok, so we have been looking for a answer for few hours and we figured out, that it was the driver problem.

    I have installed a proper driver on my pc and it works fine now. You can find a link to install the driver on this page https://www.opengl.org/wiki/Getting_Started#Downloading_OpenGL.