0
每当我看一个教程,解释如何使用glDrawArrays和glVertexPointer命令,他们使用的参数是不同的,我可用。正确使用glVertexPointer?
例如:一个教程调用glVertexPointer像这样的参数:(顶点是float数组)
glVertexPointer(3, GL_FLOAT, 0, Vertices);
我有可用的参数是:
glVertexPointer(int size, int stride, FloatBuffer pointer);
我的问题是:什么是使用glVertexPointer()的正确方法?
好吧,我明白了。我将不得不这样做:IntBuffer verts = IntBuffer.wrap(Vertices)? – lightice11 2013-03-24 21:00:57
@ lightice11:你为什么要在一个* IntBuffer *中放入“一个浮点数组”? – 2013-03-24 21:18:04
浮动从我正在阅读的教程中,我在我的程序中使用整数:D反正,它给了我一个错误,说缓冲区不是直接的。我应该使用ByteBuffer.allocateDirect()吗? – lightice11 2013-03-24 21:21:23