【问题标题】:LWJGL 3 unsupported functionLWJGL 3 不支持的功能
【发布时间】:2015-06-30 16:38:06
【问题描述】:

我们正在尝试使用 LWJGL 3 绘制简单的正方形。在一台计算机上它可以正常工作,但在我的 PC 上它会引发错误。

我的画是这样的。

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

例如,当我想画一条简单的线时,它也不起作用。

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

每次它从这个函数中抛出一个异常。

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

错误看起来像这样。

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)

有人知道如何解决这个问题吗?

【问题讨论】:

标签: java opengl lwjgl


【解决方案1】:

好的,所以我们一直在寻找几个小时的答案,我们发现这是驱动程序的问题。

我已经在我的电脑上安装了正确的驱动程序,现在它工作正常。您可以在此页面https://www.opengl.org/wiki/Getting_Started#Downloading_OpenGL找到安装驱动程序的链接。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-12
    • 2011-02-20
    • 2012-04-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多