From C++ to Actionscript via FLASCC - c++

I'm hoping to get some feedback from anyone who is familiar with BOTH C++ AND Actionscript. I am not a C++ coder unfortunately.
I am developing Kinect applications using the AIRKinect framework. Unfortunately a limitation of this framework is the lack of any useful gesture dection algorithms.
I came across this gesture recognition library built in C++.
http://www.nickgillian.com/wiki/pmwiki.php?n=GRT.FAQ
There is also the Flash C+++ cross compiler(formerly known as Alchemy)
http://gaming.adobe.com/technologies/flascc/
I was wondering if it might be possible to convert this gesture recognition library into a swc(Flash format) so I can use it with AIRKinect?

It's Possible.
FlasCC uses a version of LLVM-GCC 4.2 with a custom LLVM backend that
generates ActionScript bytecode capable of running within the Flash
Runtime. More specifically, the bytecode runs in the ActionScript
virtual machine (AVM). This lets you compile arbitrary C/C++ code into
a managed bytecode format capable of high performance execution within
the Flash Runtime on Mac, Windows, or Linux
more information read a FlasCC doucmentation: FlasCC
If you want download FlasCC. rejoin this site(Adobe rebrand): https://creative.adobe.com/apps?trial=GAME&promoid=KBYQD
and click Download.
redirect to this site. download Flascc tools.

Related

Porting c++ code (native client) to browser (Web app)

I have a c++ module written using Qt-creator SDK. I want to port this code to run on any webpage without compromising the source-code to end user. User should be able to see the output of this module on any browser(Chrome, Firefox, Safari, Explorer) without having to install any additional browser plugin. What are the better options available to achieve this. I have googled and found few such options:
Google Native client (NaCl) - But it runs only on Chrome. Is this the future of web applications??
PPAPI - Not sure if it is same as NaCl
NPAPI - almost depricated
Emscripten - It converts c++ to js. So source-code is visible to user.
WebAssembly
Are there any other options to achievce waht I am looking for? If not which one I should pick from the above options!? Many thanks in advance. a
Some clarification:
NaCl will not be supported by browsers other than Chrome. We (Google's NaCl/WebAssembly team) are more focused on WebAssembly for the future.
PPAPI is the set of APIs used by NaCl.
NPAPI: on the way out, and needs a plugin installation anyway.
Emscripten. It does compile C++ to JS, but I would not say that it reveals your source code to the user. It has been significantly transformed through the usual compilation and optimization process, and I would say it's closer to machine code than source code. In addition we are adding WebAssembly support to emscripten, so that with the same source you can produce WebAssembly for those browsers that support it, and asm.js for those that don't yet.
WebAssembly is the future, and will meet all of your criteria, with the caveat that the browser APIs and capabilities available to wasm are the same as those available to JavaScript. So you won't be able to get unlimited access to the user's filesystem, for example. All 4 major browser vendors are implementing webassembly, but it should appear in Chrome and Firefox first, because the release schedules of those browsers are uncoupled from their respective operating systems.
My suggestion would be to try porting your code with emscripten. You can start that today and use asm.js, and when WebAssembly launches, you can target that with minimal extra effort. In the future there will be other toolchains and languages that support wasm, but today emscripten is really the only ready-to-go option.

Is it possible to use Native C++ code in ARC?

We want to try to launch our software on Chrome OS using ARC. Many parts of our software application are written in C++ and compiled using the Android NDK.
Is it possible to launch this kind of application under ARC?
Is it possible to launch Native applications(or Java + JNI) under ARC?
Yes, ARM compiled NDK libraries will run on all Chromebooks currently. For ARM machines they run more or less natively.
For non-ARM machines there is a binary translation layer that dynamically converts the code to run on the target machine. This layer may not be 100% machine compatible and if you see errors or crashes indicating instructions cannot be translated, or fundamental differences between your app on ARM and x86, you should file a bug: http://goo.gl/megdlG
I am currently using a library in my project called PDFtron. It contains ".so" files that I have to assume are either c or c++, and they work fine with Java + JNI. There doesn't seems to be a lot of information out there about how this all works(and what works or doesn't), so please post your findings.
From google spokesperson(taken from arstechnica):
"""The app code is all running on top of the Chrome platform, specifically inside of Native Client. In this way the ARC (App Runtime for Chrome) apps run in the same environment as other apps you can download from the Chrome Web Store, even though they are written on top of standard Android APIs. The developers do not need to port or modify their code, though they often choose to improve it to work well with the Chromebook form factor (keyboard, touchpad, optional touchscreen, etc)."""
In this quote I think the important part is the integration with native client, which is a technology for executing Native code like C and C++ in the browser.

iPad/iPhone app developement in C++ on Windows OS

What is the fastest way to port an finished game project written in C++ to iPad. Is there any good way to do it without buying a Mac?
Marmalade (formerly Airplay SDK) is a cross-platform SDK that is well-suited to games. You can write your code in Visual C++ and run it in Windows in a simulator. Using a PC, you will not be able to debug (stepping, breakpoints, etc) your game while running on an iPhone. Deploying to an iPhone for testing (from Windows) seems rather tedious, compared to how it's done with XCode.
If you need to use iOS native API features that are not supported in Marmalade, you can build wrappers to them with the EDK (Extension Development Kit), but you'll need a Mac with XCode to build the wrapper library once.
If you decide to get a Mac for development, the cheapest route is probably a Mac Mini and a KVM switch that will let you use your existing keyboard, monitor, and mouse. It's cheaper to upgrade the Mac Mini's memory yourself than to buy a Mac Mini with more memory pre-installed. You can order Mac memory upgrades from online computer retailers cheaper than from the Apple store.
See also:
Marmalade Mobile App Development - Is Marmalade a Good Choice?
Is Marmalade SDK more relevant or commonly used for Game Development?
Native Android/iOS development vs Marmalade SDK
ADDENDUM
I forgot to mention that iOS already has native support for OpenGL ES, and that XCode can compile C++ code. It's also possible to mix Objective-C with C++. So you can keep your C++ engine more or less intact, and write wrappers around iOS-specific facilities, such as detecting user touches.
I don't think you can. I do believe you have to have a mac! If you don't want to buy one, I suggest to just borrow it from a friend!

Can I use C/C++ code inside my ActionScript-3 code?

I wonder if there is ways for communicate actionscript with c/c++, as well as the level of complexity..
You're looking for Adobe Labs Alchemy:
Welcome the preview release of codename "Alchemy." Alchemy is a research project that allows users to compile C and C++ code that is targeted to run on the open source ActionScript Virtual Machine (AVM2). The purpose of this preview is to assess the level of community interest in reusing existing C and C++ libraries in Web applications that run on Adobe® Flash® Player and Adobe AIR®.

Can I do Android Programming in C++, C?

Can I do Android programming in C++, C? If the answer is "yes" then please tell how? And what's the procedure to set up?
I don't know Obj-C, Java, but well-versed in C, C++, Flash AS3, SDK released by Google.
Please do not tell about NVDIA SDK it's not fully developed :)
PLEASE NOTE: THE ANSWER BELOW IS HORRIBLY OUTDATED, AND MIGHT NOT BE ENTIRELY CORRECT ANYMORE.
You can program in C/C++ using the Android NDK. You'll have to wrap your c++ codebase in a static library and load that through a Java wrapper & JNI.
The standard NDK does not support RTTI and a lot of the functionality of standard c++ is also not available such as std::string, etc. To solve this you can recompile the NDK. Dmitry Moskalchuk supplies a modified version of the NDK that supports this at http://www.crystax.net/android/ndk-r3.php. This modified version works on all Android phones that run on an ARM processor.
Depending on the kind of application you should decide to use Java or C/C++. I'd use C/C++ for anything that requires above average computational power and games -- Java for the rest.
Just pick one language and write the majority of your application in that language; JNI calls can decrease your performance by a lot. Java isn't that hard though -- if you know how to program in C/C++. The advantage of Java is that the application can run on any device running Android, where as NDK applications depend on the architecture it was compiled for.
You should use Android NDK to develop performance-critical portions of your apps in native code. See Android NDK.
Anyway i don't think it is the right way to develop an entire application.
Yes, you can program Android apps in C++ (for the most part), using the Native Development Kit (NDK), although Java is the primary/preferred language for programming Android, and your C++ code will likely have to interface with Java components, and you'll likely need to read and understand the documentation for Java components, as well. Therefore, I'd advise you to use Java unless you have some existing C++ code base that you need to port and that isn't practical to rewrite in Java.
Java is very similar to C++, I don't think you will have any problems picking it up... going from C++ to Java is incredibly easy; going from Java to C++ is a little more difficult, though not terrible. Java for C++ Programmers does a pretty good job at explaining the differences. Writing your Android code in Java will be more idiomatic and will also make the development process easier for you (as the tooling for the Java Android SDK is significantly better than the corresponding NDK tooling)
In terms of setup, Google provides the Android Studio IDE for both Java and C++ Android development (with Gradle as the build system), but you are free to use whatever IDE or build system you want so long as, under the hood, you are using the Android SDK / NDK to produce the final outputs.
You should look at MoSync too, MoSync gives you standard C/C++, easy-to-use well-documented APIs, and a full-featured Eclipse-based IDE. Its now a open sourced IDE still pretty cool but not maintained anymore.
You can take a look also at C++ Builder XE6, and XE7 supports android in c++ code, and with Firemonkey library.
http://www.embarcadero.com/products/cbuilder
Pretty easy way to start, and native code. But the binaries have a big size.
You can use the Android NDK, but answers should note that the Android NDK app is not free to use and there's no clear open source route to programming Android on Android in an increasingly Android-driven market that began as open source, with Android developer support or the extensiveness of the NDK app, meaning you're looking at abandoning Android as any kind of first steps programming platform without payments.
Note: I consider subscription requests as payments under duress and this is a freemium context which continues to go undefeated by the open source community.
There is more than one library for working in C++ in Android programming:
C++ - qt (A Nokia product, also available as LGPL)
C++ - Wxwidget (Available as GPL)