氯化钠 OpenGL 示例
现在 nacl 即将在 chrome 中默认打开,我想尝试编写一个 opengl 游戏。似乎这是可能的,因为有一个正在运行的地震端口,但我找不到任何有关此的文档。有人有一个最小的例子吗?
额外问题:我可以从 nacl 进行任何类型的网络连接吗?例如网络套接字?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
几天前我试图找到这个问题的答案。
这是一个工作NaCl OpenGL立方体网页
这是对于该示例的代码,您可以像其他 NaCl SDK 示例一样“开箱即用”进行编译:
顺便说一句:我将 .nexe 文件重命名为 .n - 以停止有关这些文件的恼人的 Chrome 警告。
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.
到目前为止,NaCL (http://code.google.com/chrome/nativeclient/) 不允许您进行点对点网络,但通过查看 API,您可以从此开始,这将使您能够使用 URLS 并获得响应:
http://code.google.com/chrome/nativeclient/docs/reference /pepperc/struct_p_p_b____u_r_l_loader.html
对于 3D 示例,您可以查看此处的代码,它至少会向您展示哪些函数被使用。
http://src.chromium.org/viewvc/chrome/主干/src/ppapi/examples/gles2/
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/
以下是 Ogre3D 示例浏览器的示例:
https://chrome.google.com/webstore/detail/ ocpoapiejnpokdojkgjhglijajghikla
Here is an example of Ogre3D sample browser:
https://chrome.google.com/webstore/detail/ocpoapiejnpokdojkgjhglijajghikla
正如 @sometimes-a-developer 提到的,Ogre3D 已经适合与 NaCl 一起使用。
唯一的问题是没有简单的方法来构建它。您可以在这里检查自己: http://www.ogre3d.org /forums/viewtopic.php?f=4&t=66394
我试图通过使 Ogre3D 成为 naclports 的一部分来解决这些问题:https://github.com/pkukielka/naclports-ogre3d
我还在研究如何将 ogre 与 NaCl 一起使用的基本示例:
https://github.com/pkukielka/ogre3d-nacl-template
移植完成并示例正在进行中(很快就会完成)。
有了这两件事,运行 2-3 个命令就足以让带有 NaCl 的 Ogre3D 启动并运行。
As @sometimes-a-developer mentioned Ogre3D was already adapted to be used with NaCl.
The only problem is that there is no easy way to build it. You can check yourself here: http://www.ogre3d.org/forums/viewtopic.php?f=4&t=66394
I'm trying to sort out that things by making Ogre3D part of naclports: https://github.com/pkukielka/naclports-ogre3d
I'm also working on basic example of how to use ogre with NaCl:
https://github.com/pkukielka/ogre3d-nacl-template
Port it finished and example is in progress (will be done soon).
With this 2 things it should be enough to run 2-3 commands to have Ogre3D with NaCl up and running.