I am making a small OpenGL wrapper for iPhone. Everything was going fine until I reached a point where I had to make a wrapper for glReadPixels. Now my questions are as follows:
- Is there a way of passing a javascript Array (or an equivalent structure) to a module method and then fill it with data within the module? I essentially want to modify the array passed to glReadPixels inside the module.
- What I have done right now is that my glReadPixels module function returns a TiBlob type data using: [[TiBlob alloc] initWithData: retData mimetype:@"application/octet-stream"] Now my question is, how on earth do I get the data back in Javascript? Printing the returned object says [object TiBlob]. When try accessing the .data property it crashes. The .text property returns undefined. The .image property returns undefined. The mimetype and size property are coming across fine but nothing else seems to work. I need a way to get that data back in javascript.
- The documentation at page: https://wiki.appcelerator.org/display/guides/iOS+Module+Development+Guide suggests that NSArray can be returned directly from the module. However, my application crashes when I try returning a NSArray*.
Note that I have a slightly more complicated setup because iOS OpenGL functions cannot be called from a separate thread so all my proxy functions essentially call view functions in a blocking fashion. I don't know whether this is complicating something.
I'd appreciate any help.
Thanks you.
Your Answer
Think you can help? Login to answer this question!