|
|
| primitives glitches |
|
Matthew Leverton
Supreme Loser
January 1999
|
SiegeLord said: It's no more of a bug than the coordinates for al_draw_rectangle and al_draw_filled_rectangle not lining up. It's not a bug if it does what it's documented to do. But right now it says: al_draw_line said: x1, y1, x2, y2 - Start and end points of the line
al_draw_rectangle said: x1, y1, x2, y2 - Upper left and lower right points of the rectangle
al_draw_filled_rectangle said: x1, y1, x2, y2 - Upper left and lower right points of the rectangle They all sound identical, so I'd expect identical behavior when passing the same values. If there are valid technical reasons that force the programmer to use different numbers for seemingly identical coordinates, then so be it. But the documentation and all the various explanations here are not clear (and in some cases contradicting). |
|
Thomas Fjellstrom
Member #476
June 2000
|
Yes things probably are inconsistent in the primitives addon.. Personally I'd like to see them act purely as pixel perfect a4 like routines. If you want anything fancier, use GL or something. -- |
|
SiegeLord
Member #7,827
October 2006
|
Okay, we (the devs) discussed this at lengths, and decided that the current semantics of the functions are the least evil of all the alternatives we proposed. Thus, moving forward, we (I) will be doing this: Matthew Leverton said: Somebody who knows how this works just needs to update the documentation that tells you how to draw a line/box/triangle/etc from a to b. ...with <marque><blink>pictures!</marque></blink> "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
|
Thomas Fjellstrom
Member #476
June 2000
|
Lets just say I don't agree -- |
|
Matthew Leverton
Supreme Loser
January 1999
|
It's okay. I'll just create a new "Line Drawing" forum to handle all of the questions. |
|
SiegeLord
Member #7,827
October 2006
|
Okay, I added a section to the documentation explaining how the things work... hopefully it should make things clear for everyone. Here's a preview courtesy of Thomas Fjellstrom: Linky. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
|
Matthew Leverton
Supreme Loser
January 1999
|
What about al_draw/put_pixel? Does that always set a single pixel as closest to the specified coordinates? |
|
William Labbett
Member #4,486
March 2004
|
I can vouch for that. Trouble is al_put_pixel is only useful on memory bitmaps. al_draw_pixel is slow too althought I don't know if it is on memory bitmaps.
|
|
Trent Gamblin
Member #261
April 2000
|
If you lock the bitmap, al_put_pixel is not too slow, if you don't use it too much.
|
|
Matthew Leverton
Supreme Loser
January 1999
|
I don't care much about speed, because the bitmap is only generated once. I want to make sure that the pixel is drawn where I expect it to be. Right now I'm using (x+0.5,y+0.5), where (x,y) represents an integer coordinate system. |
|
Elias
Member #358
May 2000
|
al_put_pixel takes integer coordinates so it just uses a pixel index. It also should not be affected by transformations or blending. (If that's not how it actually works it's probably a bug.) al_draw_pixel I guess is equivalent to drawing a 1x1 filled rectangle, so I'd say using 0.5/0.5 is the right thing to do for it. -- |
|
SiegeLord
Member #7,827
October 2006
|
Elias said: al_put_pixel takes integer coordinates so it just uses a pixel index. It also should not be affected by transformations or blending. (If that's not how it actually works it's probably a bug.) al_draw_pixel I guess is equivalent to drawing a 1x1 filled rectangle, so I'd say using 0.5/0.5 is the right thing to do for it. Yes, that's how it works. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
|
Matthew Leverton
Supreme Loser
January 1999
|
Quote: /* blue vertical line */ Why use 0 and 6 for y? Does the thickness only extend perpendicular to the line? |
|
SiegeLord
Member #7,827
October 2006
|
Yes, that it does. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
|
William Labbett
Member #4,486
March 2004
|
I want to say - although it's slowed down my game's development because I had to learn the new API, I love allegro 5. I don't care much for whether the scheme follows the openGL way or the old allegro style. Either way, both can do everything, you just have to get used to how to do what you want.
|
|
Mark Oates
Member #1,146
March 2001
|
SiegeLord said: Here's a preview courtesy of Thomas Fjellstrom: Linky [alleg.strangesoft.net]. Nice illustrations.... which gives me an idea! Let me help by doing illustrations for the manual. Since I can't help much with the actual coding, and I have this constant uncontrollable urge to do graphics for no reason, I'd like to volunteer for that job. Several functions, like the al_draw_arc() function would really benefit with a nice illustration. Another example is the al_draw_font_* and metrics routines. Most importantly, we should agree to standardize the illustration style. I really like the line weights, proportion to document text size, fonts, and conventions you used (cross hairs, pointer arrow to coordinates, dashed line (not transparent line), Verdana italic for axis, etc). And unless you already have it planned out, we should start with that as a design reference. What program did you use and can you send me the file? I would like to write up an illustration standards in the wiki. I really believe we should do this. It would be a great key to the appearance, quality, and usability of A5. I can see it and I believe in it. William Labbett said: I love allegro 5. Totally agree. I'm getting to know the the event system, It's pretty powerful. -- |
|
BAF
Member #2,981
December 2002
|
Just skimming over this thread, I tend to agree with Tomasu. Why the hell should it be this obscure? If I created something this hard to understand at work, I wouldn't have my job for long. |
|
Matthew Leverton
Supreme Loser
January 1999
|
BAF said: I wouldn't have my job for long You'd be fired for skimming the documentation. It's annoying, but understandable (I suppose) due to the transformation system. I've just created a few macros to help me remember, e.g.: #define _algui_draw_hline(x, y, w, c) al_draw_line((x), (y) + 0.5, (x) + (w), (y) + 0.5, c, 1.0) If the API is well documented and works the same across all platforms, there's really not much to complain about. |
|
Elias
Member #358
May 2000
|
Mark Oates said: Nice illustrations.... which gives me an idea! Let me help by doing illustrations for the manual. I like the idea of more pictures. We were talking about it in #allegro yesterday, some other obvious places would be placing the logo on the front page and replacing any ASCII-art. Except, it would probably be good for ASCII art to stay in the man docs. Not sure if pandoc allows man-only sections though. -- |
|
Thomas Fjellstrom
Member #476
June 2000
|
Damnit, now I know I was being unreasonable. BAF Agreed with me
-- |
|
weapon_S
Member #7,859
October 2006
|
There are no inconsistencies between platforms? Good |
|
Elias
Member #358
May 2000
|
weapon_S said: Will the green rectangle in the first example have any output, when multisampling is turned on? Yes. Depends on the multisample settings what exactly happens though. [edit] OpenGL ES 2.0 specification said:
Multisample rasterization of all primitives differs substantially from single- So it depends on how many of those sample points hit the shape. If you use 4x4 samples and one hits the shape, its color will contribute 1/16th to the final color of the pixel. -- |
|
SiegeLord
Member #7,827
October 2006
|
Mark Oates said: What program did you use and can you send me the file? I would like to write up an illustration standards in the wiki. I used Inkscape 0.47, although I'm sure anything that can draw vector grahics can work. The source SVG files can be found in the Allegro SVN in the /docs/src/refman/images folder. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
|
|
|