Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Draw bitmap as trapezoid

This thread is locked; no one can reply to it. rss feed Print
 1   2 
Draw bitmap as trapezoid
Arthur Kalliokoski
Second in Command
February 2005
avatar

SiegeLord said:

Which example is that? al_draw_prim one works just fine.

The example I'm talking about is on the al_draw_prim page.

//For example to draw a textured triangle you could use:

ALLEGRO_VERTEX v[] = {
    {.x = 128, .y = 0, .z = 0, .u = 128, .v = 0},
    {.x = 0, .y = 256, .z = 0, .u = 0, .v = 256},
    {.x = 256, .y = 256, .z = 0, .u = 256, .v = 256}};
al_draw_prim(v, NULL, texture, 0, 3, ALLEGRO_PRIM_TRIANGLE_LIST);

it doesn't say anything about any dependencies on transformations etc.

[EDIT]

No doubt these shortcomings will be hammered out in time, it's just that the developers already know so much about how to use A5 that they forget to mention lots of things in the docs etc. I'll stick to OpenGL, since there's so many gigabytes of info available already, not counting the other advantages.

They all watch too much MSNBC... they get ideas.

SiegeLord
Member #7,827
October 2006
avatar

There is no special dependence of that code on transformations beyond what is common to all drawing code. You'd get no farther in OpenGL if you didn't set the proper GL_PROJECTION matrix either.

Anyway, I already posted the solution... so I'm not sure what the argument is anymore.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

Arthur Kalliokoski
Second in Command
February 2005
avatar

SiegeLord said:

You'd get no farther in OpenGL if you didn't set the proper GL_PROJECTION matrix either.

But there are thousands of examples to show you the way, from those ancient NeHe tutorials to the OpenGL docs at opengl.org. You guys are creating something new from scratch as far as I can see.

They all watch too much MSNBC... they get ideas.

Elias
Member #358
May 2000

I don't think you'd have an easy time finding the solution for OpenGL either. It's just a very specific task - nothing that should be in the documentation. But once you know that the problem can be solved with a perspective transformation and know the transformation you want to use, both OpenGL and Allegro should have enough documentation to implement it.

--
"Either help out or stop whining" - Evert

 1   2 


Go to: