Commit Graph

3799 Commits

Author SHA1 Message Date
Sam Lantinga
028c19b92b When the window is resized, the viewport is automatically reset.
This resolves lots of confusion around resizable windows.  Most people don't expect a viewport to be implicitly set when the renderer is created and then not to be reset to the window size if the window is resized.

Added common test command line parameters --logical WxH and --scale N to test the render logical size and scaling APIs.
2013-05-29 03:22:19 -07:00
Sam Lantinga
23f33cb76c Fixed bug 1622 - SDL_RenderSetViewport with empty SDL_Rect raises wrong error for OpenGL rendering backend
It's now legal to set an empty viewport rect - it will prevent any rendering.

Also added an API to query the output size: SDL_GetRendererOutputSize()
2013-05-29 03:07:55 -07:00
Sam Lantinga
9c6d6e4423 Fixed crash with movaps instruction in SDL_memcpy(), due to unaligned Uint32* cast and -O3 vectorization optimizations with gcc 4.9.0 2013-05-27 16:18:11 -07:00
Sam Lantinga
d20e17f345 Fixed Visual Studio build 2013-05-26 14:37:41 -07:00
Sam Lantinga
767c1395d9 Fixed compiling XAudio2 code with mingw64 2013-05-26 12:20:23 -07:00
Sam Lantinga
6642f27c10 Fixed compiler warning 2013-05-26 11:44:03 -07:00
Sam Lantinga
3c3e87d79f Fixed compile errors building with mingw64 2013-05-26 11:34:04 -07:00
Philipp Wiesemann
4edf9290cc Fixed wrong documentation for haptic implementation. 2013-05-26 12:15:15 +02:00
Philipp Wiesemann
41b30114d5 Changed three similar error messages to contain more context. 2013-05-26 11:54:17 +02:00
Sam Lantinga
e3041182ff Fixed Windows build 2013-05-24 03:29:31 -07:00
Sam Lantinga
9ab99a4157 Added the beginning of automated tests for the standard C library routines.
Implemented more SDL_snprintf format specifiers.
2013-05-24 03:23:21 -07:00
Sam Lantinga
851b726444 Added a newline to OutputDebugString(), fixes output on Visual Studio 2008 2013-05-23 23:27:48 -07:00
Edward Rudd
199a800af5 Only free EventData if it's successfully retrieved.
- straight from http://who-t.blogspot.com/2009/07/xi2-and-xlib-cookies.html
- hopefully fixes random crash on some systems
2013-05-23 18:45:14 -04:00
Ryan C. Gordon
a346679caf Patched to compile with older glext.h that don't have GL_NUM_EXTENSIONS. 2013-05-22 01:36:37 -04:00
Ryan C. Gordon
a3be5baa21 Use glGetStringi() for extension lookup on OpenGL contexts >= version 3.0.
Fixes Bugzilla #1620.
2013-05-22 01:31:04 -04:00
Sam Lantinga
89efb1821f Fixed macro line endings after whitespace was fixed 2013-05-21 22:04:14 -07:00
Sam Lantinga
28d1e55d4e Fixed bug 1534 - SIGSEGV in SDL_ConvertSurface() for certain formats in SDL2
Don't assume that 8 bit formats are indexed.
Thanks to Gabriel Jacobo for research and potential patches.
2013-05-21 22:01:18 -07:00
Ryan C. Gordon
0412136a9d Patched to compile on older Mac OS X devtools (thanks, D B!). 2013-05-21 23:02:16 -04:00
Sam Lantinga
a05b8e83d9 Fixed bug 1148 - SDL window white upon first appearing
To be consistent with other platforms, we'll use black as the background color.
2013-05-20 23:30:08 -07:00
Sam Lantinga
20dee3ebf5 Fixed bug 1113 - SDL_SetEventFilter()'s event deletion process is not safe against intervening event push.
This is not completely thread-safe since it's possible for an event to come in and be unfiltered between the flush call and the setting of the new filter, but it's much better than it was.
2013-05-20 23:04:25 -07:00
Sam Lantinga
91acc847ca Fixed bug 731 - No mechanism to extract the NSView for 3d library 2013-05-20 22:05:49 -07:00
Sam Lantinga
de7dd5fa01 Fixed losing ALT key modifiers on Unity 2013-05-20 12:25:16 -07:00
Sam Lantinga
4d9fee966f It turns out that GL_ARB_debug_output is really only useful on debug contexts, so for consistency and performance we'll only check and report errors on debug contexts.
I added a --gldebug command line option for the test programs to easily test this, and we may want a hint as well to enable OpenGL error checking.
2013-05-20 12:01:31 -07:00
Sam Lantinga
35f178cd7f Fixed declaration of GL_HandleDebugMessage 2013-05-19 22:57:01 -07:00
Sam Lantinga
a08ccfa9f8 Fixed windows build 2013-05-19 22:45:52 -07:00
Sam Lantinga
8044cbb297 Fixed bug 1842 - [patch] SDL_SetWindowPosition sets bad position values when given SDL_WINDOWPOS_CENTERED args
Alex Szpakowski

When calling SDL_SetWindowPosition(window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED), the window moves to the correct position but it seems to internally set its x/y position values to the literal value of the SDL_WINDOWPOS_CENTERED define.
This causes all sorts of problems when SDL functions which use the window position (e.g. SDL_SetWindowGrab) are called after the aforementioned SDL_SetWindowPosition call.

Looking at the SDL_SetWindowPosition code, it seems that SDL_SendWindowEvent with the SDL_WINDOWEVENT_MOVED event is called at the end of the function using the literal value of the SDL_WINDOWPOS_CENTERED define, instead of the newly set window->x and window->y values.
SDL_SendWindowEvent then sets the values of window->windowed.x and window->windowed.y to that value (0x2FFF0000, aka 805240832.)

I have attached a patch which changes SDL_SetWindowPosition to make sure SDL_SendWindowEvent is called with the correct coordinate values, if SDL_WINDOWPOS_CENTERED is used (fixes the issue for me.)

Tested with Mac OS 10.8.3.
2013-05-19 22:36:54 -07:00
Sam Lantinga
1063a72829 Fixed bug 1837 - Use error extension instead of glGetError()
Implemented support for GL_ARB_debug_output, but was unable to test it on Mac OS X.
2013-05-19 22:28:10 -07:00
Sam Lantinga
ed64f745ba Fixed black screen on iOS 2013-05-18 14:51:29 -07:00
Sam Lantinga
0d9b661db8 File style cleanup for the SDL 2.0 release 2013-05-18 14:17:52 -07:00
Sam Lantinga
3beb70c4bc Added mobile application events, with implementations for iOS and Android 2013-05-18 12:48:50 -07:00
Andreas Schiffler
d99b036e08 Update test harness to handle test return codes; fix comment format in harness; update Main test suite to handle globally disabled features 2013-05-18 09:35:09 -07:00
Sam Lantinga
d6adde2adb Fixed bug 1838 - [Patch] Direct3D resource leak on SDL_DestroyRenderer() 2013-05-16 00:56:19 -07:00
Sam Lantinga
f5b0547030 Martin Gerhardy added support for the Jess Technology USB Game Controller 2013-05-16 00:48:20 -07:00
Sam Lantinga
57fad12ba2 Fixed bug 1846 - _allmul implementation in SDL_stdlib.c doesn't clean up the stack
Colin Barrett

I see this manifest itself (VS2012 x86) as:

"Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.  This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention."

in the first call to SDL_GetTicks in my application. The disassembly at the problem line is:

        hires_now.QuadPart *= 1000;
00AD0792  push        0
00AD0794  push        3E8h
00AD0799  mov         eax,dword ptr [ebp-10h]
00AD079C  push        eax
00AD079D  mov         ecx,dword ptr [hires_now]
00AD07A0  push        ecx
00AD07A1  call        _allmul (0AE7D40h)
00AD07A6  mov         dword ptr [hires_now],eax
00AD07A9  mov         dword ptr [ebp-10h],edx

Apparently _allmul should be popping the stack but isn't (other similar functions in SDL_stdlib.c - _alldiv and whatnot - DO pop the stack).

A 'ret 10h' at the end of _allmul appears to do the trick
2013-05-16 00:43:22 -07:00
Philipp Wiesemann
5703aaa041 Corrected internal function prototype. 2013-05-15 22:25:00 +02:00
Philipp Wiesemann
fa124e58f7 Corrected internal function prototype. 2013-05-15 22:24:23 +02:00
Philipp Wiesemann
a19135fd1a Inlined expression for consistency in render source. 2013-05-13 22:45:06 +02:00
Andreas Schiffler
82d01cd77a Fix fuzzer/fuzzer tests on 64bit Linux; remove invalid negative SDL_Scancode test; disable failing surface/render test cases 2013-05-12 15:00:00 -07:00
Philipp Wiesemann
08e8e38c86 Fixed building on Visual Studio.
Buildbot
2013-05-12 14:25:38 +02:00
Philipp Wiesemann
d1cc72dd52 Fixed bug 1845 - SDL_GetNumTouchDevices() has incorrect prototype
nfxjfg

SDL_touch.h:63:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]

Is:

extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices();

Should be:

extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void);
2013-05-12 13:42:20 +02:00
Philipp Wiesemann
de43af1b54 Fixed bug 1844 - glScissor calls are wrong - Patch attached
Martin Gerhardy

the coordinate system from sdl is not correctly transformed to the coordinate system of opengl. glScissor expects them to be a little bit different. Attached is a patch that fixes this
2013-05-12 13:40:02 +02:00
Philipp Wiesemann
539f60a57d Corrected spelling in internal include file. 2013-05-12 13:02:07 +02:00
Philipp Wiesemann
06f4beb78f Added missing vi lines. 2013-05-10 21:14:13 +02:00
Philipp Wiesemann
b6cc5b3088 Fixed implicit function declaration warnings. 2013-05-10 21:08:37 +02:00
Gabriel Jacobo
d36f97eb89 Fixed typo in GL_UpdateClipRect 2013-05-10 10:33:15 -03:00
Gabriel Jacobo
d4c2a87a5b Fixes OpenGL* Clip Rect functions (by Emmanuel Gil Peyrot) 2013-05-10 10:31:01 -03:00
Sam Lantinga
ae4a085fc1 Updated version to 2.0.0 2013-05-09 16:30:44 -07:00
Jørgen P. Tjernø
124ec4459a Mac: Use cursor rects instead of NSCursor hide/unhide.
This should hopefully fix a class of problems around cursor hiding not behaving correctly on Mac.

http://bugzilla.libsdl.org/show_bug.cgi?id=1824
2013-05-07 16:52:39 -07:00
Ethan Lee
128baa8bd0 Implemented SDL_GL_SHARE_WITH_CURRENT_CONTEXT for Mac OS X. 2013-05-05 21:01:20 -04:00
Andreas Schiffler
c9f348d9ba Add input validation to SDL_CalculateGammaRamp; add test coverage to Pixels suite; update test cases in Pixels suite 2013-05-05 11:17:40 -07:00