User Tools

Site Tools


This is an old revision of the document!

Compiling the examples for Flash from Windows

Ok, it's assumed you've already built things on Windows and understand how Proton works.

Adobe's new Flash C++ stuff (Flascc?) allows us to create Flash versions of Proton stuff without changing a single line of code. How is this possible? Well, Adobe's compiler does most of the work, but Seth's GLES 1.X Adapter handles converting GLES calls to use Stage3D, so we still get full hardware acceleration.

It's not a perfect emulation (it's still a work in progress), but all the Proton examples run fine, so it ain't bad either.

NOTE : Proton using Domain Memory and Stage3D acceleration and Adobe has a rule that if your app makes 50k+ you have to pay them 9 percent. Just warning ya. Because of this, I (Seth) will probably be adding other web targets as well instead of depending on just Flash.

Flascc works for OSX or Windows, but I'm only going to cover the Windows setup as that's what I use. It uses Cygwin, which is sort of a fake linux for Windows. But, the Flascc SDK comes with its own version so you don't have to install it separately, like we used to have to do for Android builds.

Before you whip out .swf's of the Proton examples and amaze everyone, make sure the SDK is working.

  • Install the Adobe Flash C++ Compiler (It's free, but Adobe makes you create an account here to get it)
  • Install the latest FLEX SDK (Link)
  • Follow this and make sure you can compile the 01_HelloWorld example

Note: If you get error “LLVM ERROR: Error: Unable to launch the Java Virtual Machine.” then modify 01_HelloWorld\Makefile to add -jvmopt=-Xmx1G to the build commands, so in the end, it would look like this:

T01: check
	@echo "-------- Sample 1 --------"
	@echo && echo "First let's compile it as a projector:"
	"$(FLASCC)/usr/bin/gcc" -jvmopt=-Xmx1G $(BASE_CFLAGS) hello.c -o hello.exe

	@echo && echo "Now lets compile it as a SWF:"
	"$(FLASCC)/usr/bin/gcc" -jvmopt=-Xmx1G $(BASE_CFLAGS) hello.c -emit-swf -swf-size=200x200 -o hello.swf

include ../Makefile.common

	rm -f hello.swf hello *.bc *.exe
proton/flash_setup.1355189203.txt.gz · Last modified: 2012/12/11 01:26 by seth