I am writing a Spine runtime for SDL(willing to open-source if it works), and until now everything went smoothly (Using SFML Runtime as reference). However i'am having a hard time getting the correct UV coordinates... everything else is working.
I am pretty sure the problem is here, this is from the sfml-runtime:
texture = (Texture * )((AtlasRegion * )regionAttachment->rendererObject)->page->rendererObject;
auto size = texture.getSize();
vertices[0].texCoords.x = regionAttachment->uvs[VERTEX_X1] * size.x;
vertices[0].texCoords.y = regionAttachment->uvs[VERTEX_Y1] * size.y;
I am doing this:
texture = (GLTexture * )((AtlasRegion * )regionAttachment->rendererObject)->page->rendererObject;
auto size = {hardCodedSizeForTesting, hardCodedSizeForTesting};
vertices[0].setUv(regionAttachment->uvs[VERTEX_X1] * size.x, regionAttachment->uvs[VERTEX_Y1] * size.y);
The texture pointer here returns invalid, i cant see any special conversion in the sfml runtime. My texture class/struct needs a specific memory layout or something? Does the c runtime change the struct values?
Thank you!
Ok guys we got it.
Thanks anyway.