Re: [AD] Additional graphics primitives API

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


To my knowledge there is no way to do sub-pixel
precision of curves in OpenGL. In the end, (even if we
use the GPU evaluators), the curves will have to be
drawn as connected line segments. If subpixel
precision is really wanted, then we could just wrap a
do_circle(assuming it is subpixel accurate) call with
something that passes a bunch of points calculated by
that to the OpenGL rendered. I tested this approach,
and it works but is approximately 5 times slower.

In this case, I shall propose the following. Allegro
proper should have the following functions:

al_draw_polygon
al_draw_line//a special case of al_draw_polygon
al_draw_triangle//same as above
al_draw_rectangle//same as above
al_set_pixel

My reasoning behind these is that these primitives are
as basic as things go, and (unless I am mistaken) can
be used to draw every other primitive there is,
sometimes by using al_set_pixel in extreme cases.

In the addon category we'd have these things:

al_draw_circle//using the do circle approach - i.e.
directly porting the software drawing functions
al_draw_ellipse//same as above
al_draw_arc//same as above
And all of the al_do_* functions

al_draw_poly_circle
al_draw_poly_ellipse
al_draw_poly_arc
al_draw_poly_spline
And the al_calc_* routines for each of those.

All of these functions are drawn using the primitive
functions from allegro. We also would have two
versions of the curve primitives. This way, the users
can either choose the very accurate but sometimes slow
routines when they want to, but also have the option
to use the faster approximations. Additional benefit
of these latter functions is that they anti-alias well
(even if this is not supported by allegro proper).


      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/