The game I'm working on has OpenGL (2.1) vector graphics, and I need to draw up to 1000 enemies, each of which is composed of between 4 and 100 lines.
Each enemy can be drawn as a single line loop, so one strategy for drawing would be to call
glDrawElements(GL_LINE_LOOP, ...) once for each enemy. This results in too many (up to 1000) calls of
glDrawElements per frame.
Another strategy would be to separate the line-loops that form each enemy into individual line segments, and call
glDrawElements(GL_LINES, ...). This results in a lot of repeated vertices though, which I would like to avoid.
Is there a way to draw multiple line loops in a single call to glDrawElements (or with some other function)? I guess I would need some indicator in the vertex/element array to mark where each line loop ended.