Multiple rectangular outlines

Hi everyone,

In my game menu I have multiple buttons. Each button I am using sfml to draw the text and opengl to draw the rectangular outlines.

What I am thinking of doing is put all vertices and indices into one buffer each and then use glDrawRangeElements and GL_LINE_LOOP in a loop to draw the individual outlines.

Is this the correct approach?

[QUOTE=codeman_nz;1282053]
What I am thinking of doing is put all vertices and indices into one buffer each and then use glDrawRangeElements and GL_LINE_LOOP in a loop to draw the individual outlines.

Is this the correct approach?[/QUOTE]
A better approach would be to draw all of the outlines with one call, either using GL_LINES or using GL_LINE_LOOP with glEnable(GL_PRIMITIVE_RESTART) or glEnable(GL_PRIMITIVE_RESTART_FIXED_INDEX).

Thank you very much. That’s exactly what I was looking for!