Seems like everyone's talking about Chrome's Native Client these days. It is pretty exciting stuff, in my opinion - C++ has been my go-to language for fifteen years, and now I can make it do stuff in your browser? Cool. I could take those old prototypes I've written and make them more easily available? Cool.
But I did, so let me tell you how I did it. Of course, this may become obsolete tomorrow. But there it is.
- I did the NaCl getting started tutorial. The only thing they didn't mention is I had to put Python in my path after installing it.
- I got the Native Client code branch, which includes experimental\tumbler. Yeah, there's a big ol' deprecated there, which means all of this may become irrelevant, I guess.
- I created a Tumbler project in the native_client_sdk_0_4_907\examples folder, the same way as their hello_tutorial.
- I copied the experimental\tumbler files over my new Tumbler project.
- I discovered their includes have pretty full path names, so I had to go through the #includes and take the experimental\tumbler\ prefixes out. I don't know why they did it that way. I assume since they're Google they're Really Smart and have their reasons; I just don't know what they are.
- I added all the .cc files to the sources in build.scons
sources = ['tumbler.cc','tumbler_module.cc','cube.cc','opengl_context.cc' ... etc.
- Added the gles2 library to the build, after the sources:
- Run Chrome 13 with command line parameter '--enable-accelerated-plugins'
Voila. Rotating cube. The gateway has been opened.