Ref<Framebuffer> colorSource = framebufferStack->peek();
colorSource->bind();
glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels.data());
for(int i = 0; i < width*height; i++)
{
pixels[i*4] = 127;
pixels[i*4+1] = 127;
pixels[i*4+2] = 127;
pixels[i*4+3] = 255;
}
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels.data());
glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels.data());
I copy the framebuffer into some uint8_t vector
I modify the uint8_t vector
I try to overwrite the framebuffer on the GPU
I read the framebuffer to make sure it was overwritten (I am getting the original values not the 127 127 127 255 ones).