[AD] [ alleg-Bugs-3053159 ] A point put at the display at (0, 0) is invisible

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


Bugs item #3053159, was opened at 2010-08-25 19:06
Message generated for change (Comment added) made by elias
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105665&aid=3053159&group_id=5665

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Linux
Group: 4.9
Status: Open
Resolution: None
Priority: 3
Private: No
Submitted By: https://www.google.com/accounts ()
Assigned to: Nobody/Anonymous (nobody)
Summary: A point put at the display at (0,0) is invisible

Initial Comment:
A point at (1,1) appears in top left corner just near the edge. This happens for fullscreen as well as windowed mode.

A sample script attached: close it by pressing a button on a keyboard. It paints two lines that cross at the position of the mouse.

System specification: 
 Ubuntu 10.04 Lucid Lynx (Linux 2.6.32-24-generic, Xorg 7.5, mesa 7.7.1)
 Propertiary ATI card driver fglrx 10.7.
 Allegro 4.9

----------------------------------------------------------------------

>Comment By: Elias Pschernig (elias)
Date: 2010-08-26 18:54

Message:
Yes, there should be a note. I'll leave the bug open until that note is
added. For bitmaps it just is less of an issue, since drawing a bitmap to
0/0 is what you want. If the bitmap is 1x1 pixel, it will then exactly fill
the pixel from 0/0 to 1/1.

----------------------------------------------------------------------

Comment By: Mateusz Jończyk (mat2)
Date: 2010-08-26 18:27

Message:
Thanks.
You're right . With al_put_pixel it works as expected.

However, these things affect also bitmap drawing routines (like
al_draw_bitmap_region). Shouldn't there be a note in the documentation,
possibly around 

http://docs.liballeg.org/graphics.html#drawing-operations

----------------------------------------------------------------------

Comment By: Elias Pschernig (elias)
Date: 2010-08-25 19:37

Message:
Which point to you mean? The only drawing commands I see are two lines.
al_draw_line works like described here:

http://docs.liballeg.org/primitives.html#pixel-precise-output

So if you do:

al_draw_line(state.x - 50, state.y, state.x + 50, state.y,
al_map_rgb(0,0,0), 1);
al_draw_line(state.x, state.y - 50, state.x, state.y + 50,
al_map_rgb(0,0,0), 1);

And we say x=0 and y = 0 that means:
al_draw_line(-50, 0, 50, 0, c, 1)
al_draw_line(0, -50, 0, 50, c, 1)

The thickness of 1 means the two lines draw these areas:
(-50, -0.5, 50, 0.5)
(-0.5,-50,0.5, 50)

A pixel is filled when its center is inside that area. If the area just
touches a pixel center, i.e. goes exactly through the 0.5/0.5 point, as
happens in these cases, the behavior is undefined (i.e. each graphics card
does it differently). The solution in your specific case is probably to use
this instead:

al_draw_line(state.x - 50, state.y + 0.5, state.x + 50, state.y + 0.5,
al_map_rgb(0,0,0), 1);
al_draw_line(state.x + 0.5, state.y - 50, state.x + 0.5, state.y + 50,
al_map_rgb(0,0,0), 1);


----------------------------------------------------------------------

Comment By: https://www.google.com/accounts ()
Date: 2010-08-25 19:08

Message:
My address: mat.jonczyk in the domain of gmail.com.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105665&aid=3053159&group_id=5665




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