So one thing that makes Nim so great is the ability to bind to C easily.
While a pure Nim runtime would be nice, all I've managed to get done in the past two days is a JSON parser for the JSON file format (I tried to just deserialize the JSON into a Nim struct, but the JSON is too variable for this - I.E. some fields potentially hold scalar OR non-scalar values) and a atlas parser.
So I just decided to continue playing with my bindings to the C runtime for now.
I was following the C SFML example and then I realized that no index data is being used there - so I switched to translating the Coscos2dx runtime examples.
I've hit a snag though - I don't think my vertex / index data is lining up properly :
Loading Image
Is there any magic to iterating over these arrays when dealing with mesh attachments. I think I'm doing exactly what is being done in the coscos2dx example, but I have no idea what their sprite batch does internally.
Mine is just submitting the index data and vertex data I'm providing it. I'll RTFM but I'm not sure if I'm going to find my solution there.
Thanks,
-Zach
Edit -
Getting slightly closer :
Loading Image
Seem to be not submitting all the vertex data... Here's my code:
https://gist.github.com/zacharycarter/8a80dd9c6757b3cf50e4f14533eaca7a
Indices... It's always indices...
I'm good to go now!
Loading Image
Is there any interest in these bindings becoming a public thing? I have this repo set up - https://github.com/fragworks/frag-spine - where I plan on hosting the spine module for my engine.
I could potentially publish the bindings somewhere else until I have time to create a full spine Nim runtime.