Commit graph

2909 commits

Author SHA1 Message Date
Sam Lantinga
f98d804282 Only include windows.h on Windows. :) 2011-01-24 21:22:00 -08:00
Sam Lantinga
b4497865bd Include windows.h in a single point in the source, so we can be consistent about the definition of UNICODE and have core utility functions for Windows that all modules can share.
I think this also fixes the bug relating to non-latin characters in filenames, since UNICODE wasn't defined in SDL_rwops.c

--HG--
rename : src/SDL_android.cpp => src/core/android/SDL_android.cpp
rename : src/SDL_android.h => src/core/android/SDL_android.h
2011-01-24 21:20:30 -08:00
Sam Lantinga
065e4e3f9d Fixed bug #1100
Test the video features with #if instead of #ifdef
2011-01-24 17:38:18 -08:00
Sam Lantinga
10b8372bd3 Fixed compiling on Windows Mobile SDK 5.0 with Visual Studio 2008 2011-01-24 15:46:11 -08:00
Sam Lantinga
b33881a48e Fixed compile error 2011-01-24 15:10:16 -08:00
Sam Lantinga
c330005880 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
a2f2302255 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
477689ac83 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
f3716d8a4e Fixed size_t warnings on 64-bit build 2011-01-22 15:58:21 -08:00
Sam Lantinga
dcd48df016 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
c4bf458e47 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
daecbfdc17 HAVE_GCC_ATOMICS covers the test and set 2011-01-21 21:45:55 -08:00
Sam Lantinga
2c31531800 Separated out the minimum functionality that we need from gcc for our spinlock fallback. 2011-01-21 21:42:04 -08:00
Sam Lantinga
b5141783ba Fixed bug #929
Changed _WINDOWS to __WINDOWS__
2011-01-20 18:42:41 -08:00
Sam Lantinga
9d25ba272a Fixed bug #925
Changed "win32" to "windows"

