PDA

View Full Version : glDrawArray(...)



05-24-2001, 07:23 AM
Hello everybody,

Well i was reading a small renderer of Half-Life bsp maps and i see the function "glDrawArray(...)". Well i don't know this function and if somebody could help me about the data to pass to the function.

Is that a way to threat the famous VertexArray wich i have seen several times in posts? I so, well... Oops! Sorry for asking once more informations about it.

Thanks.
TheDD

chennes
05-24-2001, 07:28 AM
Yes - glDrawArray is what you use to draw a vertex array.

Chris

Korval
05-24-2001, 01:27 PM
glDrawElements draws the currently enabled and active vertex array via indices. glDrawArrays simply marches down the current vertex array. Essentially, glDrawArrays is equivalent to glDrawElements whose indices are: 1, 2, 3, 4, ... to the end of the array. glDrawArrays is good for arrays that don't often use repeated vertices, but it is usually faster (especially if you have many short strips) to use glDrawElements, especially if your card uses hardware T&L.

05-26-2001, 06:11 AM
Ok but glDrawArrays seems to be un-loved because of the repetition of the vertices for each normal, text coords, ... Is it possible to avoid this with glDrawElements?