Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » A5 Textured quads?

This thread is locked; no one can reply to it. rss feed Print
A5 Textured quads?
Edgar Reynaldo
Member #8,592
May 2007
avatar

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?

Thomas Fjellstrom
Member #476
June 2000
avatar

Have you tried using the al_draw_prim function in the primitives addon?

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Edgar Reynaldo
Member #8,592
May 2007
avatar

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.

Evert
Member #794
November 2000
avatar

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...

Edgar Reynaldo
Member #8,592
May 2007
avatar

Arthur Kalliokoski
Second in Command
February 2005
avatar

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.

“Throughout history, poverty is the normal condition of man. Advances which permit this norm to be exceeded — here and there, now and then — are the work of an extremely small minority, frequently despised, often condemned, and almost always opposed by all right-thinking people. Whenever this tiny minority is kept from creating, or (as sometimes happens) is driven out of a society, the people then slip back into abject poverty. This is known as "bad luck.”

― Robert A. Heinlein

Evert
Member #794
November 2000
avatar

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.

Thomas Fjellstrom
Member #476
June 2000
avatar

Evert said:

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.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

altalena
Member #13,639
October 2011
avatar

I'm wondering how hard it would be to do something like half-life software rendering, or even wolfenstein 3d in Allegro 5.

...At the briefest instant following creation all the matter of the universe was concentrated in a very small place, no larger than a grain of mustard. The matter at this time was very thin, so intangible, that it did not have real substance. It did have, however, a potential to gain substance and form and to become tangible matter. From the initial concentration of this intangible substance in its minute location, the substance expanded, expanding the universe as it did so. As the expansion progressed, a change in the substance occurred. This initially thin noncorporeal substance took on the tangible aspects of matter as we know it. From this initial act of creation, from this ethereally thin pseudosubstance, everything that has existed, or will ever exist, was, is, and will be formed. - the RaMBaN, 1194 - 1270

ג וּשְׁאַבְתֶּם-מַיִם, בְּשָׂשׂוֹן, מִמַּעַיְנֵי, הַיְשׁוּעָה. - Yeshayahu 12:3

Go to: