Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to run C++ binded with SDL+OpenGL code on a web browser?

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.

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.

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?

like image 506
Karl Avatar asked Jan 23 '23 06:01

Karl


2 Answers

Your only stable bet to display C++ in the browser is to make the user download an plug-in.

Otherwise you could look at a Javascript solution instead, maybe O3D could be what you're looking for?

like image 59
Silfverstrom Avatar answered Jan 30 '23 00:01

Silfverstrom


A Java applet may also be an option. Might be easier to convert your code to Java, since it has similar syntax to C++, and the Java3D API may prove very useful. Apparently it's quite easy to use, although I haven't worked with it myself. The Java3D.org website is a good place to start.

Most people have Java and Flash already installed, so both are fairly safe.

like image 42
Samuel Jaeschke Avatar answered Jan 30 '23 00:01

Samuel Jaeschke