Fix erroneous flipping of renderers #169
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR duplicated from thoth-tech#39
Commits were rebased.
Description
There were occasions when saving bitmaps, and restoring bitmaps (when all windows are destroyed then recreated) would cause them to be flipped vertically.
An
sk_drawing_surface
can have its internal bitmap stored either in textures or a surface, depending on if its 'drawable'. The code that handled reading from textures/renderers had a special case for Windows, that flipped the texture (or the coordinates being read) vertically. This was likely a workaround for a bug that used to be in SDL, but was fixed a while ago, so this PR simply removes those special cases.Type of change
expected) - if any people using SplashKit relied on the textures being flipped (or worked around it), they will experience different behavior.
How Has This Been Tested?
Tested using the following sample, on Windows:
Without the commits, the
get_pixel
s are all white (reading is flipped vertically), thesave_bitmap
saves a flipped bitmap, and the bitmapbmp
is flipped once the window is closed then re-opened. All works correctly with the commits.Testing Checklist
Checklist