Commit Graph

2606 Commits

Author SHA1 Message Date
Sam Lantinga
ec39fffe84 Fixed compiling on Windows Mobile SDK 5.0 with Visual Studio 2008 2011-01-24 15:46:11 -08:00
Sam Lantinga
5bb9535909 Fixed compile error 2011-01-24 15:10:16 -08:00
Sam Lantinga
294c77d54e Fixed bug #1080
Markus Rathgeb      2011-01-23 14:34:23 PST

With kernel 2.6.31 the struct input_absinfo defined in linux/input.h changed.
A field "__s32 resolution" was added at the end of the struct.

Because the macro EVIOCGABS(abs) is using the struct input_absinfo, it would be
better (IMHO) to change the declaration of variable values to
"int values[sizeof(struct input_absinfo) / sizeof(int)];" or using "struct
input_absinfo" directly.
2011-01-24 14:36:12 -08:00
krogoway
d35de7167f Renamed SDL_keysym to SDL_KeySym
Renamed SDL_scancode to SDL_ScanCode
Added #defines to SDL_compat.h
2011-01-24 13:47:35 -06:00
Sam Lantinga
50c5b0720f Fixed bug #1011
Daniel Ellis      2010-06-25 15:20:31 PDT

SDL based applications sometimes display the wrong application name in the
Sound Preferences dialog when using pulseaudio.

I can see from the code that the SDL pulse module is initiating a new pulse
audio context and passing an application name using the function
get_progname().

