MCPcopy Create free account
hub / github.com/VitalAudio/visage / draw

Method draw

examples/Showcase/examples_frame.cpp:77–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75 }
76
77 void draw(visage::Canvas& canvas) override {
78 double render_time = canvas.time();
79 for (int r = 0; r < kNumLines; ++r) {
80 float position = 0.0f;
81 for (int i = 0; i < kNumPoints; ++i) {
82 float t = i / (kNumPoints - 1.0f);
83 float delta = std::min(t, 1.0f - t);
84 position += 0.1f * delta * delta + 0.003f;
85 double phase = (render_time + r) * 0.5;
86 float y = sin1(phase + position) * 0.4f + 0.5f;
87 graph_lines_[r]->set(i, y);
88 }
89 }
90
91 redraw();
92 }
93
94private:
95 std::unique_ptr<visage::GraphLine> graph_lines_[kNumLines];

Callers

nothing calls this directly

Calls 3

sin1Function · 0.85
timeMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected