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

Method initProgram

tests/cpp-tests/Source/ShaderTest/ShaderTest.cpp:435–449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

433}
434
435void SpriteBlur::initProgram()
436{
437 auto program = ProgramManager::getInstance()->loadProgram(positionTextureColor_vert, "custom/example_Blur_fs", VertexLayoutType::Sprite);
438 auto programState = new backend::ProgramState(program);
439 setProgramState(programState);
440 AX_SAFE_RELEASE(programState);
441
442 auto size = getTexture()->getContentSizeInPixels();
443
444 SET_UNIFORM(_programState, "resolution", size);
445 SET_UNIFORM(_programState, "blurRadius", _blurRadius);
446 SET_UNIFORM(_programState, "sampleNum", 7.0f);
447 SET_UNIFORM(_programState, "u_PMatrix",
448 Director::getInstance()->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION));
449}
450
451void SpriteBlur::setBlurRadius(float radius)
452{

Callers

nothing calls this directly

Calls 4

getInstanceFunction · 0.85
setProgramStateFunction · 0.85
loadProgramMethod · 0.80
getTextureFunction · 0.50

Tested by

no test coverage detected