Hi all,
I have been trying to port Ogre3D to NaCl, and after some effort, I've successfully compiled and linked the behemoth. Ogre has an OpenGL ES 2 renderer in the trunk, and I've compiled and linked that as well. However, while Ogre seems to be doing *something* I can't really see anything, because I am clueless of how to obtain an opengl context.
I've been trying every method I can find in the few examples on the web, and they all fail. Here are the details of what I tried:
I am using NaCl SDK 0.2, for windows (cygwin). First tried on Chrome 10.x, now upgraded to Chrome "11.0.696.60 unknown", Win7 64 bit.
GetBrowserInterface(PPB_OPENGLES2_DEV_INTERFACE), works.
Subsequent call to glGetCurrentContextPPAPI() returns NULL (possibly supposed to, dunno).
Module::GetBrowserInterface(PPB_GRAPHICS_3D_DEV_INTERFACE) fails
GetBrowserInterface(PPB_CONTEXT_3D_DEV_INTERFACE) works
GetBrowserInterface(PPB_SURFACE_3D_DEV_INTERFACE) works
GetBrowserInterface(PPB_INSTANCE_INTERFACE) works
The C equivalents to the above fail the same way:
Module::get_browser_interface()(PPB_GRAPHICS_3D_DEV_INTERFACE) fails
Module::get_browser_interface()(PPB_CONTEXT_3D_DEV_INTERFACE) works
Module::get_browser_interface()(PPB_SURFACE_3D_DEV_INTERFACE) works
Module::get_browser_interface()(PPB_INSTANCE_INTERFACE) works
To get around PPB_GRAPHICS_3D_DEV_INTERFACE failing, I tried using the C++ static function:
pp::Graphics3D_Dev::GetConfigs() fails with PP_ERROR_NOINTERFACE
Tried doing it the C++ way:
pp::Context3D_Dev, fails (always has a null resource)
pp::Surface3D_Dev, fails (always has a null resource)
Using the C counterparts of the above two, fail in the same, Also:
pp::Graphics3D_Dev::GetConfigs(), fails
I've tried with the "dimensions" attribute set to both 2 and 3, in some ad hoc cases; failed
I've combed through the header files that come with the SDK but haven't found any other ways to get at the context.
Can the EGL headers help me any?
Is it possible to obtain the context in JS, and pass it in?
Any other way possible? Secret function signatures? :D. Or is it Just Not Possible until the next version of the SDK ...
I got a whole lib working, and all I need is a tiny little context :D.
--
AYF