Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why no LINE_LOOP or POINT_LIST for al_draw_indexed_buffer? #941

Open
fatcerberus opened this Issue Oct 13, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@fatcerberus
Copy link
Contributor

fatcerberus commented Oct 13, 2018

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:

case ALLEGRO_PRIM_LINE_LOOP: {
/* Unimplemented, as it's too hard to do for Direct3D */
break;
};

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?

@SiegeLord

This comment has been minimized.

Copy link
Member

SiegeLord commented Oct 13, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.