是否可以在网络浏览器上运行与SDL + OpenGL代码绑定的C ++? [英] Is it possible to run C++ binded with SDL+OpenGL code on a web browser?

查看:119
本文介绍了是否可以在网络浏览器上运行与SDL + OpenGL代码绑定的C ++?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的客户希望她的网站上有一个可以渲染3D的应用程序(浅色3D材质,我们只在3D世界中绘制平面正方形),但是网络编程不是我的事.因此,我正在寻找可以从网络浏览器运行C ++程序的工具.但是我认为,如果是这种情况,那么客户端必须首先下载该程序,而这不是我想要的.客户只能在网站上使用此应用程序.

My client wants her website to have an application that renders 3D (light 3D stuff, we are drawing only flat squares in 3D world) but web programming is not my thing. So I am looking for something that can run a C++ program from a web browser. But I think, if this is the case, then the client side must download the program first, and that's not what I want. The client should only be able to use this application only on the website.

我遇到了Google Native Client,它声称它可以在Web应用程序中运行x86本机代码.我还没有决定是否值得,也不知道这是否是我想要的,所以我决定向有经验的人问这个.

I came across Google Native Client, which claims that it can run x86 native code in web applications. I haven't decide whether it is worth it or not and I don't know whether this is what I want or not, so I decided to ask experienced people about this.

如果我想要这样的东西,我上面所说的可能吗?还是我完全需要其他语言(如Flex),因为这样做不值得麻烦吗?还是Google Native Client适合做这样的事情?

If I want to have something like this, is what I said above possible? Or I completely need other languages like Flex because it does not worth the trouble? Or is Google Native Client suitable for doing something like this?

推荐答案

否,NativeClient不是您想要的.它不会让您运行SDL + OpenGL-它可能是C ++代码,但它在沙箱中运行.

No, NativeClient is not what you want. It won't let you run SDL+OpenGL -- it may be C++ code, but it's run inside a sandbox.

通常很难在浏览器中运行SDL. OpenGL少了一点,但这也不是小菜一碟.如果要使本机代码解决方案跨浏览器和平台运行,那么任何此类本机代码解决方案都将非常困难-您将不得不为多个平台(这两者都大不相同)以及ActiveX控件开发NPAPI插件.您正在看四个单独的项目.

Running SDL in a browser is difficult in general. OpenGL somewhat less so, but it's no cakewalk either. Any such native code solution is difficult if you want it to work across browsers and platforms -- you'll have to develop NPAPI plugins for multiple platforms (which will all be fairly different), as well as an ActiveX control. You are looking at four separate projects.

几乎可以肯定,这里的正确答案是以一种或另一种形式使用Flash.

Almost assuredly, the correct answer here is to use Flash in one form or another.

这篇关于是否可以在网络浏览器上运行与SDL + OpenGL代码绑定的C ++?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