The get_progname() function returns the name of the current process. However,
the process name is often not a suitable name to use. For example, the OpenShot
video editor is a python application, and so "python" is displayed in the Sound
Preferences window (see Bug #596504), when it should be displaying "OpenShot".

PulseAudio allows applications to specify the application name, either at the
time the context is created (as SDL does currently), or by special environment
variables (see http://www.pulseaudio.org/wiki/ApplicationProperties). If no
name is specified, then pulseaudio will determine the name based on the
process.

If you specify the application name when initiating the pulseaudio context,
then that will override any application name specified using an environment
variable.

As libsdl is a library, I believe the solution is for libsdl to not specify any
application name when initiating a pulseaudio context, which will enable
applications to specify the application name using environment variables. In
the case that the applications do not specify anything, pulseaudio will fall
back to using the process name anyway.

The attached patch removes the get_progname() function and passes NULL as the
application name when creating the pulseaudio context, which fixes the issue.
2011-01-23 21:55:04 -08:00
Sam Lantinga
6cc7f17e34 Fixed size_t warnings on 64-bit build 2011-01-22 15:58:21 -08:00
Sam Lantinga
65280ffd21 Fixed bug in timer when the list of timers changed.
Fix contributed by Michael Bicha
2011-01-22 00:33:37 -08:00
Sam Lantinga
8ca87bec57 Fixed bug #1097
There are problems with including intrin.h in C linkage in C++ compilation,
and further conflicts between intrin.h and winnt.h on Visual Studio 2005.
2011-01-21 23:46:51 -08:00
Sam Lantinga
cabda4aa7c HAVE_GCC_ATOMICS covers the test and set 2011-01-21 21:45:55 -08:00
Sam Lantinga
69dab46757 Separated out the minimum functionality that we need from gcc for our spinlock fallback. 2011-01-21 21:42:04 -08:00
Sam Lantinga
577f62668f Fixed bug #929
Changed _WINDOWS to __WINDOWS__
2011-01-20 18:42:41 -08:00
Sam Lantinga
08ad787807 Fixed bug #925
Changed "win32" to "windows"
2011-01-20 18:04:05 -08:00
Sam Lantinga
aebcea297d Fixed mouse button index for additional mouse buttons 2011-01-20 17:33:06 -08:00
Sam Lantinga
2e7dff3b03 Fixed mouse button index for additional mouse buttons 2011-01-20 17:29:13 -08:00
Jjgod Jiang
bb50647d2f Fix double mouse motion in OS X
Simply ignore the event handler for Windowed mode in fullscreen.
2011-01-21 00:25:08 +01:00
Sam Lantinga
4e6ca7f51e Moved function for consistency 2011-01-20 17:11:22 -08:00
Jjgod Jiang
d991c153b6 Fix mouse wheel events in fullscreen mode for OS X
With proposed patch by vernier.
2011-01-21 00:15:18 +01:00
Sam Lantinga
3fdc01d097 Added the ability to get the UIKit window through the SDL API.
You can also do this through the native API:
	UIWindow *window = [[UIApplication sharedApplication] keyWindow];

Also needed to name the union for events and window info.
2011-01-20 16:05:59 -08:00
Sam Lantinga
3a2e750f92 Fixed bug #1026
Vittorio Giovara      2010-07-16 19:09:28 PDT

i was reading SDL_renderer_gles and i noticed that every time we there
is some gl call the gl state is modified with a couple of
glEnableClientState()/glDisableClientState.
While this is completely fine for desktops systems, this is a major
performace kill on mobile devices, right where opengles is
implemented.
Normal practice in this case is to update the glstate once, keep it
always the same and disable/enable other states only in very special
occasions.

On the web there's plenty of documentation (on the top of my head
http://developer.apple.com/iphone/library/documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/Performance/Performance.html#//apple_ref/doc/uid/TP40008793-CH105-SW5
) and i personally tried this.
I modified my code and got a 10 fps boost, then modified SDL_render_gles and
shifted from 40 fps to 50 fps alone -- considering that i started from ~30fps i
got an 80% performance increase with this technique.

I have attached a dif of my changes, hope that it will be included in
mainstream.
2011-01-19 23:56:16 -08:00
Sam Lantinga
c83a4f491a Fixed bug #1028
pelya      2010-07-21 04:54:41 PDT

GLES_UpdateTexture() ignores pitch value, because of that some textures created
with SDL_CreateTextureFromSurface() are drawn incorrectly, especially if image
width is not multiplier of 2.
2011-01-19 23:47:50 -08:00
Sam Lantinga
6ca1a21e90 Fixed bug #1027
Vittorio Giovara      2010-07-17 19:21:36 PDT

fix the double free error

in SDL_uikitview the variable 'textfield' is initialialized and set to
autorelease.
however in the dealloc method a second [release] is sent.
If the textfield has not been set to nil before (with a viewDidUnload for
example) this can lead to awful hard-to-find crashes when the SDL code
terminates.

the error message is
-[textfield release] message sent to deallocated instance 0x4e5fa90

the fix is simple, just release the object as soon as it is added to the
subview, see attached patch
2011-01-19 23:45:29 -08:00
Sam Lantinga
d708760569 John Wilson 2010-08-17 17:09:16 PDT
The are no event handlers for the middle mouse button, right mouse buttons, and
mouse wheel in the latest HG revision 4636. It has been like this for 3 months.
I made a patch for this, though I'm not sure if the Xbutton or mouse wheel code
is "correct" by your standards.
2011-01-19 22:39:02 -08:00
Sam Lantinga
ed1f29af7d PS3 Linux is no more... 2011-01-19 22:25:40 -08:00
Sam Lantinga
05e196a519 Nobody has stepped up to maintain an svgalib driver. Bye bye! :) 2011-01-19 22:21:31 -08:00
Sam Lantinga
8fb4ff28fb Nobody has stepped up to maintain a framebuffer console driver. Bye bye! :) 2011-01-19 22:18:45 -08:00
Sam Lantinga
de5e018177 Removed debug print statements 2011-01-19 19:51:04 -08:00
Sam Lantinga
78c08f9736 Florian Forster to sdl
in SDL 1.3 (revision 5508 from SVN), the method used to calculate the
bits per pixel from a “int format” differ between “SDL_ListModes” (which
always uses the “SDL_BITSPERPIXEL” macro) and “SDL_PixelFormatEnumTo-
Masks” (which uses either “SDL_BITSPERPIXEL” or “SDL_BYTESPERPIXEL * 8”,
depending on the value of “SDL_BYTESPERPIXEL”).

