Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/opengl/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java LWJGL glVertexAttributePointer错误:禁用数组缓冲区对象时无法使用偏移量_Java_Opengl_Lwjgl - Fatal编程技术网

Java LWJGL glVertexAttributePointer错误:禁用数组缓冲区对象时无法使用偏移量

Java LWJGL glVertexAttributePointer错误:禁用数组缓冲区对象时无法使用偏移量,java,opengl,lwjgl,Java,Opengl,Lwjgl,在我的程序中,抛出错误:org.lwjgl.opengl.OpenGLException:禁用数组缓冲区对象时无法使用偏移量 我知道如果不按正确的顺序调用glPointer/glBindBuffer,就会发生这种情况 下面是我正在做的,大致如下: GL20.glBindBuffer(GL_ARRAY_BUFFER, bufferID); GL20.glEnableVertexAttribArray(attributeIndex); //In this case, 0 GL20.glVertexA

在我的程序中,抛出错误:org.lwjgl.opengl.OpenGLException:禁用数组缓冲区对象时无法使用偏移量

我知道如果不按正确的顺序调用glPointer/glBindBuffer,就会发生这种情况 下面是我正在做的,大致如下:

GL20.glBindBuffer(GL_ARRAY_BUFFER, bufferID);
GL20.glEnableVertexAttribArray(attributeIndex); //In this case, 0
GL20.glVertexAttribPointer(attributeIndex, attributeLength, GL_FLOAT, isNormalized, stride, offset);
...
显然,我在这段代码之前分配了缓冲区,并检查了bufferID是否为非零和非-1

但是,在执行GLVERTEXATTributePoint时,我得到一个错误:当数组缓冲区对象被禁用时,无法使用偏移量


我忘了打电话了吗?

你能具体说明问题是什么吗?太棒了,你知道如何使用glVertexAttributePointer,但您的实际问题是什么呢?我得到org.lwjgl.opengl.OpenGLException:当数组缓冲区对象被禁用时不能使用偏移量。这也可能是一种神秘的方式,表示您在尝试进行这些调用时没有VAO绑定。在核心配置文件上下文中,除非您具有VAO绑定,否则它们是无效的操作。但是为什么lwjgl会用这种方式表达错误消息,我不能说。