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

Method LayerRadialGradient

core/2d/Layer.cpp:376–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

374}
375
376LayerRadialGradient::LayerRadialGradient()
377{
378 auto& pipelinePS = _customCommand.getPipelineDescriptor().programState;
379 auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::LAYER_RADIA_GRADIENT);
380 //!!! LayerRadialGradient private programState don't want affect by Node::_programState, so store at _customCommand
381 pipelinePS = new backend::ProgramState(program);
382 _mvpMatrixLocation = pipelinePS->getUniformLocation("u_MVPMatrix");
383 _startColorLocation = pipelinePS->getUniformLocation("u_startColor");
384 _endColorLocation = pipelinePS->getUniformLocation("u_endColor");
385 _centerLocation = pipelinePS->getUniformLocation("u_center");
386 _radiusLocation = pipelinePS->getUniformLocation("u_radius");
387 _expandLocation = pipelinePS->getUniformLocation("u_expand");
388
389 _customCommand.createVertexBuffer(sizeof(_vertices[0]), sizeof(_vertices) / sizeof(_vertices[0]),
390 CustomCommand::BufferUsage::STATIC);
391 _customCommand.setDrawType(CustomCommand::DrawType::ARRAY);
392 _customCommand.setPrimitiveType(CustomCommand::PrimitiveType::TRIANGLE_STRIP);
393}
394
395LayerRadialGradient::~LayerRadialGradient()
396{

Callers

nothing calls this directly

Calls 2

createVertexBufferMethod · 0.80
getUniformLocationMethod · 0.45

Tested by

no test coverage detected