proton:flash_setup
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| proton:flash_setup [2012/12/11 01:12] – created seth | proton:flash_setup [2015/09/09 02:00] (current) – seth | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===Compiling the examples for Flash using Windows === | + | NOTE: Well, Flash is more or less dead so this probably won't be updated. |
| - | Ok, it's assumed you've already built things on Windows | + | ====Compiling the examples for Flash from Windows |
| - | Adobe' | + | |
| + | Adobe' | ||
| + | |||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | <div id=" | ||
| + | < | ||
| + | <param name=" | ||
| + | <!--[if !IE]> | ||
| + | <object type=" | ||
| + | < | ||
| + | <param name=" | ||
| + | <param name=" | ||
| + | <param name=" | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | <!--[if !IE]> | ||
| + | </ | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | [[http:// | ||
| + | |||
| + | ==Features== | ||
| + | |||
| + | * Games run in Flash without code or media changes (except all sounds must be .mp3 at the moment, see gotchas below) | ||
| + | * Graphics are hardware accelerated, | ||
| + | * Converts GL_TRIANGLE_FAN and GL_TRIANGLE_STRIP | ||
| + | * Internally creates and caches VBOs when it can | ||
| + | * Build process hacked to show better errors than the one Adobe came with | ||
| + | * Uses the cygwin that comes with the Flash C++ SDK, so you don't have to install your own | ||
| + | * Mouse/ | ||
| + | * Uses Adobe' | ||
| + | * Can also run in a simple text console only mode, see RTConsole example for that | ||
| 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. | 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 | + | ** NOTE ** : Proton |
| 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. | 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. | ||
| + | |||
| + | === Step 1: Install some sdks and verify your setup === | ||
| Before you whip out .swf's of the Proton examples and amaze everyone, make sure the SDK is working. | Before you whip out .swf's of the Proton examples and amaze everyone, make sure the SDK is working. | ||
| + | |||
| + | Ok, it's assumed you've already built things on Windows and understand how Proton works. | ||
| * Install the Adobe Flash C++ Compiler (It's free, but Adobe makes you create an account [[https:// | * Install the Adobe Flash C++ Compiler (It's free, but Adobe makes you create an account [[https:// | ||
| * Install the latest FLEX SDK ([[http:// | * Install the latest FLEX SDK ([[http:// | ||
| + | * Optional: Download the debug Flash projector and put it in / | ||
| + | * Optional: Download Vizzy, it will show LogMsg messages when using a debug player | ||
| * Follow [[http:// | * Follow [[http:// | ||
| + | |||
| + | **Note**: If you get error "LLVM ERROR: Error: Unable to launch the Java Virtual Machine." | ||
| + | |||
| + | {{: | ||
| + | |||
| + | |||
| + | If that doesn' | ||
| + | < | ||
| + | T01: check | ||
| + | @echo " | ||
| + | @echo && echo "First let's compile it as a projector:" | ||
| + | " | ||
| + | |||
| + | @echo && echo "Now lets compile it as a SWF:" | ||
| + | " | ||
| + | |||
| + | include ../ | ||
| + | |||
| + | clean: | ||
| + | rm -f hello.swf hello *.bc *.exe | ||
| + | </ | ||
| + | |||
| + | But that's not a great solution, because later you really WILL need more memory when you compile debug mode versions of bugger stuff, it's a huge hog. | ||
| + | |||
| + | === Step 2: Compiling RTBareBones example === | ||
| + | |||
| + | * Edit **RTBareBones/ | ||
| + | * Double click BuildRelease.bat. | ||
| + | * If it works, you will see RTBareBones.swf in the same directory. | ||
| + | * Same thing to compile the RTSimpleApp example | ||
| + | |||
| + | |||
| + | === Step 3: How to add a Flash target to your existing Proton game === | ||
| + | |||
| + | * Copy the /flash folder from RTSimpleApp into your own project | ||
| + | * Use [[: | ||
| + | * Edit the / | ||
| + | * To change the render size of your .swf, change the SWF_SIZE setting in the makefile, and also change the two places the size appears in the test1.html file. | ||
| + | * Look at App.cpp in RTSimpleApp and notice a subtle change to the audio init - it now uses "new AudioManagerFlash", | ||
| + | * That should be it! If you have nonstandard media folders to copy from, you can fix it by editing build_prepare.bat | ||
| + | |||
| + | ===Misc Notes & Gotchas=== | ||
| + | * -O4, the best Flascc G++ optimization setting has weird freezes making it useless. | ||
| + | * Non pod globals that get intialized right away act funky in some cases. | ||
| + | * Don't try to rename Console.as, the default preloader that Adobe ships hardcodes this name, we'd better keep it. (At first I tried to rename it FlashMain.as, | ||
| + | * shared/ | ||
| + | * If you get reference errors in release builds you need to add the names of those functions to your project/ | ||
| + | * printf will act like LogMsg, both will go to debug output | ||
| + | * Only 128kz stereo mp3 audio is supported | ||
| + | * The SetVolume, SetPan, and IsPlaying functions in AudioManagerFlash are not implemented | ||
| + | * Not all GL functions supported | ||
| + | * Some MSVC examples have a Flash GLES Debug profile setup, it compiles and renders with MSVC, but there is no video as it's all going through a crippled GLFlashAdaptor - you can't see anything, but it's useful to me for debugging and seeing which GLES things aren't handled yet. | ||
| + | * Only one GL light is supported and it must be ambient | ||
| + | * LaunchURL works, but only when loading the swf from a real website, otherwise you get a security error | ||
| + | * It's slow.. I get 60 fps but only because I have a top of the line machine.. there are many optimizations I can still make, especially in the GLESAdaptor code, I'm going to try to replace it with Adobe' | ||
| + | * Compiling is slowish. | ||
| + | * I get Java memory errors if I try to compile a full -g debug version of the larger examples (RTSimpleApp) even with trying to hack everything to use 4gb of java memory, it just won't work. So RTSimpleApp doesn' | ||
| + | * You can do full GDB debugging with this - edit BuildDebug.bat and change **set RUN_GDB_DEBUGGER=0** to 1 | ||
| + | |||
proton/flash_setup.1355188321.txt.gz · Last modified: by seth
