Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Why no LINE_LOOP or POINT_LIST for al_draw_indexed_buffer? #941
While skimming through Allegro's OpenGL code to try to teach myself how to use WebGL by proxy, I happened to notice that using an index buffer to draw line loops and point lists is not supported:
This is, in fact, documented, but for some reason I missed the relevant bit in the documentation...
The stated reason why this is not supported in the Direct3D implementation (according to a code comment) is that it's "too hard to do in a consistent fashion", and I guess the support was left out of the OpenGL backend only for consistency (things must work in both places or not at all, makes sense).
What is the concrete reason for why indexed drawing of line-loops and points is hard to support in D3D? Does anyone even still know?
For points, D3D just doesn't implement it (see https://docs.microsoft.com/en-us/windows/desktop/api/d3d9/nf-d3d9-idirect3ddevice9-drawindexedprimitive#remarks), and for the line loop, it doesn't exist at all in D3D, and the non-vertex buffer implementation hacks around it by drawing the final line manually.
I suppose we could fall back to non-buffer implementations. We could log a warning and add a note in the documentation.