Skip to main content
GameDev.net gamedev.net
๐Ÿ”’ Locked

glDrawArrays and using vector size for last parameter

Started by Rodimus Sep 9, 2011 at 9:05 PM 0 replies 1k views
Original Post
Rodimus
Rodimus
I'd like to use the length of the vertex array as the third parameter in the dlDrawArrays function, since it determines how many vertexes that needs to be drawn. However, it causes some really weird behaviour in the program. Whenever I use "78" which is the vertex count for the model, everything works nicely.

Why does vector.size() cause this problem and what would be the better solution? I don't like having the actual vertex count number in there.
[attachment=5319:Untitled-1.jpg]
"Rodimus and Unity" - My developer journal
Brother Bob
Brother Bob
Are you sure that the size of the vector is actually 78? Check the actual value returned by size().

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.