How to use glDrawRangeElements()

Started by
1 comment, last by Enu 17 years, 11 months ago
Hi all, :D I'm using VBOs, in glDrawRangeElemetns(mode,start,end,count,type,indices) 2nd param refers to GL_ARRAY_BUFFER, or to GL_ELEMENT_ARRAY_BUFFER? In glDrawArray(mode,firts,count), first param refers to GL_ARRAY_BUFFER, and it's useful because i don't have to use gl*Pointer() during rendering function. Most of all, 3rd param in glDREs() is always start+count, right? .. i don't understand <_> :)
Advertisement
Quote:Original post by Enu
Hi all, :D
I'm using VBOs, in glDrawRangeElemetns(mode,start,end,count,type,indices)
2nd param refers to GL_ARRAY_BUFFER, or to GL_ELEMENT_ARRAY_BUFFER?
Yes, the 2nd and 3rd param refer to the indice of the vertex array, not index array. These "start" and "end" index are used to specify a range of data to be prefetched, so OpenGL may be able to obtain only limited amount of vertex array data prior to rendering, and may increase performance.

The range of the data can be simply calculated by (end - start "plus" 1). But it is not related with the 4th param (count). The 4th param is the number of indice in index array to read, starting from where the index pointer(6th param) is currently located.

Quote:Original post by Enu
In glDrawArray(mode,firts,count), first param refers to GL_ARRAY_BUFFER, and it's useful because i don't have to use gl*Pointer() during rendering function.
I think this is not correct. I believe you still need gl*Pointer() to tell where the array is.
Quote:Original post by songho
Quote:Original post by Enu
In glDrawArray(mode,firts,count), first param refers to GL_ARRAY_BUFFER, and it's useful because i don't have to use gl*Pointer() during rendering function.
I think this is not correct. I believe you still need gl*Pointer() to tell where the array is.


First of all thx a lot :D
About glDrawArray(), yes, i need gl*Pointer(), but i can call it only once so i reduce function-calls.

This topic is closed to new replies.

Advertisement