1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

OpenGLFrameBuffer: Add a row order parameter for reading and writing pixels

This also fixes a bug where saving and restoring the framebuffer state
could unexpectedly apply a vertical flip to the buffer content.
This commit is contained in:
reuk 2025-07-10 12:36:11 +01:00
parent c77e8a73cc
commit f5a6c510c0
No known key found for this signature in database
4 changed files with 74 additions and 18 deletions

View file

@ -2,6 +2,34 @@
# develop
## Change
The signatures of OpenGLFrameBuffer::readPixels() and
OpenGLFrameBuffer::writePixels() have changed, adding a new RowOrder parameter.
**Possible Issues**
Code that does not specify this parameter will not compile.
**Workaround**
Pass the extra parameter to specify whether the pixel data should be ordered
with the top-most or bottom-most row first.
**Rationale**
The previous function calls did not allow the pixel order to be configured.
readPixels() would return pixel data with the bottom-most row first (this is
convention for the OpenGL API), but writePixels() would expect the top-most row
first. This meant that reading and then immediately writing the same data would
have the unexpected effect of flipping the image. Changing readPixels() to
order pixels from top to bottom would be slightly dangerous, as it would
introduce a change of behaviour with no accompanying compiler warning.
Additionally, flipping the pixel storage introduces additional work that can be
safely skipped when the pixel data is going to be written back to the
framebuffer later.
## Change
The behaviour of the default constructed FocusTraverser objects has changed, and