Commit graph

3868 commits

Author SHA1 Message Date
Sam Lantinga
ada074623f Fixed Android build 2011-01-24 21:31:32 -08:00
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
1775cf40fd Fixed bug #1102
Check /usr/local/bin for hg before sourcing the user's bash settings
2011-01-24 17:47:18 -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
d5b9e9676a Fixed bug #1103
The SDL_blendmode.h and SDL_scalemode.h headers needed to be added to the Public Headers and all the public headers need to have the "Public" role set.
2011-01-24 16:10:13 -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
Ryan C. Gordon
14a0cb6fbc Whitespace change in a README. 2011-01-22 03:57:27 -05:00
Sam Lantinga
daecbfdc17 HAVE_GCC_ATOMICS covers the test and set 2011-01-21 21:45:55 -08:00
Sam Lantinga
b3e14d4341 Yeah, go iPhone! 2011-01-21 21:43:56 -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
68afef61c9 Fixed atomic intrinsic test 2011-01-21 21:35:43 -08:00
Sam Lantinga
075ff8e78f Fixed bug #859
CREATE_SUBDIRS helps a lot if browsing HTML documentation in a file browser.

ALWAYS_DETAILED_SEC makes sure everything has at least the automatic
documentation like function prototype and source references.

STRIP_FROM_PATH allows you to include only the relevant portions of the files'
paths, cleaning up both the file list and directory tree, though you need to
change the path listed here to match wherever you put SDL.

ALIASES avoids some warnings generated by
C:\source\svn.libsdl.org\trunk\SDL\src\joystick\darwin\10.3.9-FIX\IOHIDLib.h.
It seems Apple uses a few commands which are not normally supported by Doxygen.

BUILTIN_STL_SUPPORT adds support for parsing code which makes use of the
standard template library.  There isn't a lot of C++ in SDL (some in bwindow at
least), but this still seems like a good idea.

TYPEDEF_HIDES_STRUCT means that for code like this:
typedef struct A {int B;} C;
C is documented as a structure containing B instead of a typedef mapped to A.

EXTRACT_ALL, EXTRACT_PRIVATE, EXTRACT_STATIC, EXTRACT_LOCAL_METHODS,
EXTRACT_ANON_NSPACES and INTERNAL_DOCS make sure that _everything_ is
documented.

CASE_SENSE_NAMES = NO avoids potential conflicts when building documentation on
case insensitive file systems like NTFS and FAT32.

WARN_NO_PARAMDOC lets you know when you have documented some, but not all, of
the parameters of a function.  This is useful when you're working on adding
such documentation since it makes partially documented functions easier to
spot.

WARN_LOGFILE writes warnings to a seperate file instead of mixing them in with
stdout.  When not running in quiet mode, these warnings can be hard to spot
without this flag.

I added *.h.in and *.h.default to FILE_PATTERNS to generate documentation for
config.h.in and config.h.default.

RECURSIVE tells doxygen to look not only in the input directory, but also in
subfolders.

EXCLUDE avoids documenting things like test programs, examples and templates
which need to be documented separately.

I've used EXCLUDE_PATTERNS to exclude non-source subdirectories that often find
their way into source folders (such as obj or .svn).

EXAMPLE_PATH lists directories doxygen will search to find included example
code.  So far, SDL doesn't really use this feature, but I've listed some likely
locations.

SOURCE_BROWSER adds syntax highlighted source code to the HTML output.
USE_HTAGS is nice, but not available on Windows.

INLINE_SOURCES adds the body of a function to it's documentation so you can
quickly see exactly what it does.

ALPHABETICAL_INDEX generates an alphabetical list of all structures, functions,
etc., which makes it much easier to find what you're looking for.

IGNORE_PREFIX skips the SDL_ prefix when deciding which index page to place an
item on so you don't have everything show up under "S".

HTML_DYNAMIC_SECTIONS hides the includes/included by diagrams by default and
adds JavaScript to allow the user to show and hide them by clicking a link.

ENUM_VALUES_PER_LINE = 1 makes enums easier to read by placing each value on
it's own line.

GENERATE_TREEVIEW produces a two frame index page with a navigation tree on the
left.

I have LaTeX and man pages turned off to speed up doxygen, you may want to turn
them back on yourself.

I added _WIN32=1 to PREDEFINED to cause SDL to output documentation related to
Win32 builds of SDL.  Normally, doxygen gets confused since there are multiple
definitions for various structures and formats that vary by platform.  Without
this doxygen can produce broken documentation or, if you're lucky, output
documentation only for the dummy drivers, which isn't very useful.  You need to
pick a platform.

GENERATE_TAGFILE produces a file which can be used to link other doxygen
documentation to the SDL documentation.

CLASS_DIAGRAMS turns on class diagrams even when dot is not available.

HAVE_DOT tells doxygen to try to use dot to generate diagrams.

TEMPLATE_RELATIONS and INCLUDE_GRAPH add additional diagrams to the
documentation.

DOT_MULTI_TARGETS speeds up dot.

OUTPUT_DIRECTORY, INPUT and other paths reflect the fact that this Doxyfile is
intended to process src as well as include and is being run from a separate
subdirectory.  Doxygen produces several temporary files while it's running and
if interrupted, can leave those files behind.  It's easier to clean up if there
aren't a hundred or so files in the same folder.  I typically run doxygen in
SDL/doxy and set the output directory to '.'.  Since doxygen puts it's output
in subfolders by type, this keeps things pretty well organised.  You could use
'../doc' instead and get the same results.
2011-01-21 12:57:01 -08:00
Sam Lantinga
a03da6f07a Fixed bug #945
The configure script was breaking the substitutions into multiple fragments, breaking them across the substitution for the build rules.  This of course totally hosed the process.

I switched to using a more modern usage of AC_OUTPUT and added a post-process step that appends the build rules to the Makefile.
2011-01-21 12:43:25 -08:00
Sam Lantinga
a16a7de8d1 Fixed compile error on Mac OS X 2011-01-21 11:23:19 -08:00
Sam Lantinga
b5141783ba Fixed bug #929
Changed _WINDOWS to __WINDOWS__
2011-01-20 18:42:41 -08:00
Sam Lantinga
d257c63c2f You can't have an empty union in the structure... 2011-01-20 18:09:55 -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
Ryan C. Gordon
aed4e90c9a Disable .hgeol for now...it doesn't work well at the moment.
--HG--
rename : .hgeol => .DISABLED-hgeol
2011-01-20 11:51:23 -05:00
Ryan C. Gordon
e17ec2763f Added .hgeol to handle file EOL conversion.
Don't forget to add "eol =" to the "[extensions]" section of your .hgrc!
2011-01-20 11:23:15 -05: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
6642f38cf1 SDL doesn't depend on GLU, and overwhelming feedback from the mailing list is that people don't want it included in SDL_opengl.h 2011-01-19 22:55:51 -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
75ed99ed6a Clearing the API changes for the 1.3.0 release 2011-01-19 22:20:44 -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
f69bce6999 Fixed using the native iconv library 2011-01-19 15:28:01 -08:00
Sam Lantinga
7c85ff217e Fixed test for libiconv 2011-01-19 15:02:11 -08:00
Sam Lantinga
de8bd33888 Use the debug C runtime for the debug configuration 2011-01-19 13:50:53 -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