No description
Find a file
Sam Lantinga 8ee3d7a554 Fixed bug 1968 - SDL_RenderCopy stretch loses proportion on viewport boundaries for 3D renderers
driedfruit

SDL_RenderCopy clips dstrect against the viewport. Then it adjusts the
srcrect by "appropriate" amount of pixels. This amount is actually
wrong, quite a lot, because of the rounding errors introduced in the "*
factor / factor" scale.

            real_srcrect.x += (deltax * real_srcrect.w) / dstrect->w;
            real_srcrect.w += (deltaw * real_srcrect.w) / dstrect->w;

For example:

I have a 32 x 32 srcrect and a 64 x 64 dstrect. So far the
stretching is done perfectly, by a factor of 2.

Now, consider dstrect being clipped against the viewport, so it becomes
56 x 64. Now, the factor becomes 1.75 ! The adjustment to "srcrect"
can't handle this, cause srcrect is in integers.

And thus we now have incorrect mapping, with dstrect not being in the
right proportion to srcrect.

The problem is most evident when upscaling stuff, like displaying a 8x8
texture with a zoom of 64 or more, and moving it beyond the corners of
the screen. It *looks* really really bad.

Note: RenderCopyEX does no such clipping, and is right to do so. The fix would be to remove any such clipping from RenderCopy too. And then fix the software renderer, because it has the same fault, independently of RenderCopy.

[attached patch]
this leaves Software Renderer buggy, as it does it's own clipping later on
2013-08-01 09:15:36 -07:00
acinclude We have to fix the DLL name convention on Windows every time... 2012-10-19 21:43:41 -07:00
android-project Fixed bug 1569 - Android volume keys not honoured inside SDL 2013-07-31 21:08:22 -07:00
build-scripts Mac: Codify SDK and OS requirements, and clean up. 2013-07-23 17:38:59 -07:00
cmake Fix cmake breakage (thanks Marcus) 2013-07-26 13:30:24 -07:00
debian Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
include Fixed stack smashing crash when using the GCC compiled DLL with Visual Studio. 2013-07-29 23:28:25 -07:00
src Fixed bug 1968 - SDL_RenderCopy stretch loses proportion on viewport boundaries for 3D renderers 2013-08-01 09:15:36 -07:00
test Changed test program to be more compatible C. 2013-07-27 21:11:12 +02:00
VisualC Finished updating testoverlay2 for the new API and added it to the Visual Studio 2010 projects 2013-07-23 12:46:22 -07:00
Xcode More work on bug 1999, added missing CFBundleExecutable key to Info.plist 2013-07-31 21:31:23 -07:00
Xcode-iOS Removed not needed SDL_WINDOW_SHOWN from iOS example programs. 2013-07-21 22:09:00 +02:00
.hgignore Need to generate aclocal.m4 when rebuilding configure, but we don't need to check it in. 2013-05-26 16:01:40 -07:00
.hgtags
Android.mk Android: Removed all unnecessary dependencies on C++. 2013-07-22 02:51:45 -07:00
autogen.sh Need to generate aclocal.m4 when rebuilding configure, but we don't need to check it in. 2013-05-26 16:01:40 -07:00
BUGS.txt Credits were truncated in a previous commit. 2013-05-27 21:44:16 -07:00
CMakeLists.txt Fixed bug 1743 - CMake produces libraries with wrong filename/SONAME 2013-07-27 02:50:19 -07:00
configure Further fix SIZEOF_VOIDP in SDL_config.h.in 2013-07-31 12:13:26 -04:00
configure.in Further fix SIZEOF_VOIDP in SDL_config.h.in 2013-07-31 12:13:26 -04:00
COPYING.txt Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
CREDITS.txt Credits were truncated in a previous commit. 2013-05-27 21:44:16 -07:00
INSTALL.txt Updated the installation instructions to cover all supported platforms 2013-05-26 12:42:46 -07:00
Makefile.in Backout hg changset 898992405fa7; lots of things still use SDL_types.h. :/ 2013-07-09 11:57:32 -04:00
Makefile.minimal
Makefile.pandora
Makefile.psp Add PSP support 2013-03-17 20:07:02 +08:00
Makefile.wiz
README-android.txt Android: Removed all unnecessary dependencies on C++. 2013-07-22 02:51:45 -07:00
README-cmake.txt Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
README-directfb.txt Fixed recently deleted Ms in READMEs. 2013-05-30 12:15:00 +02:00
README-gesture.txt Fixed recently deleted Ms in READMEs. 2013-05-30 12:15:00 +02:00
README-hg.txt Fixed recently deleted Ms in READMEs. 2013-05-30 12:15:00 +02:00
README-ios.txt Fixed recently deleted Ms in READMEs. 2013-05-30 12:15:00 +02:00
README-macosx.txt Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
README-pandora.txt Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
README-platforms.txt Updated supported iOS version. 2013-07-12 23:16:11 -07:00
README-porting.txt Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
README-psp.txt Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
README-SDL.txt Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
README-touch.txt Fixed recently deleted Ms in READMEs. 2013-05-30 12:15:00 +02:00
README-wince.txt Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
README.txt Updated the README to match the new website text 2013-07-06 11:56:04 -07:00
sdl2-config.in Updated to SDL 2.0, and SDL 2.0 can now be installed coexisting with SDL 1.2 2012-01-22 17:21:00 -05:00
sdl2.m4 Fixed bug 1976 - SDL2.m4 shares same variables as SDL.m4 so they cache values 2013-07-21 11:52:16 -07:00
sdl2.pc.in Updated to SDL 2.0, and SDL 2.0 can now be installed coexisting with SDL 1.2 2012-01-22 17:21:00 -05:00
SDL2.spec.in Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
TODO.txt Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
VisualC.html Changed paths and name of header file in text of VisualC.html. 2013-06-29 22:08:38 +02:00
WhatsNew.txt Renamed WhatsNew so it can be easily read on Windows 2013-05-26 12:43:03 -07:00

                         Simple DirectMedia Layer

                                  (SDL)

                                Version 2.0

---
http://www.libsdl.org/

Simple DirectMedia Layer is a cross-platform development library designed
to provide low level access to audio, keyboard, mouse, joystick, and graphics
hardware via OpenGL and DirectX. It is used by video playback software,
emulators, and popular games including Valve's award winning catalog
and many Humble Bundle games.

The current version supports Windows, Mac OS X, Linux, iOS, and Android.
The code contains support for other operating systems but those are not
officially supported.

SDL is written in C, but works with C++ natively, and has bindings to
several other languages, including C#, Python and more in progress.

This library is distributed under the zlib license, which can be found
in the file "COPYING.txt".

The best way to learn how to use SDL is to check out the header files in
the "include" subdirectory and the programs in the "test" subdirectory.
The header files and test programs are well commented and always up to date.
More documentation and FAQs are available online at:
	http://wiki.libsdl.org/

If you need help with the library, or just want to discuss SDL related
issues, you can join the developers mailing list:
	http://www.libsdl.org/mailing-list.php

Enjoy!
	Sam Lantinga				(slouken@libsdl.org)