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

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

问题描述

我的客户希望她的网站有一个渲染 3D 的应用程序(轻的 3D 东西,我们在 3D 世界中只绘制平面方块),但网络编程不是我的事.所以我正在寻找可以从 Web 浏览器运行 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.

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

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