Open intmainreturn00 opened 7 years ago
and then if I specify concrete overloading function version by cast to Texture2D* or GLuint the code fails at assertion at CCNode
Here
TrianglesCommand::Triangles trs{&_vertices[0], &_indices[0], static_cast<ssize_t>(_vertices.size()), static_cast<ssize_t>(_indices.size())}; _triangleCommand.init(getGlobalZOrder(), nullptr, getGLProgramState(), cocos2d::BlendFunc::ALPHA_PREMULTIPLIED, trs, transform, 0); renderer->addCommand(&_triangleCommand);
when I touch screen I get _vertices and _indices size = 0 and so I've got vector out of bounds exception.
Well...I can rewrite the initialization list to this:
TrianglesCommand::Triangles trs; trs.indexCount = static_cast<ssize_t>(_indices.size()); trs.indexCount = static_cast<ssize_t>(_vertices.size()); trs.verts = _vertices.data(); trs.indices = _indices.data();
You see your version probably incorrect, since it use _vertices[0] form and can lead to exception at vector with 0 elements. But even after that I've get crashed.
Ok, I leave the TriangleCommand and rewrite this code with my custom DrawNode::drawTriangle call. now I can test it)
aghhh. and now I see, that your algorithm is pretty much like my own, it has the same limitation with drawing non-opacity colors =(
and anti-aliasing is too small... =(
Can we varray the level of anti-aliasing? set the width of the line's feathers?
Hello, I'm currently doing something simillar
Interesting project, but I can't compile it with cocos2dx 3-13.