Commit Graph

6066 Commits

Author SHA1 Message Date
Andreas Schiffler
ea5874859c Fix bug 1494: add missing test projects to VS2010/VS2010 solution 2013-07-22 06:00:41 -07:00
Sam Lantinga
ca9a19ea4c Fixed building with cygwin
Note that building with cygwin gcc results in a DLL that depends on cygwin1.dll
2013-07-21 23:01:01 -07:00
Philipp Wiesemann
178f958a2a Removed not needed SDL_WINDOW_SHOWN from iOS example programs.
See bug #1667.
2013-07-21 22:09:00 +02:00
Sam Lantinga
17747734e6 Fixed bug 1813 - MouseMotion relative values do not respect renderer LogicalSize
driedfruit

A trivial issue, the xrel and yrel values of MouseMotion event struct are not adjusted to renderer logical size.
2013-07-21 12:54:27 -07:00
Sam Lantinga
04f86925d1 Fixed bug 1973 - test/Makefile.in fails on Mac OS X with X11 enabled...
Ryan C. Gordon

If you have the X11 SDK installed on Mac OS X, you'll build with X11 support, but the Makefile doesn't build anything but the Cocoa testnative code for Mac OS X, which is fine, but then testnative fails to link because testnative.h enables the X11 support based on the SDL config header.

Building the testnativex11.c code on Mac OS X doesn't work because you need to explicitly link with "-L/usr/X11/lib -lX11" if this code is enabled, but you can't link with that by default because the X11 SDK might be missing.

So this needs a little configure magic to do the right thing (or forcibly disabling X11 support on Mac OS X in testnative.h).
2013-07-21 12:47:47 -07:00
Sam Lantinga
5644b36ad2 Added X include path so SDL_syswm.h works correctly on systems with X11 in a non-standard directory. 2013-07-21 12:37:43 -07:00
Sam Lantinga
6c92722aad Fixed cursor leak when quitting the mouse subsystem 2013-07-21 12:21:22 -07:00
Sam Lantinga
a325c053a4 Fixed bug 1976 - SDL2.m4 shares same variables as SDL.m4 so they cache values
Edgar Simo

So basically the issue is that:

AC_PATH_PROG(SDL_CONFIG, sdl2-config, no, [$PATH])

in sdl2.m4 shares the same variable (SDL_CONFIG) as sdl.m4:

AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])

What happens is if you run the AM_PATH_SDL2 and then AM_PATH_SDL to say fall back on SDL if SDL2 isn't found, the AM_PATH_PROG command gets cached (ac_cv_path_SDL_CONFIG) so that unless you unset this cache variable, the result for AM_PATH_SDL will be EXACTLY the same as for AM_PATH_SDL2.

To fix I would recommend renaming SDL_CONFIG to SDL2_CONFIG in sdl2.m4, replacing all instances so it won't cache to the same variable.
2013-07-21 11:52:16 -07:00
Jasper St. Pierre
ccb06e4952 Add support for the _NET_WM_BYPASS_COMPOSITOR hint
This hints to window managers to unredirect the window to improve
performance.
2013-07-21 00:57:31 -04:00
Ryan C. Gordon
0936ec15d3 Cursor mask was uninitialized data, causing problems.
Fixes Bugzilla #1461.
2013-07-21 00:07:43 -04:00
Ryan C. Gordon
94f48a7a79 Include SDL_assert.h to fix broken build. 2013-07-20 21:22:37 -04:00
Ryan C. Gordon
f5dc9cbdd4 Don't allocate memory if we're just going to fail when checking parameters. 2013-07-20 21:19:20 -04:00
Ryan C. Gordon
458f6d50de Don't try to clear errors in GL_ActivateRenderer() before we MakeCurrent.
Otherwise, if we destroyed a different renderer, next time this one draws,
it'll clear errors forever (GL_INVALID_OPERATION for having no current
context, at least on Windows), hanging up the program in an infinite loop.

Fixes Bugzilla #1775.
2013-07-20 21:10:05 -04:00
Ryan C. Gordon
d456fb5414 Fixed another compiler warning.
This one is compliments of the FreeBSD buildbot finally having the
 X11 libraries installed.  :)
