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

Method update

examples/shader/Shader.cpp:119–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117{
118public:
119 void update(float time, float x, float y) override
120 {
121 const float radius = 200 + std::cos(time) * 150;
122
123 m_shader.setUniform("storm_position", sf::Vector2f(x * 800, y * 600));
124 m_shader.setUniform("storm_inner_radius", radius / 3);
125 m_shader.setUniform("storm_total_radius", radius);
126 m_shader.setUniform("blink_alpha", 0.5f + std::cos(time * 3) * 0.25f);
127 }
128
129 void draw(sf::RenderTarget& target, sf::RenderStates states) const override
130 {

Callers

nothing calls this directly

Calls 1

setUniformMethod · 0.80

Tested by

no test coverage detected