Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am creating a game using Box2D and OpenGL ES 1.1.

I am taking the b2PolygonShape vertices and converting them into an OpenGL ES 1.1 GL_LINE_LOOP. The debugging view looks great, but now I want to apply textures to the inside of the line loop.

Is this possible? I used line loop instead of triangles because I am not sure how to handle complex polygons using triangles.

share|improve this question
up vote 5 down vote accepted


Only rendered primitives get rasterized and shaded, and when you render using GL_LINE_LOOP your primitives are just the lines themselves, not the area enclosed by the lines.

If you want to rasterize and shade the area within the line, you have to render using a solid primitive like GL_TRIANGLES. If you have complex polygons you will first need to break them down into triangles using some kind of triangulation technique (you can also search this site for other questions about polygon triangulation if you get stuck).

share|improve this answer
shouldn't (a convex) line loop be trivially convertible to triangle fan? – Jimmy Jul 11 '13 at 19:05
If its convex, yes. – Josh Petrie Jul 11 '13 at 19:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.