MCPcopy Create free account
hub / github.com/SFML/SFML / onUpdate

Method onUpdate

examples/sound_effects/SoundEffects.cpp:382–389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

380 }
381
382 void onUpdate(float /*time*/, float x, float y) override
383 {
384 m_amplitude = std::clamp(0.2f * (1.f - y), 0.f, 0.2f);
385 m_frequency = std::clamp(500.f * x, 0.f, 500.f);
386
387 m_currentAmplitude.setString("Amplitude: " + std::to_string(m_amplitude));
388 m_currentFrequency.setString("Frequency: " + std::to_string(m_frequency) + " Hz");
389 }
390
391 void onDraw(sf::RenderTarget& target, sf::RenderStates states) const override
392 {

Callers

nothing calls this directly

Calls 1

setStringMethod · 0.45

Tested by

no test coverage detected