| 136 | } |
| 137 | |
| 138 | void 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 | |
| 156 | void MotionStreak3D::setPosition(const Vec2& position) |
| 157 | { |
nothing calls this directly
no test coverage detected