mirror of
https://github.com/love2d/love.git
synced 2026-08-16 16:20:42 +02:00
Issue #659: Add line joins.
Added: love.graphics.setLineJoin(linejoin) linejoin = love.graphics.getLineJoin() where linjoin is one of: - none - miter - bevel Bevel and miter drawing is slightly faster than the 0.8 default (miter), while the `none` join mode will be slower when overdraw is enabled.
This commit is contained in:
@@ -69,6 +69,7 @@ struct DisplayState
|
||||
|
||||
// Line.
|
||||
Graphics::LineStyle lineStyle;
|
||||
Graphics::LineJoin lineJoin;
|
||||
|
||||
// Point.
|
||||
float pointSize;
|
||||
@@ -88,6 +89,7 @@ struct DisplayState
|
||||
backgroundColor.set(0, 0, 0, 255);
|
||||
blendMode = Graphics::BLEND_ALPHA;
|
||||
lineStyle = Graphics::LINE_SMOOTH;
|
||||
lineJoin = Graphics::LINE_JOIN_MITER;
|
||||
pointSize = 1.0f;
|
||||
pointStyle = Graphics::POINT_SMOOTH;
|
||||
scissor = false;
|
||||
@@ -299,6 +301,12 @@ public:
|
||||
**/
|
||||
void setLineStyle(LineStyle style);
|
||||
|
||||
/**
|
||||
* Sets the line style.
|
||||
* @param style LINE_ROUGH or LINE_SMOOTH.
|
||||
**/
|
||||
void setLineJoin(LineJoin style);
|
||||
|
||||
/**
|
||||
* Gets the line width.
|
||||
**/
|
||||
@@ -309,6 +317,11 @@ public:
|
||||
**/
|
||||
LineStyle getLineStyle() const;
|
||||
|
||||
/**
|
||||
* Gets the line style.
|
||||
**/
|
||||
LineJoin getLineJoin() const;
|
||||
|
||||
/**
|
||||
* Sets the size of points.
|
||||
**/
|
||||
@@ -455,6 +468,7 @@ private:
|
||||
|
||||
std::vector<double> pixel_size_stack; // stores current size of a pixel (needed for line drawing)
|
||||
LineStyle lineStyle;
|
||||
LineJoin lineJoin;
|
||||
float lineWidth;
|
||||
GLint matrixLimit;
|
||||
GLint userMatrices;
|
||||
|
||||
Reference in New Issue
Block a user