Jump to content
  • Advertisement
Sign in to follow this  

How to use glDrawRangeElements()

This topic is 4387 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 <_> :)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!