【发布时间】: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)
有人知道如何解决这个问题吗?
【问题讨论】:
-
不是。这是驱动的问题。