Archive for November, 2011

Error #3692: All buffers need to be cleared every frame before drawing

Friday, November 18th, 2011

So I have this Starling project and wanted to take a screenshot of the Stage3D currently in use.
I was trying to use the Context3D.drawToBitmapData() function and kept getting this error:
“Error #3692: All buffers need to be cleared every frame before drawing.”

Googling around yielded no results, so after figuring out the problem I’m posting the solution here for anyone else having this problem.

The solution is short: you have to call drawToBitmapData() BEFORE the Context3D.present() call.

In my case with Starling I had to add the functionality in the Starling.render() function, between the call to mStage.render() and the call to mContext.present().