--HG--
rename : include/SDL_config_win32.h => include/SDL_config_windows.h
rename : src/events/scancodes_win32.h => src/events/scancodes_windows.h
rename : src/haptic/win32/SDL_syshaptic.c => src/haptic/windows/SDL_syshaptic.c
rename : src/joystick/win32/SDL_dxjoystick.c => src/joystick/windows/SDL_dxjoystick.c
rename : src/joystick/win32/SDL_dxjoystick_c.h => src/joystick/windows/SDL_dxjoystick_c.h
rename : src/joystick/win32/SDL_mmjoystick.c => src/joystick/windows/SDL_mmjoystick.c
rename : src/loadso/win32/SDL_sysloadso.c => src/loadso/windows/SDL_sysloadso.c
rename : src/main/win32/SDL_win32_main.c => src/main/windows/SDL_windows_main.c
rename : src/main/win32/version.rc => src/main/windows/version.rc
rename : src/thread/win32/SDL_sysmutex.c => src/thread/windows/SDL_sysmutex.c
rename : src/thread/win32/SDL_syssem.c => src/thread/windows/SDL_syssem.c
rename : src/thread/win32/SDL_systhread.c => src/thread/windows/SDL_systhread.c
rename : src/thread/win32/SDL_systhread_c.h => src/thread/windows/SDL_systhread_c.h
rename : src/thread/win32/win_ce_semaphore.c => src/thread/windows/win_ce_semaphore.c
rename : src/thread/win32/win_ce_semaphore.h => src/thread/windows/win_ce_semaphore.h
rename : src/timer/win32/SDL_systimer.c => src/timer/windows/SDL_systimer.c
rename : src/video/win32/SDL_ceddrawrender.c => src/video/windows/SDL_ceddrawrender.c
rename : src/video/win32/SDL_ceddrawrender.h => src/video/windows/SDL_ceddrawrender.h
rename : src/video/win32/SDL_d3drender.c => src/video/windows/SDL_d3drender.c
rename : src/video/win32/SDL_d3drender.h => src/video/windows/SDL_d3drender.h
rename : src/video/win32/SDL_gapirender.c => src/video/windows/SDL_gapirender.c
rename : src/video/win32/SDL_gapirender.h => src/video/windows/SDL_gapirender.h
rename : src/video/win32/SDL_gapirender_c.h => src/video/windows/SDL_gapirender_c.h
rename : src/video/win32/SDL_gdirender.c => src/video/windows/SDL_gdirender.c
rename : src/video/win32/SDL_gdirender.h => src/video/windows/SDL_gdirender.h
rename : src/video/win32/SDL_msctf.h => src/video/windows/SDL_msctf.h
rename : src/video/win32/SDL_vkeys.h => src/video/windows/SDL_vkeys.h
rename : src/video/win32/SDL_win32clipboard.c => src/video/windows/SDL_windowsclipboard.c
rename : src/video/win32/SDL_win32clipboard.h => src/video/windows/SDL_windowsclipboard.h
rename : src/video/win32/SDL_win32events.c => src/video/windows/SDL_windowsevents.c
rename : src/video/win32/SDL_win32events.h => src/video/windows/SDL_windowsevents.h
rename : src/video/win32/SDL_win32gamma.c => src/video/windows/SDL_windowsgamma.c
rename : src/video/win32/SDL_win32gamma.h => src/video/windows/SDL_windowsgamma.h
rename : src/video/win32/SDL_win32keyboard.c => src/video/windows/SDL_windowskeyboard.c
rename : src/video/win32/SDL_win32keyboard.h => src/video/windows/SDL_windowskeyboard.h
rename : src/video/win32/SDL_win32modes.c => src/video/windows/SDL_windowsmodes.c
rename : src/video/win32/SDL_win32modes.h => src/video/windows/SDL_windowsmodes.h
rename : src/video/win32/SDL_win32mouse.c => src/video/windows/SDL_windowsmouse.c
rename : src/video/win32/SDL_win32mouse.h => src/video/windows/SDL_windowsmouse.h
rename : src/video/win32/SDL_win32opengl.c => src/video/windows/SDL_windowsopengl.c
rename : src/video/win32/SDL_win32opengl.h => src/video/windows/SDL_windowsopengl.h
rename : src/video/win32/SDL_win32shape.c => src/video/windows/SDL_windowsshape.c
rename : src/video/win32/SDL_win32shape.h => src/video/windows/SDL_windowsshape.h
rename : src/video/win32/SDL_win32video.c => src/video/windows/SDL_windowsvideo.c
rename : src/video/win32/SDL_win32video.h => src/video/windows/SDL_windowsvideo.h
rename : src/video/win32/SDL_win32window.c => src/video/windows/SDL_windowswindow.c
rename : src/video/win32/SDL_win32window.h => src/video/windows/SDL_windowswindow.h
rename : src/video/win32/wmmsg.h => src/video/windows/wmmsg.h
2011-01-20 18:04:05 -08:00
Sam Lantinga
ee1f71dd63 Fixed mouse button index for additional mouse buttons 2011-01-20 17:33:06 -08:00
Sam Lantinga
06050f8b15 Fixed mouse button index for additional mouse buttons 2011-01-20 17:29:13 -08:00
Jjgod Jiang
6a6cc495b4 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
6456acb47b Moved function for consistency 2011-01-20 17:11:22 -08:00
Jjgod Jiang
e666b3b289 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
5c9e54ea34 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
62dddd624d 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
92b3d10a29 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
7a1c6519f4 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
0595ce74e3 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
c4d74517e7 PS3 Linux is no more... 2011-01-19 22:25:40 -08:00
Sam Lantinga
008911fd8a Nobody has stepped up to maintain an svgalib driver. Bye bye! :) 2011-01-19 22:21:31 -08:00
Sam Lantinga
90a214c4e9 Nobody has stepped up to maintain a framebuffer console driver. Bye bye! :) 2011-01-19 22:18:45 -08:00
Sam Lantinga
c14d8951f3 Removed debug print statements 2011-01-19 19:51:04 -08:00
Sam Lantinga
e34085307a 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
1e7f74dc1b Window move events have the same problem as size events on Windows 2011-01-19 16:02:15 -08:00
Sam Lantinga
e18725689b Normalized line endings 2011-01-19 13:44:55 -08:00
Sam Lantinga
7f8a24afe8 Raw input is no longer used. Yay! 2011-01-19 13:44:44 -08:00
Sam Lantinga
1507fa272f Added XFlush() so changes happen immediately instead of waiting for the next event loop. 2011-01-19 10:14:11 -08:00
Sam Lantinga
5601ecaeae Whoops, good catch from Greg Jandl 2011-01-18 22:10:37 -08:00
Sam Lantinga
c53fea3bcc Fixed build against 10.4 SDK 2011-01-18 14:57:39 -08:00
Sam Lantinga
d16468c1cb Fixed compiler error with the latest Xcode package 2011-01-18 14:26:30 -08:00
Sam Lantinga
cdb1bda300 Use compiler intrinsics on Windows 2011-01-17 14:05:43 -08:00
Sam Lantinga
264e590e65 Fixed compiler warning about symbol redefinition 2011-01-16 17:47:52 -08:00
Sam Lantinga
d428d9d5a1 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
b0e0f61c7e 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
1bc8fe69ce Updated the atomic API for better use cases 2011-01-15 12:41:59 -08:00
Sam Lantinga
cab4e0652a Added "mouse" support for the Android touch screen 2011-01-13 18:31:15 -08:00
Sam Lantinga
70c916a415 Cleaned up internal accelerometer interface 2011-01-13 18:03:56 -08:00
Sam Lantinga
0ce4324420 Make sure we shut down the app if SDL_main() returns instead of exiting. 2011-01-13 17:13:00 -08:00
Sam Lantinga
9fa1d4876d 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
82e985a8ba Removed code from GetPrimtiveArrayCritical() experiment 2011-01-13 12:36:59 -08:00
Sam Lantinga
5b1882ee17 Fixed audio buffer lifecycle and implemented audio shutdown 2011-01-13 12:32:55 -08:00
Sam Lantinga
4f9db82a4c Working audio implementation contributed by Joseph Lunderville 2011-01-13 11:14:20 -08:00
Sam Lantinga
a409f9858f Added missing header 2011-01-13 09:15:51 -08:00