How to obtain a 3D context for Google Native Client
Ever since Chromium/Native Client have switched to using PPAPI 2, obtaining a 3D context is broken. I can link and compile my applicati开发者_开发知识库on (which uses OpenGL ES 2 extensively), everything works ... except obtaining a 3D context to draw on. My problems are exactly the same as in this ML post. This problem exists at least with NaCl SDK 2, and 3, both with chrome 11, and 12. Now I know because of the API changes, gl is simply not supported at the moment. However, I believe there are other projects actively working on 3D ports to NaCl (ex. Unity), and I assume they have some kludge to obtain the context. Of course it is also possible that they are developing with an old version of Chrome/NaCl, or that they have put development on hold until the API catches up.
Basically, my question is, is there any kludge I can use to obtain the 3D context to use with opengl es 2?
You're right, when NaCL moved to pepper it broke (and put into Dev) the 3D API. However with newer versions of the SDK (those targeting Chrome / PPAPI 16 and up) this is working again.
More recent versions of the NaclSDK's have a simple 3D sample called Tumbler, which has a class OpenGLContext, which shows how to get your 3D context working in newer versions of Native Client.
精彩评论