MCPcopy Create free account
hub / github.com/axmolengine/axmol / updateUniforms

Function updateUniforms

tests/cpp-tests/Source/ShaderTest/ShaderTest2.cpp:66–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66static void updateUniforms(backend::ProgramState* programState)
67{
68 float time = Director::getInstance()->getTotalFrames() * Director::getInstance()->getAnimationInterval();
69 Vec4 uTime(time / 10.0f, time, time * 2.0f, time * 4.0f);
70 Vec4 sinTime(time / 8.0f, time / 4.0f, time / 2.0f, sinf(time));
71 Vec4 cosTime(time / 8.0f, time / 4.0f, time / 2.0f, cosf(time));
72
73 SET_UNIFORM(programState, "u_Time", uTime);
74 SET_UNIFORM(programState, "u_SinTime", sinTime);
75 SET_UNIFORM(programState, "u_CosTime", cosTime);
76}
77
78class Effect;
79class EffectSprite : public Sprite

Callers 3

drawMethod · 0.85
drawMethod · 0.85
setProgramStateMethod · 0.85

Calls 2

getInstanceFunction · 0.85
getTotalFramesMethod · 0.80

Tested by

no test coverage detected