Building Qt native application for web
-
I have an existing 3D game developed in C++ using the Qt framework, and I am wondering if it's possible (or how to) run it inside a browser. QtWebKit appears to be more for running web browser in my game, but I'm wondering if it's possible to do something like render my game scene to a web view using QtWebKit? I found "this":http://qt-project.org/forums/viewthread/2202 thread which I think is asking a similar question, but I'm not clear as to what the solution was (aside from what sounds like remaking the application with Wt).
Note: I am not the originally developer of the game and am new to Qt, in case my question seems ignorant : )
-
There is no such thing as native applications for the web, you might be able to run C++ code in some browsers on some platforms but that's about it. If you use Flash or Unity you can export a 3D game that utilizes Adobe's Stage 3D, but that will either use interpreted JS, C# or ActionScript, which is far from native.
You want web applications you pretty much have to go for JavaScript, there are a number of engines that use WebGL and can run games in browsers, but performance is generally very poor.
Native means compiled to platform native binary code, so you need a different binary for every different platform. Web applications go in the opposite direction, the same source code relies on the platform's own implementation of HTML/JS to make the same binary/source run across different platforms.
Also, you might want to consider Java, which can run applets in browsers. But again, it is not native, it is the platform specific Java runtime that enables the same bytecode to execute on different platforms. Naturally, you need to have a working Java runtime, which is not available for all platforms.
-
Thank you for the reply, that was very useful information. I was afraid I might have to make it in Javascript, but I'll be researching my options. Thanks again!
-
Of course the context of "native" can vary, and I suppose it can be used in the context of "web native" which pretty much implies HTML5+JavaScript - technologies that are native to what the web is running. Native to the web not to the platform as would be native binary.
-
http://www.webtoolkit.eu/wt for a web framework similar to Qt
-
This is interesting. One thing that bothers me is performance, the website says "High performance, complex web applications" but in the examples I was really surprised by the low performance of the one somewhat demanding example - the paintbrush, much lower than much heavier implementations in JS or AS. Also hardly useful for a 3D game, I didn't notice a 3D API in there.