vegard

Hi,

On this page you have an example of how to implement drawSkeleton():

Spine-cpp Runtime Documentation: Implementing Rendering

I just wanted to point out a few changes I had to make to get it to work:

1) regionAttachment->computerWorldVertices() should say "compute" instead of "computer"

2) Calling computeWorldVertices() needs to take &vertices->buffer().x instead of vertices.buffer()

3) vertex.u/v assignments need to use ->getUVs()[...] instead of ->getUVs[...]

4) Inside the mesh attachment handling block there are a number of references to "regionAttachment" (which does not exist for mesh attachments, the corresponding variables is called "mesh" as far as I can tell)

5) Most &s in the code (C++ reference types) show up as & on the website (this also appears to extend beyond the drawSkeleton() example)

Thanks,


Vegard

---

Two more:

6) MeshAttachment does not seem to have ->computeWorldVertices(), but it's true I'm using the spine-cpp beta, so maybe something changed in the API there.

7) Indentation with 3 spaces, are you crazy!? :p

---

8 ) On the same page you have a code example for a texture loader:
class MyTextureLoader: public TextureLoader {
public:
TextureLoader() { }

virtual ~TextureLoader() { }

// Called when the atlas loads the texture of a page.
virtual void load(AtlasPage& page, const String& path) {
Texture* texture = engine_loadTexture(path);

// if texture loading failed, we simply return.
if (!texture) return;

// store the Texture on the rendererObject so we can
// retrieve it later for rendering.
page->setRendererObject(texture);
since "page" is a reference I suppose you should use .setRenderObject and not ->setRenderObject
vegard
  • Сообщения: 6

badlogic

Woah, that is amazing! Thank you so much for this feedback, and sorry for the errors. I've created an internal issue for updating the docs. Thanks!
Аватара пользователя
badlogic

Mario
  • Сообщения: 2108


Вернуться в Bugs