Skip to content

Commit cde8acc

Browse files
committed
Drawing2dText: Cosmetics
1 parent 375e013 commit cde8acc

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

sketches/Drawing2dText/src/Sketch.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ void Sketch::setup()
2121
font2->setSize(40);
2222
font2->setColor(0.75f, 0, 0, 1);
2323

24-
strokeBatch
24+
lineBatch
2525
.setPrimitive(GL_LINES)
2626
.setShader(colorShader)
2727
.setShaderColor(0, 0, 0, 0.25f);
@@ -37,7 +37,7 @@ void Sketch::setup()
3737

3838
void Sketch::resize()
3939
{
40-
strokeBatch.clear();
40+
lineBatch.clear();
4141
drawGuides();
4242
drawCircle(windowInfo.center(), RADIUS);
4343

@@ -64,7 +64,7 @@ void Sketch::draw()
6464

6565
// ---
6666

67-
strokeBatch.flush();
67+
lineBatch.flush();
6868

6969
font1->replaySequence(sequence1);
7070

@@ -76,10 +76,10 @@ void Sketch::draw()
7676

7777
void Sketch::drawGuides()
7878
{
79-
strokeBatch.addVertices(glm::vec2(PADDING, 0), glm::vec2(PADDING, windowInfo.height));
80-
strokeBatch.addVertices(glm::vec2(windowInfo.width - PADDING, 0), glm::vec2(windowInfo.width - PADDING, windowInfo.height));
81-
strokeBatch.addVertices(glm::vec2(0, PADDING), glm::vec2(windowInfo.width, PADDING));
82-
strokeBatch.addVertices(glm::vec2(0, windowInfo.height - PADDING), glm::vec2(windowInfo.width, windowInfo.height - PADDING));
79+
lineBatch.addVertices(glm::vec2(PADDING, 0), glm::vec2(PADDING, windowInfo.height));
80+
lineBatch.addVertices(glm::vec2(windowInfo.width - PADDING, 0), glm::vec2(windowInfo.width - PADDING, windowInfo.height));
81+
lineBatch.addVertices(glm::vec2(0, PADDING), glm::vec2(windowInfo.width, PADDING));
82+
lineBatch.addVertices(glm::vec2(0, windowInfo.height - PADDING), glm::vec2(windowInfo.width, windowInfo.height - PADDING));
8383
}
8484

8585
void Sketch::drawCircle(const glm::vec2 &position, float radius)
@@ -96,7 +96,7 @@ void Sketch::drawCircle(const glm::vec2 &position, float radius)
9696

9797
for (int i = 0; i < n - 1; i++)
9898
{
99-
strokeBatch.addVertices(points[i], points[i + 1]);
99+
lineBatch.addVertices(points[i], points[i + 1]);
100100
}
101101
}
102102

sketches/Drawing2dText/src/Sketch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Sketch : public chr::CrossSketch
1515
void draw() final;
1616

1717
protected:
18-
chr::gl::VertexBatch<chr::gl::XYZ> strokeBatch;
18+
chr::gl::VertexBatch<chr::gl::XYZ> lineBatch;
1919
chr::gl::shaders::ColorShader colorShader;
2020

2121
chr::xf::FontManager fontManager;

0 commit comments

Comments
 (0)