fix framebuffer read
This commit is contained in:
@@ -1761,7 +1761,7 @@ ui::Layer::Snapshot ui::Layer::snapshot(std::string data_path)
|
||||
static int counter = 0;
|
||||
LOG("errno = %d", errno);
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
//glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
snap.m_dirty_box[i] = m_dirty_box[i];
|
||||
@@ -1777,7 +1777,7 @@ ui::Layer::Snapshot ui::Layer::snapshot(std::string data_path)
|
||||
glm::vec2 box_sz = zw(m_dirty_box[i]) - xy(m_dirty_box[i]);
|
||||
glReadPixels(m_dirty_box[i].x, m_dirty_box[i].y, box_sz.x, box_sz.y, GL_RGBA, GL_UNSIGNED_BYTE, snap.image[i].get());
|
||||
m_rtt[i].unbindFramebuffer();
|
||||
glReadBuffer(GL_NONE);
|
||||
//glReadBuffer(GL_NONE);
|
||||
|
||||
LOG("snapshot face %d - %d bytes (%dx%d)", i, (int)box_sz.x * (int)box_sz.y * 4, (int)box_sz.x, (int)box_sz.y);
|
||||
static char name[128];
|
||||
|
||||
Reference in New Issue
Block a user