Google's NaCL OpenGL demo uses the "Pure" OpenGLES function calls. However, I'd like to play around with the Pepper OpenGL interface.

The problem I'm having is that the Google demo initializes the PPB Graphic Interface from the browser calling

ppb_g3d_interface = (PPB_Graphics3D*)get_browser(PPB_GRAPHICS_3D_INTERFACE);

In my case, this seems to be returning an instance of PPB_Graphics3D_1_0 and not an OpenGLES interface. Is there anyway to set Chrome use the OpenGLES interface at launch or from within the NaCL code?

有帮助吗?

解决方案

The interface you're looking for is PPB_OpenGLES2. It can be found in $NACL_SDK_ROOT/include/ppapi/c/ppb_opengles2.h.

You can use it like this:

ppb_opengles_interface = (PPB_OpenGLES2*)get_browser(PPB_OPENGLES2_INTERFACE);

See the auto-generated documentation for it here:

https://developers.google.com/native-client/pepperc/struct_p_p_b___open_g_l_e_s2

The source for the "extension library" described in your link is also available in the SDK. You can look at the source for it in $NACL_SDK_ROOT/src/ppapi_gles2.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top