jlongster
unread,Nov 1, 2012, 1:49:36 PM11/1/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to emscripte...@googlegroups.com
Hey guys,
I'm researching emscripten and writing up a few test apps to get to know it (and do a little benchmarking too). Currently I'm trying to write a simple Canvas wrapper so that I can access the 2d API via C.
I have `drawRect` and other functions working, they are easy. I need the function `drawImage` though, which takes an "image" argument, which is a javascript object. How can I work with a javascript object in C?
The API I'm thinking is (it's dumb and simple):
Img* getImage(char *name);
void drawImg(Img *img, int x, int y);
The problem is telling the C compiler about the Img object. I don't think making a struct is the right way to go, because emscripten will allocate it in its own heap, but I need a normal javascript object.
- James