我们正在尝试使用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)
有人知道如何解决这个问题吗?
答案 0 :(得分:0)
好的,所以我们一直在寻找几个小时的答案,我们发现,这是驾驶员的问题。
我已经在我的电脑上安装了一个合适的驱动程序,现在工作正常。您可以在此页https://www.opengl.org/wiki/Getting_Started#Downloading_OpenGL找到安装驱动程序的链接。