我正在尝试以最有效的方式截取屏幕截图。我使用 FrameBuffer 是截取屏幕截图的最有效方式,因为我可以在与渲染线程不同的线程中处理数据。如何从 FrameBUffer 获取信息并将其传输到文件中?
FrameBuffer m_fbo;
render(){
m_fbo = new FrameBuffer(Format.RGB565, (int)(w * m_fboScaler), (int)(h * m_fboScaler), false);
m_fboRegion = new TextureRegion(m_fbo.getColorBufferTexture());
m_fboRegion.flip(false, true);
m_fbo.begin();
...rendering...
m_fbo.end();
writeTextureRegionToFile(); - i need some lines of code for the implementation of this method
}