Search code examples
cwebglgoogle-nativeclient

C: NaCl how to create 'PPB_Graphics3D


In Native Client, how do I create a proper instance of PPB_Graphics3D in C (not C++)??

I've looked at the 'Tumbler' native client demo, but it's in C++ and seems to be calling a static method for the creation of the object... but how do I create the PPB_Graphics3D in C?

The Google doc here shows it's using an instance of PPB_Graphics3D like so:

g3d->Create(instance, attribs, &context);

But not how to actually create it.


Solution

  • int32_t PPP_InitializeModule(
        PP_Module module,
        PPB_GetInterface get_browser_interface) {
      PPB_Graphics3D *g3d =
          get_browser_interface(PBB_GRAPHICS_3D_INTERFACE);
    }