when i debug my program stage.stage3Ds is empty ( length 0 ) this gives me an error when i try to use it for programming. When I push a new Stage3D on to stage.stage3Ds and then use the requestContext3D() function, I never get the context3d_create event that allows me to move forward with program
问题:
回答1:
In the Adobe AIR Application Descriptor XML file, set the following elements:
<renderMode>direct</renderMode>
<depthAndStencil>true</depthAndStencil>
Render Mode
Specifies whether to use graphics processing unit (GPU) acceleration, if supported on the current computing device.
In order to leverage GPU acceleration of Flash content with AIR for mobile platforms, Adobe recommends that you use renderMode="direct" (that is, Stage3D) rather than renderMode="gpu". Adobe officially supports and recommends the following Stage3D based frameworks: Starling (2D) and Away3D (3D). For more details on Stage3D and Starling/Away3D, see http://gaming.adobe.com/getstarted/.
Depth and stencil
Indicates that the application requires the use of the depth or stencil buffer. You typically use these buffers when working with 3D content. By default, the value of this element is false to disable the depth and stencil buffers. This element is necessary because the buffers must be allocated on application startup, before any content loads.
The setting of this element must match the value passed for the enableDepthAndStencil argument to the Context3D.configureBackBuffer() method. If the values do not match, AIR issues an error.
This element is only applicable when renderMode = direct. If renderMode does not equal direct, ADT throws error 118: