A friend of mine was reviewing a new chapter I have been writing for the Flash Player 10 and asked me if it was possible to detect at runtime if GPU acceleration was set in a current SWF. In fact, there is no native API in the Flash Player 10 which allows you to know that.
I updated the SWFExplorer library so that you can check if any hardware acceleration has been set in the current SWF and handle that (show any specific message to inform or alert the user).
Here is how to detect the current hardware acceleration mode in your future Flash Player 10 SWF's with SWFExplorer 0.4 :
// create the SWFExplorer object var explorer:SWFExplorer = new SWFExplorer(); // pass the current SWF bytes and specify that you want to discover the current GPU mode // you would pass SWFExplorer.CLASSES to discover the linked classes explorer.parse( loaderInfo.bytes, SWFExplorer.ACCELERATION ); // affiche : true trace( explorer.acceleration == SWFExplorer.GPU ); // affiche : false trace( explorer.acceleration == SWFExplorer.DIRECT ); // affiche : false trace( explorer.acceleration == SWFExplorer.NONE );
Download this new version here.