Using GLES2 with NaCl

134 views
Skip to first unread message

Azriel Fasten

unread,
May 3, 2011, 2:14:38 PM5/3/11
to native-cli...@googlegroups.com
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

David Springer

unread,
May 3, 2011, 3:03:55 PM5/3/11
to native-cli...@googlegroups.com
3D is not supported in NaCl yet.

--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To post to this group, send email to native-cli...@googlegroups.com.
To unsubscribe from this group, send email to native-client-di...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/native-client-discuss?hl=en.

Brad Chen

unread,
May 3, 2011, 4:03:21 PM5/3/11
to native-cli...@googlegroups.com
As David points out 3D is experimental and is not something we plan to support in the near term. Have a look at native_client/tests/ppapi_gles2_book for some examples of how a few GLES examples are built.

Please keep in mind 3D is experimental speciifically because we aren't prepared to support it yet. Don't expect us to answer questions promptly if at all.

Brad
Reply all
Reply to author
Forward
0 new messages