2013-07-20 20:12:36 -04:00
Ryan C. Gordon
89f836cacf One more compiler warning. 2013-07-20 19:59:31 -04:00
Ryan C. Gordon
7ad45365b7 More compiler warning fixes. 2013-07-20 19:58:17 -04:00
Ryan C. Gordon
ee3cbb1fa6 Fixed some compiler warnings that Visual Studio reported. 2013-07-20 19:51:51 -04:00
Ryan C. Gordon
a4233dae85 Make XInput haptic code respect effect timeouts.
This is really just a hack until this code expands to be a robust haptic mixer.

(This is also untested, beyond compiling. Sorry!)
2013-07-20 18:51:49 -04:00
Philipp Wiesemann
5b2d7ee0c6 Changed documentation comment for SDL_CreateShapedWindow().
See bug #1667.
2013-07-20 21:55:15 +02:00
Philipp Wiesemann
bfc26adbd5 Replaced use of malloc()/free() with SDL_malloc()/SDL_free() in test program. 2013-07-20 21:51:53 +02:00
Philipp Wiesemann
aa1fee4fdb Removed not needed SDL_WINDOW_SHOWN from test programs.
See bug #1667.
2013-07-20 21:47:16 +02:00
Philipp Wiesemann
a30b85dd03 Replaced use of strcmp() with SDL_strcmp() in tests. 2013-07-20 21:39:54 +02:00
Philipp Wiesemann
8b105773a0 Removed not needed variable and work in standard library.
Found by Cppcheck (that variable's value was never used).
2013-07-20 21:35:26 +02:00
Ryan C. Gordon
9227628387 Workaround crash bug in libXi <= 1.4.1 (thanks, Steve!).
Fixes Bugzilla #1812.
2013-07-20 13:11:40 -04:00
Philipp Wiesemann
4c6c11e3a3 Corrected comments in test library source. 2013-07-20 11:16:50 +02:00
Philipp Wiesemann
abd12ce602 Changed return value of internal function to shorten generic haptic source. 2013-07-20 11:01:03 +02:00
Sam Lantinga
56ec88d00b Fixed bug 1977 - D3D_UpdateClipRect() sets the wrong width for the clip rect
Bithika Mookherjee

SDL_RenderSetClipRect() calls into renderer->UpdateClipRect(renderer).

I am not sure if UpdateClipRect() can point to a number of clip rect update functions, but on my platform it calls D3D_UpdateClipRect().

In that function, the rect to pass to IDirect3DDevice9_SetScissorRect() has it's right field set as:

    r.right = rect->w + rect->w;

But actually, this should be:

    r.right = rect->x + rect->w;
2013-07-19 22:43:14 -07:00
Ryan C. Gordon
211ea4ed99 Fixed wrong type being passed to eglGetConfigAttrib() (thanks, Alexander!).
This wanted an EGLint*, not a VisualID* cast to an EGLint*.

Without this, 64-bit X11 fails here, because the datatype sizes are different.

Fixes Bugzilla 1686.
2013-07-19 00:22:57 -04:00
Ryan C. Gordon
a5e528c444 Added finger events to SDLTest_PrintEvent(). 2013-07-18 22:20:09 -04:00
Jørgen P. Tjernø
a38344e9c5 Mac: Handle SDL_CreateWindow with SDL_WINDOW_MINIMZED.
This fixes bug #1446. You can now create a window with SDL_CreateWindow(...,
SDL_WINDOW_MINIMIZED), and not have it immediately restore itself.

It also changes SDL_RaiseWindow() to be a no-op on minimized or hidden windows,
which is how it behaves on Windows.
2013-07-16 01:02:51 -07:00
Ryan C. Gordon
a8c0012c9f Made PND_setwindowgrab() a no-op. It was a cut/paste of PND_destroywindow().
This looks like the rest of the code doesn't deal with windows, and probably
 just deals with a single fullscreen GLES context, like a console would, so
 making setwindowgrab a no-op makes sense in this case; it's already "grabbed."

Fixes Bugzilla #1850.
2013-07-15 20:30:04 -04:00
Philipp Wiesemann
ddc93adadf Changed strdup() to SDL_strdup(). 2013-07-15 23:00:47 +02:00
Jørgen P. Tjernø
d4ebc23d72 Mac: Bring back FS windows when appropriate
This automatically restores FS windows when the application is made
active (Cmd-Tab, you click the Dock icon, or you launch the .app again).
2013-07-15 11:58:49 -07:00
Jørgen P. Tjernø
01109e93b9 Mac: CGMakePoint -> CGPointMake in previous change. 2013-07-15 11:58:45 -07:00
Jørgen P. Tjernø
3671b60b1b Mac: Fix SDL_WarpMouseInWindow in fullscreen.
If you switched from a window to fullscreen, your SDL_WarpMouseInWindow
calls would be offset by the x and y coordinates of the original window.
2013-07-15 11:57:18 -07:00
Ryan C. Gordon
f36a0e9ab8 Turn the system mouse cursor back on before VideoQuit().
This is good policy, so it doesn't have a chance to leave it hidden on targets
 that wouldn't necessarily reset it by default, but it also fixes a crash if
 you try to use a message box after SDL_Quit() is called.

Fixes Bugzilla #1969.
2013-07-15 14:38:19 -04:00
Ryan C. Gordon
9e574095f8 Minor indentation clean up. 2013-07-15 01:12:15 -04:00
Ryan C. Gordon
83c211c2bc Make winmm and directsound audio targets robust against unsupported formats.
It now tries to make sure the hardware can support a given format, and if it
 can't, it carries on to the next best format instead of failing completely.
2013-07-14 21:30:16 -04:00
Jørgen P. Tjernø
46e6bc483d Fix #1445: Use xcrun to find CpMac
This should make the DMG building step more reliable on all current and future
Xcodes, by using xcrun to find the path to CpMac.
2013-07-14 15:55:34 -07:00
Jørgen P. Tjernø
c96b5c574e Fix #1667: Docs about SDL_CreateWindow and flags.
Updates the docs to say you can use SDL_WINDOW_HIDDEN, instead of (the ignored)
SDL_WINDOW_SHOWN.
2013-07-14 15:46:43 -07:00
Sam Lantinga
9f8cddc1ba Re-enabled other messagebox tests, moved the SDL_Init() call as late as possible to show the circumstances where it's needed. 2013-07-14 12:16:10 -07:00
Sam Lantinga
d1adb0a986 Fixed bug 1970 - Cocoa message boxes ignore parent window requests
Ryan C. Gordon

Cocoa_ShowMessageBox() ignores the "window" field of SDL_MessageBoxData, which means you can't assign a parent window to a message box. This is particularly egregious on Mac OS X, because it'll actually make the NSAlert visually part of the parent window instead of just concerning itself with window focus.
2013-07-14 11:58:57 -07:00
Sam Lantinga
c1de40a848 Added testing of messagebox with a parent window 2013-07-14 11:57:45 -07:00
Sam Lantinga
8ab710e751 Fixed code example for SDL_GetWindowWMInfo() 2013-07-14 11:57:01 -07:00
Sam Lantinga
ef2e62274f Removed obsolete assertion code 2013-07-14 11:43:25 -07:00
Sam Lantinga
b950abe129 Make sure a window is valid for a subsystem before using it in a messagebox 2013-07-14 11:41:57 -07:00
Sam Lantinga
c8b8665f43 If the video system has been initialized, only use that message box system.
Don't pass a window from one video driver to the messagebox function of another video driver.  This makes bad things happen. :)
2013-07-14 11:11:42 -07:00
Philipp Wiesemann
9b5b5539ee Fixed compiler warnings in test program by using wrapped functions. 2013-07-14 19:56:22 +02:00
Philipp Wiesemann
2f8b666051 Changed use of isspace() to SDL_isspace(). 2013-07-14 19:53:50 +02:00
Ryan C. Gordon
26b21dc5ff Implement float32 support for winmm and directsound targets (Thanks, John!).
Fixes Bugzilla #1657.
2013-07-14 13:27:54 -04:00