Skip to content

Commit

Permalink
Done messing with lines for now...
Browse files Browse the repository at this point in the history
I could spend a month or two researching, implementing, testing,
benchmarking, all the ways to raster lines both aliased and not, trying
for maximum GL spec correctness, maximum geometric/mathematical
correctness (not always the same thing as the former), maximum
performance with minimum code size/complexity...

But I only have so much patience at a time so for now, the only
official changes are:

Support width 1 GL_LINE_SMOOTH aka AA lines.  No other width because
my arbitrary width algorithm attempts all fall short.

Change the default line algorithm back to be the more spec compliant
faster version and make the more accurate version the opt-in configuration

Using the former for even for width 1, rather than using a separate faster
function.  It's about 10% slower.
  • Loading branch information
rswinkle committed Jun 1, 2024
1 parent 2c029a8 commit 886236c
Show file tree
Hide file tree
Showing 18 changed files with 992 additions and 1,242 deletions.
1 change: 1 addition & 0 deletions glcommon/crsw_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -1534,6 +1534,7 @@ inline Line make_Line(float x1, float y1, float x2, float y2)

inline void normalize_line(Line* line)
{
// TODO could enforce that n always points toward +y or +x...should I?
vec2 n = { line->A, line->B };
float len = length_vec2(n);
line->A /= len;
Expand Down
Loading

0 comments on commit 886236c

Please sign in to comment.