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.
So I'm digging in. The OpenGL stuff is in its infancy - an untamed frontier - virgin territory. Exciting but daunting. Also, I've never used scons before, and I've only dipped my toes in OpenGL and JavaScript. If it wasn't for help from Jeff Ward, my new hero, I don't know if I'd even have been able to get the Tumbler demo working.
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:
nacl_env.Append(LIBS=['ppapi_gles2'])
- Run Chrome 13 with command line parameter '--enable-accelerated-plugins'
Voila. Rotating cube. The gateway has been opened.
Great man. A new era begins here...
Posted by: turker | August 14, 2011 at 02:01 PM
Thanks for this excellent post, it really helped me to move the Ogre's port to NaCl, you did open the gateway for 3d rendering using NaCl.
You can read more about the work I did here.
You can also seem a webpage with the NaCl cube sample that you wrote about in this post here.
Thanks, keep up the good work!
Posted by: AssafRaman | August 21, 2011 at 05:12 AM