New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDL_RenderDrawLine(s) not drawing 1 pixel line #2006
Comments
…derer. One place known to differ in a significant way is a single line segment that starts and ends on the same point; the GL renderers will light up a single pixel here, whereas the software renderer will not. My current belief is this is a bug in the software renderer, based on the wording of the docs: "SDL_RenderDrawLine() draws the line to include both end points." You can see an example program that triggers that difference in Bug #2006. As it stands, the GL renderers might _also_ render diagonal lines differently, as the the Bresenham step might vary between implementations (one does three pixels and then two, the other does two and then three, etc). But this patch causes those lines to start and end on the correct pixel, and that's the best we can do, and all anyone really needs here. Not closing any bugs with this patch (yet!), but here are several that it appears to fix. If no other corner cases pop up, we'll call this done. Reference Bug #2006. Reference Bug #1626. Reference Bug #4001. ...and probably others...
(The single-point line rendering in OpenGL but not software is, imho, a software renderer bug, but the rest of the lines in that test case should now match up end points between the GL/GLES renderers and software.) OpenGL and GLES renderers should be improved here, in the latest in revision control. Any corner cases that remain (or are caused by this patch), PLEASE report them asap, as we would like this to be solid and never thought about again by the time 2.0.18 ships. Thanks! |
Otherwise it would drop it, which seems like a bug to me, as it normally fills the endpoint on lines. Reference #2006.
okay, I fixed the software renderer to match the other renderers (which is usually backwards from how we do it, but in this case I'm convinced this was a software renderer bug). Closing this with several other bugs. |
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
patch (test_bug_3162_lines.c, text/x-csrc, 2017-10-18 14:59:17 +0000, 3404 bytes)Reported in version: 2.0.3
Reported for operating system, platform: Windows 7, x86_64
Comments on the original bug report:
On 2015-11-02 17:26:00 +0000, Marcel Bakker wrote:
On 2017-10-18 14:52:30 +0000, Sylvain wrote:
On 2017-10-18 14:53:57 +0000, Sylvain wrote:
On 2017-10-18 14:59:17 +0000, Sylvain wrote:
On 2017-10-18 15:11:15 +0000, Sylvain wrote:
On 2017-10-18 15:16:09 +0000, Sam Lantinga wrote:
On 2017-10-18 21:15:56 +0000, Sam Lantinga wrote:
On 2017-10-18 21:23:22 +0000, Sylvain wrote:
The text was updated successfully, but these errors were encountered: