Are there any plans to create textured quad drawing functions in Allegro 5? If there aren't any so far, how much work would it be to make them using OpenGL / DirectX? And how hard would it be to make them respect all the different blending modes?
Do non-axis aligned trapezoids count as a quad?
Have you tried using the al_draw_prim function in the primitives addon?
Erp. Didn't think of that. It might be nice to have ALLERO_PRIM_QUAD_LIST as a ALLEGRO_PRIM_TYPE though...
I've never done this before, so how would I specify the triangles, and what direction should the vertices of the triangles wind in?
Is there any reason the 'vtxs' parameter of <code>al_draw_prim</code> is a <code>const void*</code> instead of an <code>const ALLEGRO_VERTEX*</code>?Nevermind this question, it's for vertices that aren't ALLEGRO_VERTEXs.
It might be nice to have ALLERO_PRIM_QUAD_LIST as a ALLEGRO_PRIM_TYPE though...
If I recall correctly, the problem with that is backend support...
Well, quads don't have to be supported natively if they can be supported with two nested calls to al_draw_prim using triangles. I just don't know how to do that yet.
I don't know about Direct X, but OpenGL can do quads (they need to have all four vertices on the same plane to avoid distortion in unpredictable ways), the vertex order doesn't matter if glDisable(GL_CULL_FACE) is in effect, if it is in effect you can choose between glFrontFace(GL_CW) (clockwise) or glFrontFace(GL_CCW) (the default counterclockwise order). I believe most 3d editors use counterclockwise.
OpenGL can do quads
But their performance is worse than triangle strips, and I think they've been removed from OpenGL ES (could look that up to be certain).
Their use is not recommended.
But their performance is worse than triangle strips, and I think they've been removed from OpenGL ES (could look that up to be certain).
Nope, not in OpenGL ES. As well, OpenGL 3 and 4 both lack the glBegin/glEnd/glVertex* style api, as well as any type of QUAD primitive for glDrawArrays. The docs only list these for OpenGl 3: GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_LINE_STRIP_ADJACENCY, GL_LINES_ADJACENCY, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_TRIANGLES, GL_TRIANGLE_STRIP_ADJACENCY and GL_TRIANGLES_ADJACENCY. OpenGL 4 supports those, and GL_PATCHES.
I'm wondering how hard it would be to do something like half-life software rendering, or even wolfenstein 3d in Allegro 5.