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

Method initCustomCommand

core/3d/MotionStreak3D.cpp:138–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138void MotionStreak3D::initCustomCommand()
139{
140 _customCommand.setDrawType(CustomCommand::DrawType::ARRAY);
141 _customCommand.setPrimitiveType(CustomCommand::PrimitiveType::TRIANGLE_STRIP);
142
143 auto& pipelineDescriptor = _customCommand.getPipelineDescriptor();
144
145 auto& blend = pipelineDescriptor.blendDescriptor;
146 blend.blendEnabled = true;
147 blend.sourceAlphaBlendFactor = blend.sourceRGBBlendFactor = _blendFunc.src;
148 blend.destinationAlphaBlendFactor = blend.destinationRGBBlendFactor = _blendFunc.dst;
149
150 _locMVP = _programState->getUniformLocation("u_MVPMatrix");
151 _locTexture = _programState->getUniformLocation("u_tex0");
152
153 _customCommand.createVertexBuffer(sizeof(VertexData), _vertexData.size(), CustomCommand::BufferUsage::DYNAMIC);
154}
155
156void MotionStreak3D::setPosition(const Vec2& position)
157{

Callers

nothing calls this directly

Calls 3

createVertexBufferMethod · 0.80
getUniformLocationMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected