Hi again
I have been losing sleep over the above APIs, because of several issues such as how it will not be able to handle an application with multiple GL contexts.
Adobe manages this workflow in the Stage3D API, but since the display list in Flash Player is run in software, there’s an (obvious) divorce between the APIs.
I just committed the following, I am curious of your feelings
var texture = stage.stage3Ds[0].context3D.createTexture (100, 100, BGRA, true);
var bitmapData = BitmapData.fromTexture (texture);
var sprite = new Sprite ();
sprite.graphics.beginFill (0xFF0000);
sprite.graphics.drawRect (0, 0, 100, 100);
bitmapData.draw (sprite);
This will result in a BitmapData
object that has an internal framebuffer, and does not allocate a software buffer.
I have also made changes in the development builds to initialize Context3D
automatically when using an OpenGL renderer. We already initialize the real OpenGL context, so it seems reasonable that the Context3D
object would immediately be available.
That makes it simpler to use something like the above example code
Thoughts?
(EDIT: BitmapData.fromTexture
would return null on Flash)