Skip to content

Commit b650cbe

Browse files
committed
Replaced renderer calls to glReadPixels(reads the framebuffer) with calls to glGetTexImage(reads a texture). Updates to sprites will read the contents of the decal back instead of reading the framebuffer.
1 parent 6e57b2f commit b650cbe

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

olcPixelGameEngine.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5042,7 +5042,7 @@ namespace olc
50425042

50435043
void ReadTexture(uint32_t id, olc::Sprite* spr) override
50445044
{
5045-
glReadPixels(0, 0, spr->width, spr->height, GL_RGBA, GL_UNSIGNED_BYTE, spr->GetData());
5045+
glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, spr->GetData());
50465046
}
50475047

50485048
void ApplyTexture(uint32_t id) override
@@ -5582,7 +5582,7 @@ namespace olc
55825582

55835583
void ReadTexture(uint32_t id, olc::Sprite* spr) override
55845584
{
5585-
glReadPixels(0, 0, spr->width, spr->height, GL_RGBA, GL_UNSIGNED_BYTE, spr->GetData());
5585+
glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, spr->GetData());
55865586
}
55875587

55885588
void ApplyTexture(uint32_t id) override

0 commit comments

Comments
 (0)