| Summary: | SDL_RenderDrawLine draws last point at 0,0 | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Richard Russell <rtrussell> |
| Component: | render | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | Keywords: | target-2.0.12 |
| Version: | 2.0.10 | ||
| Hardware: | x86 | ||
| OS: | Windows 10 | ||
| Attachments: |
Shows incorrect behavior in SDL 2.0.10 (Windows)
Shows incorect behavior in SDL 2.0.10 (MacOS) Shows correct behavior in SDL 2.0.9 (Windows) Beginning and end points swapped (2.0.10) |
||
Created attachment 4174 [details]
Shows incorect behavior in SDL 2.0.10 (MacOS)
Created attachment 4175 [details]
Shows correct behavior in SDL 2.0.9 (Windows)
Created attachment 4176 [details]
Beginning and end points swapped (2.0.10)
This is what happens if you swap the beginning and end of the line, confirming that it's the last point (here 3,3) that gets plotted incorrectly at 0,0.
Ryan, can you look at this? This code seems suspicious... data->glVertex2f(verts[(count-1)*2], verts[(count*2)-1]); (In reply to Sam Lantinga from comment #4) > This code seems suspicious... > data->glVertex2f(verts[(count-1)*2], verts[(count*2)-1]); Sorry to interject, but it could be right when you consider it's equivalent to: data->glVertex2f(verts[(count*2)-2], verts[(count*2)-1]); Somebody kindly sent me a DLL of SDL 2.0.11 to try (see the related thread at the forum) and the issue seems to be fixed there. So although a search of Bugzilla didn't find any reference to this specific bug, it seems that it has been addressed. Okay, thanks for letting us know! |
Created attachment 4173 [details] Shows incorrect behavior in SDL 2.0.10 (Windows) SDL_RenderDrawLine draws the final point at coordinates (0,0) rather than in the correct place. Superficially it appears that the line is shorter than it should be (the docs state "SDL_RenderDrawLine() draws the line to include both end points") but in fact the last pixel is drawn, just in the wrong place! This is a regression in SDL 2.0.10, so I don't think it is a duplicate of any of the other SDL_RenderDrawLine bugs. I have attached images showing what happens, enlarged for clarity, in 2.0.9 and 2.0.10 on Windows and in 2.0.10 on MacOS.