Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

queueSnapshot does not work on multiply views #714

Open
62316e opened this issue Jan 28, 2015 · 7 comments
Open

queueSnapshot does not work on multiply views #714

62316e opened this issue Jan 28, 2015 · 7 comments

Comments

@62316e
Copy link

62316e commented Jan 28, 2015

Hi,

RendererBase.as

if (!_shareContext) {
                if (_snapshotRequired && _snapshotBitmapData) {
                    _context.drawToBitmapData(_snapshotBitmapData);
                    _snapshotRequired = false;
                }
            }
@62316e
Copy link
Author

62316e commented Jan 28, 2015

Fixed by adding same code into Stage3DProxy.as::onEnterFrame method
if (_snapshotRequired && _snapshotBitmapData)
{
_context3D.drawToBitmapData(_snapshotBitmapData);
_snapshotRequired = false;
}

@62316e 62316e closed this as completed Jan 28, 2015
@62316e 62316e reopened this Jan 28, 2015
@bknill
Copy link

bknill commented Mar 3, 2015

I'm having the same issue. Did you need to add the whole queueSnapshot function to Stage3dProxy as well? Or should it still be called by the renderer?

@bknill
Copy link

bknill commented Mar 3, 2015

I did and got 'Error: Error #3692: All buffers need to be cleared every frame before drawing.'

@62316e
Copy link
Author

62316e commented Mar 4, 2015

Thats my Stage3DProxy.as

private function onEnterFrame(event:Event):void
{
if (!_context3D)
return;

        // Clear the stage3D instance
        clear();

        //notify the enterframe listeners
        notifyEnterFrame();

        if (_snapshotRequired && _snapshotBitmapData)
        {
            _context3D.drawToBitmapData(_snapshotBitmapData);
            _snapshotRequired = false;
            dispatchEvent(new Event("snapshotReady"));
        }
        // Call the present() to render the frame
        present();


        //notify the exitframe listeners
        notifyExitFrame();

    }

@bknill
Copy link

bknill commented Mar 4, 2015

Oh thanks. Yeah I had the call after present();

What's listening for 'snapshotReady' ?

@62316e
Copy link
Author

62316e commented Mar 4, 2015

I made 'snapshotReady' for project purpose .

_stageView.stage3DProxy1.addEventListener("snapshotReady", onSnapshotReady);
_stageView.stage3DProxy1.queueSnapshot(bmpSnapshot);

You just have to wait for a next frame (eg present)

@bknill
Copy link

bknill commented Mar 4, 2015

Thanks.

It's coming back black, I'll have to work out why it's empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants