Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NaCl OpenGL example

Now that nacl is about to be on by default in chrome I'd like to try writing an opengl game. It seems that this is possible because there is a working quake port, but I can't find any documentation about this. Does anyone have a minimal example?

Bonus question: can I do any kind of networking from nacl? E.g. web sockets?

like image 937
Timmmm Avatar asked Aug 15 '11 22:08

Timmmm


3 Answers

I was trying to find the answer for this one a few days ago.

Here is a working NaCl OpenGL cube webpage

Here is the code for the sample you can compile "out of the box" like the other NaCl SDK samples:

BTW: I renamed the .nexe files to .n - to stop an annoying Chrome warning about the files.

like image 177
Assaf Raman Avatar answered Oct 16 '22 18:10

Assaf Raman


So far, it appears that NaCL (http://code.google.com/chrome/nativeclient/) doesn't allow you to do peer-to-peer networking, but by looking at the API you can start with this, which will enable you to work with URLS, and get a response:

http://code.google.com/chrome/nativeclient/docs/reference/pepperc/struct_p_p_b___u_r_l_loader.html

For 3D example you can look at the code here, which will at least show you what functions that were used.

http://src.chromium.org/viewvc/chrome/trunk/src/ppapi/examples/gles2/

like image 3
James Black Avatar answered Oct 16 '22 18:10

James Black


Here is an example of Ogre3D sample browser:

https://chrome.google.com/webstore/detail/ocpoapiejnpokdojkgjhglijajghikla

like image 1
Raman Sharma Avatar answered Oct 16 '22 18:10

Raman Sharma