Addon Question: Access to native Codea objects?

I’m looking into porting my SpriteBatch class to be a native Codea Addon, in hopes that it will deliver huge performance increases with batched sprite rendering. Right now using SpriteBatch implemented in Lua, I can get 250-300 batched sprites on screen before FPS dips below 60 on my iPad 4th gen. This is just a theory so far since I have no actual evidence to back it up yet, but my theory is that I’m running into a performance wall due to SpriteBatch:sprite() being implemented in Lua (it does a ton of stuff, like manipulate the view matrix, setting verts/vert colors/uv coordinates, etc), and I’m thinking that using Obj-C to do this heavy lifting might net performance gains of 100%-1000% or more (i.e., a performance increase big enough to draw somewhere between 500-5000 batched sprites (or more) before FPS starts to dip below 60).

In order for this to work, I need access to Codea’s mesh object natively (in Obj-C), since the SpriteBatch class uses a mesh to do it’s dirty work; however when I exported my project using the new export feature, I noticed that the Codea runtime’s headers and sources are not included in the exported project, just the compiled static library.

Is there any way I can gain access to the native mesh object in Obj-C so that I can access it in my SpriteBatch addon class? Or, would it be possible to do this without direct native access, using the Lua C runtime to gain access to the mesh() object via Lua?

EDIT: nevermind, it looks like the Codea runtime doesn’t provide a C API for any of it’s internal objects (only a Lua API), so without access to the functionality to mess with a mesh’s buffers directly, most of this is impossible (or at least, any workarounds would potentially negate the performance increase, so it’s not worth doing at this point :confused: )

You can probably look at the old available source for the old runtime. I hope TTL will release the source for the runtime, so it’s a bit easier to create Codea Addons. In my example (at https://gist.github.com/tnlogy/5371725) I’ve declared some internal functions of the runtime, such as createUIImageFromImage, that I needed. But it’s quite hard when the runtime is a black box. :slight_smile:

So, the only thing available for now is the old runtime code at github https://github.com/TwoLivesLeft/Codea-Runtime