Because the values are later compared in “SDL_ListModes” this may lead
to some valid video modes not being returned. In my case the only mode
returned by “SDL_GetNumDisplayModes” was dismissed and NULL was
returned. (This led to the calling application sticking its head in the
sand.)

The attached patch copies the method used within “SDL_PixelFormatEnumTo-
Masks” to “SDL_ListModes”. This solved the problem for me though I don't
fully understand the method used by “SDL_PixelFormatEnumToMasks”.
2011-01-19 16:06:47 -08:00
Sam Lantinga
c7f4cb45f8 Window move events have the same problem as size events on Windows 2011-01-19 16:02:15 -08:00
Sam Lantinga
5b8cfdabf7 Normalized line endings 2011-01-19 13:44:55 -08:00
Sam Lantinga
de31f7c2e6 Raw input is no longer used. Yay! 2011-01-19 13:44:44 -08:00
Sam Lantinga
13ed617751 Added XFlush() so changes happen immediately instead of waiting for the next event loop. 2011-01-19 10:14:11 -08:00
Sam Lantinga
9a91680ace Whoops, good catch from Greg Jandl 2011-01-18 22:10:37 -08:00
Sam Lantinga
e89ef55e05 Fixed build against 10.4 SDK 2011-01-18 14:57:39 -08:00
Sam Lantinga
5716390ec1 Fixed compiler error with the latest Xcode package 2011-01-18 14:26:30 -08:00
Sam Lantinga
b8df61a201 Use compiler intrinsics on Windows 2011-01-17 14:05:43 -08:00
Sam Lantinga
aea7e124a9 Fixed compiler warning about symbol redefinition 2011-01-16 17:47:52 -08:00
Sam Lantinga
c94b5b6866 Include windows.h in SDL_atomic.h by default, but don't include the atomic API in SDL.h
This allows all SDL code to take advantage of the atomic intrinsics on Windows, but doesn't cause applications just including SDL.h to pull in windows.h
2011-01-16 17:45:42 -08:00
Sam Lantinga
89d48a0f83 Added native atomic operations for Windows, Mac OS X, and gcc compiler intrinsics.
Changed the CAS return value to bool, so it's efficient with OSAtomicCompareAndSwap32Barrier()
Added an atomic test adapted from code by Michael Davidsaver
2011-01-16 15:16:39 -08:00
Sam Lantinga
38e31e4598 Updated the atomic API for better use cases 2011-01-15 12:41:59 -08:00
Sam Lantinga
4558d7576e Added "mouse" support for the Android touch screen 2011-01-13 18:31:15 -08:00
Sam Lantinga
a80a7c1347 Cleaned up internal accelerometer interface 2011-01-13 18:03:56 -08:00
Sam Lantinga
686f35737f Make sure we shut down the app if SDL_main() returns instead of exiting. 2011-01-13 17:13:00 -08:00
Sam Lantinga
271a5e7540 The window is changed to reflect the actual screen dimensions, for now.
Implemented SDL_SetWindowTitle(), which turned out to be fairly complex
2011-01-13 15:10:17 -08:00
Sam Lantinga
edcfdea827 Removed code from GetPrimtiveArrayCritical() experiment 2011-01-13 12:36:59 -08:00
Sam Lantinga
9a23f9d63a Fixed audio buffer lifecycle and implemented audio shutdown 2011-01-13 12:32:55 -08:00
Sam Lantinga
46004aa2fe Working audio implementation contributed by Joseph Lunderville 2011-01-13 11:14:20 -08:00
Sam Lantinga
6887872f27 Added missing header 2011-01-13 09:15:51 -08:00
Sam Lantinga
d83df90435 Implemented translation from Android keycodes to SDL scancodes 2011-01-12 21:21:21 -08:00
Sam Lantinga
03bc98ed24 Added an extra line for consistency 2011-01-12 21:21:08 -08:00
Sam Lantinga
0b56f35597 Improved error message for unsupported texture format 2011-01-12 19:33:04 -08:00