Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To port NXEngine to Native Client, you'd need to port NXEngine itself (of course!) plus its dependencies. Let's consider each of them:</p> <ul> <li><strong>SDL</strong> has already been ported, but could use an update, as the port is a couple of versions behind. It resides in the <code>naclports</code> community repository at <a href="http://code.google.com/p/naclports/source/browse#svn%2Ftrunk%2Fsrc%2Flibraries%2FSDL-1.2.14" rel="nofollow noreferrer">http://code.google.com/p/naclports/source/browse#svn%2Ftrunk%2Fsrc%2Flibraries%2FSDL-1.2.14</a> (see my note about <code>naclports</code> below).</li> <li><strong>SDL_ttf</strong> would need to be ported including its dependencies, which as far as I can tell are just freetype</li> <li><strong>freetype</strong> has already been ported and resides in naclports at <a href="http://code.google.com/p/naclports/source/browse#svn%2Ftrunk%2Fsrc%2Flibraries%2Ffreetype-2.1.10" rel="nofollow noreferrer">http://code.google.com/p/naclports/source/browse#svn%2Ftrunk%2Fsrc%2Flibraries%2Ffreetype-2.1.10</a>.</li> </ul> <p>Porting to Native Client is very much like porting to a new - in many ways rather Linux-like - operating system. However, there are some important differences:</p> <ul> <li><p>The "operating system" API of Native Client is Pepper, or PPAPI, a set of APIs that provide access to the capabilities of the browser. The bulk of the porting work is typically to get your code to use the Pepper APIs for opening files, displaying graphics, playing sounds, etc. (SDL makes input, sound, and graphics a lot easier, though). To open files, people often use <code>nacl_mounts</code>, a library that wraps the Pepper File API, so that one can mount the HTML5 Web Storage of the app or URLs on the web as file systems and then use the familiar <code>fopen</code>, <code>fread</code>, etc. From Pepper 25, parts of <code>nacl_mounts</code> are included in the NaCl SDK.</p></li> <li><p>Native Client modules cannot use native operating system calls and do not have access to the host file system. This is for security reasons and to ensure portability.</p></li> <li><p>There is no non-experimental font API in Pepper currently. Hence all font rendering must be done in your code and any <code>.ttf</code> file must be supplied as part of the app, as the Native Client will not able to access <code>.ttf</code>. files on the host system for security reasons.</p></li> </ul> <p><strong>Chrome/Pepper 25 recommended:</strong> Historically, Pepper API calls could only be made from the main thread. This required significant refactoring of games and other multithreaded programs that were designed to, say, render on one thread and play music on another thread. From Chrome 25 and onwards this restriction no longer exists. For details see <a href="https://developers.google.com/native-client/dev/peppercpp/classpp_1_1_message_loop" rel="nofollow noreferrer">https://developers.google.com/native-client/dev/peppercpp/classpp_1_1_message_loop</a>. Targeting Chrome 25 or newer and thus using the Pepper 25 version of the NaCl SDK is likely to reduce the amount of refactoring work for this class of applications.</p> <p><strong>Running Native Client on a web page:</strong> The question mentions that one could <em>"visit the page and play the game within a browser"</em>. It is important to know that only Chrome supports Native Client at this time. There is also an important difference between current-generation Native Client, which requires that the web app be put in Chrome Web Store for Native Client to work, and the forthcoming Portable Native Client, which will allow Native Client content on any web page. To allow visitors on a web page to use a current-generation NaCl-based app with minimal detours, Chrome Web Store Inline Installation (see <a href="https://developers.google.com/chrome/web-store/docs/inline_installation" rel="nofollow noreferrer">https://developers.google.com/chrome/web-store/docs/inline_installation</a>) can obviate the need for users to go to the Chrome Web Store.</p> <p><strong>A note on <code>naclports</code>:</strong> <code>naclports</code> is a community-based repository for Native Client. It contains several libraries and previous ports. You can see the list of libraries in <code>naclports</code> at <a href="http://code.google.com/p/naclports/source/browse/trunk/src/libraries/" rel="nofollow noreferrer">http://code.google.com/p/naclports/source/browse/trunk/src/libraries/</a>. While it contains useful examples of how to do ports, <code>naclports</code> is not for the faint-hearted as it often breaks and - given that it's maintained on a volunteer/best-effort basis - may take time to get fixed.</p> <p><strong>Additional pointers:*</strong> There are some additional tips and pointers to guides in this answer: <a href="https://stackoverflow.com/questions/13920954/google-chrome-extension-using-nacl-with-an-external-library/13932232#13932232">Google Chrome Extension using NaCL with an external library</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload