Commit Graph

3196 Commits

Author SHA1 Message Date
Ryan C. Gordon
8f4ad957bf Implement GL_GetProcAddress() for Android.
Fixes Bugzilla #1290.

Thanks to Gabriel Jacobo for the patch!
2011-10-13 01:30:01 -04:00
Kees Bakker
c988cd347c Do not use UIScreenMode to add a iOS display, always use the boundary
This solves the problem that on iPad you would get 1024x768 instead
of 768x1024 when calling SDL_GetDesktopDisplayMode(0, &mode)
See Apple's doc for UIScreenMode where is says:
"Most developers should never need to use the information provided
 by this class and should simply use the bounds provided by the
 UIScreen object for their drawing space."
2011-10-09 22:00:20 +02:00
Kees Bakker
bdd497f442 Merge upstream updates 2011-10-08 12:45:10 +02:00
Ryan C. Gordon
41f4356ae7 Disable thread naming on Windows for now.
We need the C runtime, which we don't link against, for __try/__except.
2011-10-02 00:59:11 -04:00
Ryan C. Gordon
79077a2d15 Patched to compile on Mac OS X (I think). 2011-10-02 00:49:52 -04:00
Ryan C. Gordon
ce0c9e37fd Further patched to compile on Windows. 2011-10-02 00:43:56 -04:00
Ryan C. Gordon
652f5a7622 Patched to compile on Windows. 2011-10-02 00:36:18 -04:00
Ryan C. Gordon
2ef51927fe 1.3 API CHANGE: Add support for naming threads. 2011-10-02 00:29:16 -04:00
Kees Bakker
89cfd42a6e Make SDL_uikitviewcontroller.window a real Objective-C property and synthesize 2011-09-28 21:42:02 +02:00
Kees Bakker
d51451a80d Minor code cleanup in uikit/SDL_uikitview.m (no functional changes) 2011-09-28 21:25:46 +02:00
Kees Bakker
63fb9ab391 Simplied the code a bit in uikit/SDL_uikitvideo.m 2011-09-28 21:13:09 +02:00
Kees Bakker
d996a17140 Remove unused SDL_uikitopenglview (privateMethods) 2011-09-28 21:03:05 +02:00
Kees Bakker
734912cea3 Use Objective-C construct for..in instead of oldfashioned C (uikit) 2011-09-28 20:32:26 +02:00
Sam Lantinga
6cd0d9d1ab Fixed to compile with pedantic C 2011-09-27 23:16:04 -04:00
Sam Lantinga
01f70098db ============================================================ 2011-09-27 23:15:01 -04:00
Sam Lantinga
a4d5f80c4b ============================================================ 2011-09-27 23:14:16 -04:00
Kees Bakker
fcf659d548 Do not exit in (uikit) postFinishLaunch but store the exit status and use that to return from main()
Also cleanup the stored argv in main() instead of postFinishLaunch.
2011-09-27 23:49:24 +02:00
Kees Bakker
d66afe2cb6 Cleanup of the use of include files in src/video/uikit 2011-09-27 23:40:21 +02:00
Kees Bakker
0e7f5aaa9c Use a consistent source code format in src/video/uikit
For example:
* Opening bracket of a method/function on a new line at column 0
* space after "if", "while", etc
2011-09-27 22:51:26 +02:00
Kees Bakker
4f86248f88 Remove INDENT-ON INDENT-OFF comments in src/video/uikit
These comments are only useful for running indent which we are
probably not going to use in Objective-C context.
2011-09-27 21:07:09 +02:00
Kees Bakker
6f098b503d Cleanup out trailing whitespace in src/video/uikit 2011-09-27 21:02:26 +02:00
Ryan C. Gordon
4e42ccb0ae Replaced a sanity check with an SDL_assert(). 2011-09-21 02:42:25 -04:00
Ryan C. Gordon
7c206c10b5 Don't call pthread_exit(), returning from RunThread() is equivalent. 2011-09-20 17:48:29 -04:00
Ryan C. Gordon
a2878205f5 Simplified Windows RunThread().
Removed checks for things that are always true, free unneeded struct before
 calling thread entry point, instead of after thread completes.
2011-09-20 17:42:58 -04:00
Ryan C. Gordon
ef9602f026 Implemented x86 and x86-64 spinlock inline asm.
Favor it over Mac OS X API for Intel systems (but not GCC atomic intrinsics).

This might get us a little further on Cygwin builds, too.
2011-09-18 03:19:41 -04:00
Ryan C. Gordon
62cdeb1783 Use an actual #error instead of a bogus symbol if there's no spinlock support. 2011-09-18 02:55:45 -04:00
Ryan C. Gordon
b5688aca8a Patched to compile on some platforms. 2011-09-18 02:09:20 -04:00
Andreas Schiffler
a76b8e0292 Add special cases for empty rectangles in SDL_Rect functions 2011-09-17 22:35:57 -07:00
Ryan C. Gordon
a01b9d69d6 Removed some FIXMEs (Nathan's changes were, in fact, correct). 2011-09-15 23:55:36 -04:00
Ryan C. Gordon
fe04e23133 Merged Nathan Heisey's Haiku work into the main SDL 1.3 branch.
This was a Google Summer of Code 2011 project, sponsored by the Haiku project.

We thank Nathan and the other Haiku developers for their support!
2011-09-15 23:51:07 -04:00
Ryan C. Gordon
b84e7104b1 Clean up the win32 compiler warnings for SDL threads, in the 1.3 branch. 2011-09-12 13:36:38 -04:00
Andreas Schiffler
d8556266a2 Fix regression introducted by added parameter check in SDL_EnclosePoints. Add special case to speedup when no result was requested. 2011-09-12 09:00:01 -07:00
Ryan C. Gordon
079d39970c More work on cleaning out compiler warnings. 2011-09-11 04:02:40 -04:00
Ryan C. Gordon
54294f986d Some MMX fixes from Patrick Baggett.
Original email...

Date: Sat, 10 Sep 2011 13:01:20 -0500
From: Patrick Baggett
To: SDL Development List <sdl@lists.libsdl.org>
Subject: Re: [SDL] SDL_memcpyMMX uses SSE instructions

In SDL_blit_copy.c, the function SDL_memcpyMMX() actually use SSE
instructions.

It is called in this context:

#ifdef __MMX__
    if (SDL_HasMMX() &&
        !((uintptr_t) src & 7) && !(srcskip & 7) &&
        !((uintptr_t) dst & 7) && !(dstskip & 7)) {
        while (h--) {
            SDL_memcpyMMX(dst, src, w);
            src += srcskip;
            dst += dstskip;
        }
        _mm_empty();
        return;
    }
#endif

This implies that the minimum CPU features are just MMX. There is a
separate SDL_memcpySSE() function.


The SDL_memcpyMMX() function does:

#ifdef __SSE__
        _mm_prefetch(src, _MM_HINT_NTA);
#endif

...which tests at compile time if SSE intrinsics are available, not at run
time. It generates the PREFETCHNTA instruction. It also uses _mm_stream_pi()
intrinsic, which generates the MOVNTQ instruction.

If you replace the "MMX" code with:

__m64* d64 = (__m64*)dst;
__m64* s64 = (__m64*)src;
 for(i= len / 64; i--;) {
   d64[0] = s64[0];
   d64[1] = s64[1];
   d64[2] = s64[2];
   d64[3] = s64[3];
   d64[4] = s64[4];
   d64[5] = s64[5];
   d64[6] = s64[6];
   d64[7] = s64[7];
   d64 += 8;
   s64 += 8;
 }

Then MSVC generates the correct movq instructions. GCC (4.5.0) seems to
think that using 2x movl is still better, but then again, GCC isn't actually
that good at optimizing intrinsics as I've found. At least the code won't
crash on my P2 though. :)

Also, there is no requirement for MMX to be aligned to the 8th byte. I
think the author assumed that SSE's 16 byte alignment requirement must
retroactively mean that MMX requires 8 byte alignment. Attached is the full
patch.

Patrick
2011-09-11 01:54:54 -04:00
Ryan C. Gordon
7adf4f848a Fixed a compiler warning. 2011-09-09 04:48:45 -04:00
Ryan C. Gordon
e612bfc336 Added a newline to the end of a file to quiet old versions of GCC. 2011-09-09 02:43:04 -04:00
Ryan C. Gordon
82df1959c1 Removed legacy Mac OS X dlcompat code.
It was only needed for Mac OS X 10.0 through 10.2, so it seems silly to keep
 it around for SDL 1.3.

I'll leave it in the 1.2 branch for now, though.
2011-09-09 00:34:48 -04:00
Ryan C. Gordon
4efdd10e16 Fixed compiler warning on 32-bit Mac OS X. 2011-09-07 10:54:14 -04:00
Andreas Schiffler
15eed4cdc2 Added input parameter validation to some SDL_rect functions 2011-09-04 20:34:48 -07:00
Ryan C. Gordon
9b301501da Fixed a compiler warning on Mac OS X.
Thanks to Mattias Holm for the patch!
2011-09-02 14:00:57 -04:00
Ryan C. Gordon
8ad5dc2b68 Fixed a NSLog() format string.
Thanks to Mattias Holm for the patch!
2011-09-02 14:00:10 -04:00
Ryan C. Gordon
95221a071a Patched to compile. 2011-09-01 14:02:12 -04:00
Ryan C. Gordon
d3c8a17a2d Called method on wrong object in Android exception handler.
Fixes Bugzilla #1297.

Thanks to jon @ rafkind for the patch!
2011-09-01 04:42:09 -04:00
Ryan C. Gordon
03425cf382 Removed unused variable. 2011-09-01 04:34:05 -04:00
Ryan C. Gordon
439009a9d5 Clean up any opened joysticks during SDL_JoystickQuit().
Otherwise, these leak memory and maybe operating system handles.
2011-09-01 04:25:15 -04:00
Ryan C. Gordon
370cdc709c Automated merge with https://bitbucket.org/Markusk/sdl-gsoc 2011-08-29 13:17:07 -04:00
Ryan C. Gordon
d37f894242 Added support for multitouch on Android.
Fixes Bugzilla #1294.

Thanks to Gabriel Jacobo for the patch!
2011-10-13 01:21:35 -04:00
Ryan C. Gordon
bebad17430 Fixed a whole slew of compiler warnings that -Wall exposed. 2011-10-13 01:08:30 -04:00
Ryan C. Gordon
a144640635 Make sure window->driverdata is set before we might need it.
Thanks to Mako_energy for the fix!
2011-10-12 20:01:09 -04:00
Ryan C. Gordon
73fbe0cd92 Commit updated generated C code. 2011-10-11 22:42:54 -04:00
Ryan C. Gordon
bd5cf5489e Fixed compiler warning for unused variable in generated C code. 2011-10-11 22:35:19 -04:00
Ryan C. Gordon
0a99c98e86 Fixed perl string escaping thing. 2011-10-11 22:34:52 -04:00
Tim Angus
edc8ca6ac0 * Fix many memory leaks in Android FS code
* Set SDL error string with Java exception details when one occurs
* Fix tabulation of SDLActivity::getContext
2011-08-26 13:11:53 +01:00
Ryan C. Gordon
1248146aa2 Removed the MAC_OS_X_VERSION_10_x macros from the 1.3 branch. 2011-08-25 03:11:28 -04:00
Ryan C. Gordon
d58d3cf9d0 Patched to compile on Windows. 2011-08-23 16:47:22 -04:00
Ryan C. Gordon
a52dac6020 Cleaned out functions deprecated in Mac OS X 10.6 SDK. 2011-08-23 15:17:44 -04:00
Ryan C. Gordon
043d6961da Fixed wrong datatype for shaders and programs.
This is a pointer on Mac OS X, so it risked losing data in 64-bit builds.
2011-08-23 06:27:04 -04:00
Nathan Heisey
2922ec5c93 Fixed static misnomers 2011-08-22 21:07:16 +00:00
Nathan Heisey
cd1d00c8bc Partially cleaned out code 2011-08-22 11:02:05 +00:00
Nathan Heisey
66b34b9372 Temporary mode-setting hack works 2011-08-20 15:16:13 +00:00
Kees Bakker
1a888b5860 Split off SDL_uikitviewcontroller in its own module 2011-08-17 23:26:58 +02:00
Ryan C. Gordon
27c0f06736 Further XAudio2 build test cleanups. 2011-08-22 14:56:46 -04:00
Ryan C. Gordon
3bd23ad70f Removed SDL_xaudio2.h ... no real need for this to be separate. 2011-08-22 14:37:45 -04:00
Ryan C. Gordon
8dddad9b87 Let XAudio2 target be removed from the build by removing it from SDL_config.h 2011-08-22 14:30:49 -04:00
Ryan C. Gordon
9ef6d797b4 Apple's C runtime has the non-const iconv(), too. 2011-08-22 14:25:11 -04:00
Ryan C. Gordon
1230f810bd Fixed compiler warning on 64-bit builds. 2011-08-22 13:41:35 -04:00
Ryan C. Gordon
8948722528 RLE: Don't trash alpha channel in copy_32().
It was being set to (mask|value) instead of (value).

Thanks to li zhuo for the bug report!
2011-08-22 13:34:58 -04:00
Ryan C. Gordon
89b8d559fd Apparently glXSwapIntervalEXT() _does_ return a value.
Revision 6 of the GLX_EXT_swap_control spec has a typo; the function
signature they list is void, but the docs talk about a return value, and the
glxext.h headers list "int".
2011-08-22 02:26:11 -04:00
Ryan C. Gordon
a13987a2cc Fix SDL_GL_ACCELERATED_VISUAL on Windows in the 1.3 branch.
Fixes Bugzilla #1254.

Thanks to Thilo Schulz for the patch!
2011-08-21 12:24:27 -04:00
Ryan C. Gordon
979f801b08 Ported ALSA minimum-sample-count fix from 1.2 branch to 1.3. 2011-08-21 11:52:21 -04:00
Ryan C. Gordon
da15752375 Make sure XAudio2 is supported by the DirectX headers at compile time. 2011-08-21 02:35:13 -04:00
Kees Bakker
0495a4f9da Convert a few TABs into spaces 2011-08-18 22:43:37 +02:00
Nathan Heisey
04be166879 Fixed some problems with switching to/from fullscreen 2011-08-17 13:31:18 +00:00
Ryan C. Gordon
d71e865584 Patched to compile. 2011-08-15 02:51:13 -04:00
Sam Lantinga
f60d3a845a Don't lose the icon surface if it's freed immediately after SDL_WM_SetIcon()
This is a memory leak, but we don't have a good place to free the icon surface a the moment.
2011-08-14 21:57:50 -04:00
Nathan Heisey
3979f76d39 Reduced SEGFAULT occurence on resize? 2011-08-12 16:58:54 +00:00
Nathan Heisey
c5f9b27f63 Fixed OpenGL library loading functions 2011-08-09 16:34:25 +00:00
Nathan Heisey
58e7261c23 Some video fixes 2011-08-08 17:00:38 +00:00
Ryan C. Gordon
de42332c37 Patched to compile on Mac OS X. 2011-08-06 02:15:23 -04:00
Ryan C. Gordon
a82582941c X11 touch handling fixed for one device (LPC32xx Touchscreen). 2011-08-05 00:55:29 -04:00
Ryan C. Gordon
b5dce54a48 Patched to compile on Linux.
(Grumble grumble, should have tested better after all the history editing...)
2011-08-05 00:48:56 -04:00
Ryan C. Gordon
968b82c8b8 Patched to compile. 2011-08-04 19:33:45 -04:00
Ryan C. Gordon
e57312411f Removed some Windows endlines. 2011-08-04 01:36:23 -04:00
Ryan C. Gordon
6634d3d1fe Merged Mac OS X and iOS audio targets. 2011-08-04 00:45:09 -04:00
Nathan Heisey
9735503a62 Replaced window backbuffer with BBitmap 2011-08-03 06:22:33 +00:00
Nathan Heisey
471f9671f4 Fixed minor rendering issues. 2011-08-03 05:09:36 +00:00
Nathan Heisey
d382b471a1 Framebuffer code moved to SDL_bframebuffer.*, OpenGL support began 2011-07-30 18:26:13 +00:00
Nathan Heisey
099fe9c709 Render thread partially corrected 2011-07-28 18:21:38 +00:00
Nathan Heisey
2c7000dcf4 Moved draw code to a separate thread 2011-07-27 11:06:38 +00:00
Ryan C. Gordon
142fdca2c2 Removed no-op Deinitialize methods in audio drivers. 2011-07-26 14:20:22 -07:00
Ryan C. Gordon
9bcc29c934 Removed needless macros in various audio targets. 2011-07-26 14:18:00 -07:00
Ryan C. Gordon
78bf250a21 Cleaned up audio device detection. Cleared out a lot of cut-and-paste. 2011-08-04 00:31:11 -04:00
Ryan C. Gordon
854a2e9098 Implemented XAudio2 target for Windows (and Xbox360, theoretically!). 2011-08-04 01:07:09 -04:00
Ryan C. Gordon
4c406bc202 Cleaned up CoInitialize() politics on Windows. 2011-08-03 04:22:47 -04:00
Ryan C. Gordon
94fa3d973d Added some FIXMEs. 2011-08-04 01:07:13 -04:00
Nathan Heisey
18b65c8206 Corrected keyboard input support 2011-07-26 17:48:40 +00:00
Nathan Heisey
2191935f54 Fixed mouse move problem 2011-07-26 11:38:20 +00:00
Nathan Heisey
fa935c5ddb Fixed seg fault on video quit 2011-07-26 10:13:34 +00:00
Nathan Heisey
fe972339e7 Variable name/debugging output changes 2011-07-25 16:46:55 +00:00
Nathan Heisey
c89a331925 Corrected framebuffer creation problem 2011-07-25 13:47:19 +00:00
Ryan C. Gordon
9391731cf9 Took out some more bitfields in the audio subsystem. 2011-07-22 16:09:13 -07:00
Ryan C. Gordon
7de8cc401e Reworked Windows waveOut code.
Implemented multi-device support, changed name to "winmm".
2011-08-04 01:24:22 -04:00
Ryan C. Gordon
26705b7afc Reworked Windows DirectSound code.
Now supports multiple devices, and uses DirectSound 8 instead of 5. Changed
name to "directsound" and renamed source directory.
2011-08-04 01:26:12 -04:00
Ryan C. Gordon
8b3e5696da Removed /dev/dsp DMA audio target. 2011-07-24 03:37:13 -07:00
Ryan C. Gordon
b967eec1ab Mark some QSA audio driver functions as static. 2011-07-26 13:42:34 -07:00
Ryan C. Gordon
4ef8847cc5 Allow Android platforms to read from .apk files via the RWOPS interface.
Fixes Bugzilla #1261.

Thanks to Tim Angus for the patch!
2011-07-29 16:51:25 -04:00
Ryan C. Gordon
3fb89b23e8 Patched to compile (I hope). 2011-07-27 18:07:40 -04:00
Ryan C. Gordon
95dc99af0f If we didn't create win32 window, restore its event procedure on destruction. 2011-07-25 15:03:42 -07:00
Nathan Heisey
780d3a19d3 Corrected memory leak with rendering. 2011-07-22 16:54:23 +00:00
Nathan Heisey
d2f022bedf Drawing code works, but it flashes 2011-07-22 12:39:53 +00:00
Ryan C. Gordon
632f5e5860 Removed comment questioning the code's correctness (the answer: it's correct). 2011-07-22 00:12:03 -07:00
Ryan C. Gordon
fa2029820d Don't use a bitfield for this.
It pads out to an int anyhow, but causes code bloat as the compiler tries to
 mask and shift for that specific bit.
2011-07-22 00:09:58 -07:00
Ryan C. Gordon
75d8b324e2 Work on systems without sa_sigaction. 2011-07-20 16:35:37 -07:00
Nathan Heisey
4ae944ae03 Framebuffer support in progress. 2011-07-20 19:25:38 +00:00
Ryan C. Gordon
6e06033e19 Patched to compile on older GLX headers. 2011-07-18 14:55:24 -07:00
Ryan C. Gordon
c39a95c4c9 Added support for GLX_EXT_swap_control, and cleaned up some other extensions.
This allows the Nvidia Linux drivers to use SDL_GL_SetSwapInterval(0).
2011-07-18 14:34:19 -07:00
Ryan C. Gordon
903ae49a65 The SwapInterval APIs should fail without a current OpenGL context. 2011-07-18 14:31:37 -07:00
Ryan C. Gordon
b5e613302b Record the new OpenGL context as current during SDL_GL_CreateContext(). 2011-07-18 14:30:46 -07:00
Andreas Schiffler
f4722e408f Fixed SDL_SetError() by making NULL fmt a no-op, update test automation 2011-07-17 20:59:34 -07:00
Nathan Heisey
b71435641b Should compile now (fixed typos(?)) 2011-07-14 17:58:47 +00:00
Nathan Heisey
228b42d47d Fixed video compile(?) 2011-07-13 09:37:00 +00:00
Nathan Heisey
e64e5c11cd Renamed all .c files in src/video/bwindow to .cc files. 2011-07-13 09:29:43 +00:00
Nathan Heisey
6afccaa104 Removed 1.2 files. 2011-07-12 15:09:44 +00:00
Nathan Heisey
8493175cfc Rewrote most of Haiku video support to conform with 1.3 functionality. 2011-07-12 15:06:12 +00:00
Nathan Heisey
b2716ca0a3 Replaced private event functionality with event sending. 2011-06-24 12:48:43 +00:00
Nathan Heisey
6d2a50bca5 SDL 1.3 patch 00 for GSoC: Haiku - Implemented pthread spinlock in src/atomic/spinlock.c (in both trylock and
unlock).  Added appropriate checks in configure.in and include/SDL_configure.h.in.
2011-06-21 13:49:14 +00:00
Tim Angus
b0a6024896 * Add missing file SDL_hints_c.h 2011-06-15 10:28:01 +01:00
Tim Angus
e4de79558c * SDL_IOS_IDLE_TIMER_DISABLED hint 2011-06-10 14:23:36 +01:00
Tim Angus
2b47e23dc8 * SDL_IOS_ORIENTATIONS hint 2011-06-10 14:23:24 +01:00
Dimitris Zenios
316ae21313 Fixes a bug in SDL_UpdateTexture when using SDL_RENDERER_SOFTWARE and texture access is SDL_TEXTUREACCESS_STATIC 2011-06-10 12:13:06 +03:00
Ryan C. Gordon
41447caf1c Fixed memory leak in SDL_DestroyRenderer.
Fixes Bugzilla #1219.

Thanks to Dimitris Zenios for the patch!
2011-07-16 14:59:12 -07:00
Ryan C. Gordon
ce1df1e5db Cocoa: Update the current GL context when its window moves or resizes.
According to the NSOpenGLContext docs, you need to do this, and we were
 previously masking the need in the SDL_GL_MakeCurrent() implementation.
2011-07-16 11:52:09 -07:00
Ryan C. Gordon
36c9edd0e8 Turn SDL_GL_MakeCurrent() into a no-op if setting the same context twice. 2011-07-15 17:05:32 -07:00
Ryan C. Gordon
9a3d27d57c Linux: Search a smaller set of potential joystick axes.
Newer kernels seem to report bogus axes in the higher ranges, for example
 with a standard PlayStation 3 controller plugged in via USB.
2011-07-13 17:38:09 -07:00
Ryan C. Gordon
e476289e0f Properly set up default resolutions.
Fixes Bugzilla #1191.

Thanks to Jeremy Jurksztowicz for the fix!
2011-07-05 22:05:56 -04:00
Nathan Heisey
65e5a15393 Implemented pthread spinlocks. 2011-06-22 10:33:48 +00:00
Ryan C. Gordon
6b540e88b1 Assert code's stdio interface was reading from the wrong variable.
Thanks to Frank Zago for the catch.
2011-06-03 16:03:10 -04:00
Ryan C. Gordon
b19ae59651 Make assert dialog work on Cocoa target even if we haven't initialized video. 2011-04-20 15:14:18 -04:00
Ryan C. Gordon
1b953ac714 Removed assertion list terminator (just do it like a normal linked list). 2011-04-19 14:12:56 -04:00
Sam Lantinga
e2dc086a37 Fixed: Windows always fails with SDL_HapticOpenFromJoystick
The windows function SDL_SYS_HapticOpenFromJoystick fails because DIDEVICEINSTANCE joy_instance does not have its dwSize field initialized.  The attached patch includes the fix along with a fix for two similar problems.

Daniel Heath
2011-04-19 08:08:50 -07:00
Sam Lantinga
117146456c Removed buggy and LGPL MMX mixing routines. 2011-04-08 13:16:33 -07:00
Sam Lantinga
6196aa221e SDL 1.3 is now under the zlib license. 2011-04-08 13:03:26 -07:00
Sam Lantinga
52fa6cb6d1 Fixed build error 2011-04-06 17:10:14 -07:00
Sam Lantinga
ed324740c2 Allow overriding the app delegate on iOS
Vittorio G.  to Eric, Sam

Actually this is much simpler than i thought, I just had to specify a
class method to get the delegate name and then the category can
override that method!
I've attached the patch that enables this features: in my code i could
remove my custom main() and simply add

@implementation SDLUIKitDelegate (customDelegate)
+(NSString *)getAppDelegateClassName {
   return @"HedgewarsAppDelegate";
}
@end

I tested it and with the sdl demos it loads the normal
SDLUIKitDelegate, while in my code it loads my HedgewarsAppDelegate!
2011-04-05 09:50:25 -07:00
Sam Lantinga
f6dce5a2d0 Fixed setting programmatically setting the size of a window on X11 for non-resizable windows.
Patch by Matthew Smaling
2011-04-05 09:47:34 -07:00
Sam Lantinga
6592f8b975 Fixed bug 1173 (No mouse wheel event on linux/x11)
Matthias      2011-03-20 23:07:02 PDT

On X11, SDL 1.3 does not generate a mouse wheel event. Instead, button
down/buttton up events are generated by SDL. After looking at the code in
SDL_x11events.c, I assume this is due to the fact that X11 does not have a
dedicated mouse wheel event.

I did a little research on the behavior of mouse wheel events on X11 systems.
Apparently, mouse wheel events generate a button down/button up event with the
same time, i.e. with exact same timestamp.

Attached you can find my changes to SDL_x11events.c, which generates SDL mouse
wheel events for those button down events that have a button release event
immediately following it (for the same button, and with the same timestamp).

I did have to make an assumption: As standard X11 implementations know only 5
buttons, I have mapped Button4 to "wheel up" (i.e. +1), and Button5 to "wheel
down" (i.e. -1).

Note that if you include this patch, no SDL button down/up events will be
generated on X11 platforms for mouse wheel events (which is probably a
significant change for those that have programmed their code to work with
them).
2011-04-05 09:35:56 -07:00
Ryan C. Gordon
f3c17ebac2 Some more iOS orientation rotation fixes.
- Always use a UIViewController, even if window is not resizable.
- Let non-resizable windows still flip over, so user can hold device with the
correct orientation, but upside down, if that's more comfortable.
- Don't set the UIScreen unless we're forced to, as it resets some state.
- Minor correction with conventions for -[self init] tapdance.
2011-04-04 23:38:15 -04:00
Sam Lantinga
a46d9b6758 Added SDL_GetRenderer() 2011-04-04 09:29:13 -07:00
Ryan C. Gordon
15688a42c4 iOS: Correctly resize renderbuffers when rotating orientation.
Fixes strange rendering after rotating the device.
2011-04-03 18:33:32 -05:00
Airlangga Cahya Utama
e01e923c9a Move variable declaration position to stick with C standart. 2011-04-03 18:24:27 +07:00
Sam Lantinga
ef21cf0516 Fixed compile error. 2011-03-29 03:05:26 -07:00
Sam Lantinga
37d807278a Filter out SDL_WINDOWEVENT_SIZE_CHANGED events too 2011-03-28 23:44:51 -07:00
Sam Lantinga
6eb37a779e Make sure the resize event gets through 2011-03-28 20:56:28 -07:00
Ryan C. Gordon
fe1c0bd3ae Added orientation rotation for iOS. 2011-03-28 23:21:22 -04:00
Ryan C. Gordon
dcad176cb1 iOS: Report both landscape and portrait orientation as display modes. 2011-03-27 01:35:19 -04:00
Sam Lantinga
791472902d NDS update
Frank Zago to SDL

I've cleaned up a few bugs in the nds code. A few more tests now pass.
There's still a few things to do, but overall I think it's starting to be in a
good shape.

The patch also includes a bug fix for SDL_ConvertSurfaceFormat() (gcc warning).
2011-03-26 21:26:05 -07:00
Sam Lantinga
56c4464487 Added high resolution timing API: SDL_GetPerformanceCounter(), SDL_GetPerformanceFrequency() 2011-03-25 14:45:04 -07:00
Sam Lantinga
2b487fd839 Android defines linux, but doesn't have the gettid system call. 2011-03-25 13:48:48 -07:00
Sam Lantinga
f0c424685b SDL 1.3 requires a 64-bit type for the platform. 2011-03-25 13:47:49 -07:00
Sam Lantinga
3b7e2a872d Warn people not to run their applications as root! 2011-03-25 12:54:21 -07:00
Sam Lantinga
73247db7d8 The API sets the priority for the current thread, not an arbitrary thread.
Implemented thread priority as the 'nice' value on Linux.  High priority threads require root permissions (you shouldn't give your game root permissions though!)
2011-03-25 12:44:06 -07:00
Sam Lantinga
eeb5f362e4 Implemented SDL_SetThreadPriority() 2011-03-25 10:47:49 -07:00
Sam Lantinga
6bdb6a0c71 Fixed signed/unsigned warning. 2011-03-25 10:26:25 -07:00
Sam Lantinga
9fbcbeff40 The scale mode is per texture, not per texture unit. 2011-03-21 17:15:49 -07:00
Sam Lantinga
4c03cb931c Fixed bug: No right mouse button events during FullScreen Mac OS
Something inside setStyleMask mucks with the view responder chain, which prevents the listener from hearing the right mouse down events.  We just reset the listener after changing the style to fix this.
2011-03-21 16:36:17 -07:00
Sam Lantinga
7745ae8aa9 Fixed compiler warning 2011-03-21 13:33:53 -07:00
Ken Rogoway
75029512ef Split SDL_BlitScaled into SDL_UpperBlitScaled and SDL_LowerBlitScaled.
Fixed issue when calling SDL_BlitScaled() directly with src or dst rectangles that were out of bounds.
2011-03-13 22:38:41 -05:00
Sam Lantinga
bf8e277d9a Removed obsolete window positioning code. 2011-03-15 21:44:56 -07:00
Sam Lantinga
988ae69958 Fixed accidental line deletion. 2011-03-15 21:40:57 -07:00
Sam Lantinga
e5df196be2 Do not break application's signal handler installed with SA_SIGINFO
Gleb Natapov to sdl

If application installs SIGINT/SIGTERM signal handler with
sigaction(SA_SIGINFO) syscall before initializing SDL, after
initialization
of SDL signal handler will be reinstalled without SA_SIGINFO flag which
brings havoc when the signal handler is called. The breakage is done by
SDL_QuitInit()/SDL_QuitQuit() function. They use signal() to detect that
signal handler is already installed even in sigaction() is available.
2011-03-15 21:37:01 -07:00
Sam Lantinga
99c49c23e4 There's a function to do that... :) 2011-03-14 23:16:05 -07:00
Sam Lantinga
87477491cd SDL will treat the functionality as unsupported if the functions aren't filled in. 2011-03-14 23:14:51 -07:00
Sam Lantinga
9671497bdf DirectFB driver update
Couriersud to Sam

the attached patch brings the DirectFB driver back in line with recent
SDL 1.3 developments.
2011-03-14 23:13:33 -07:00
Sam Lantinga
35452d1b41 Delegate should use application: didFinishLaunchingWithOptions:
Vittorio G.  to Sam

would it be possible to update the application delegate in
SDL_uikitappdelagate to the suggest new method
2011-03-14 23:04:52 -07:00
Sam Lantinga
4213f61f58 Fixed crash if the update rectangles are not pre-clipped. 2011-03-13 19:06:43 -07:00
Sam Lantinga
4fd91c5eed Added the SDL_HINT_RENDER_SCALE_QUALITY hint, which defaults to nearest pixel sampling. 2011-03-13 11:18:35 -07:00
Sam Lantinga
d9770e538e Removed unreferenced variable 2011-03-13 11:17:11 -07:00
Sam Lantinga
b710eb9280 Fixed so code will compile with SDL_config_minimal.h 2011-03-12 13:21:57 -08:00
Sam Lantinga
4b75bcbd5d Fixed operator precedence
Frank Zago to SDL

& takes precedence over |. (was a gcc warning)
2011-03-11 18:38:29 -08:00
Sam Lantinga
61169f9e86 Fixed bug 1165 (SDL_GetMouseState() returns wrong location after switch to/from fullscreen)
I'm solving this by moving the mouse to the correct location after a fullscreen mode switch.
2011-03-11 18:16:39 -08:00
Sam Lantinga
460a4a9084 Fixed bug 1167 (SDL_WINDOWPOS_CENTERED doesn't work if used right after fullscreen -> windowed switch)
The top level code handles SDL_WINDOWPOS_CENTERED now, and the Cocoa SetWindowPosition call will clear the moveHack before adjusting the window position.
2011-03-11 16:54:43 -08:00
Sam Lantinga
b28a2c28ee Fixed bug 1166 (No mouse motion events while SDL_SetRelativeMouseMode() is active and holding the mouse button) 2011-03-11 16:03:23 -08:00
Sam Lantinga
2d4e47a5a7 Added a function to create color cursors: SDL_CreateColorCursor() 2011-03-11 14:14:38 -08:00
Sam Lantinga
9f072787a7 We can assume ARGB surface format when creating cursors (enforced by higher level API) 2011-03-11 13:59:52 -08:00
Sam Lantinga
d58ee21159 Added support for the Xcursor library for color cursors 2011-03-11 13:56:53 -08:00
Sam Lantinga
1594b1d188 Implemented X11 cursor support. 2011-03-11 13:27:25 -08:00
Sam Lantinga
90768250f2 Fixed permissions for C header files 2011-03-11 11:53:09 -08:00
Sam Lantinga
ac080d02da Fixed permissions for C source files 2011-03-11 11:52:41 -08:00
Sam Lantinga
069fbf4861 Gamma support is back!
New API functions:
	SDL_SetWindowBrightness()
	SDL_GetWindowBrightness()
	SDL_SetWindowGammaRamp()
	SDL_GetWindowGammaRamp()
	SDL_CalculateGammaRamp()
2011-03-11 08:49:20 -08:00
Sam Lantinga
9f5b3c27ae Fixed bug 1162 (Error calling SDL_RenderReadPixels() with format=0) 2011-03-10 01:03:43 -08:00
Sam Lantinga
cd9a0cf8a6 SDL_RenderReadPixels() is restricted to the viewport area. 2011-03-10 01:00:43 -08:00
Sam Lantinga
5bd2b6863a Fixed bug 1163 (SDL_TEXTINPUT not being received on iPhoneOS) 2011-03-09 17:38:12 -08:00
Sam Lantinga
ba49be2cf0 Fixed touches for the !IPHONE_TOUCH_EFFICIENT_DANGEROUS case 2011-03-09 15:09:00 -08:00
Sam Lantinga
f69f8b93cd Fixed linking x64 with Visual Studio 2010. 2011-03-08 22:48:21 -08:00
Sam Lantinga
63ca2547e6 Fixed compiler warning on Visual C++ 2011-03-07 14:07:08 -08:00
Sam Lantinga
71bdd88dbf Fixed bug 1161 (Setting GL_ACCELERATED_VISUAL to 1 forces software rendering in Windows XP)
Jesse Anders      2011-03-05 23:30:09 PST

It seems that in Windows XP, setting SDL_GL_ACCELERATED_VISUAL to 1 actually
disables hardware acceleration and puts OpenGL in software mode.

In the source code, the corresponding WGL attribute is first set here:

*iAttr++ = WGL_ACCELERATION_ARB;
*iAttr++ = WGL_FULL_ACCELERATION_ARB;

Later, this code:

if (_this->gl_config.accelerated >= 0) {
    *iAttr++ = WGL_ACCELERATION_ARB;
    *iAttr++ =
        (_this->gl_config.accelerated ? WGL_GENERIC_ACCELERATION_ARB :
         WGL_NO_ACCELERATION_ARB);
}

Sets it again if SDL_GL_ACCELERATED_VISUAL has a value other than the default.

More importantly, the documentation I found states that
WGL_GENERIC_ACCELERATION_ARB asks for an MDC driver, which, although I don't
know much about this topic, doesn't seem like the correct choice here. As
mentioned previously, the end effect is that requesting hardware acceleration
in Windows XP actually forces the renderer into software mode (on my system at
least), which I'm guessing isn't the desired behavior.
2011-03-07 14:06:46 -08:00
Sam Lantinga
469fecbf1f Enabled multi-touch 2011-03-07 09:58:21 -08:00
Sam Lantinga
89e173550c Fixed compile error 2011-03-07 09:25:42 -08:00
Sam Lantinga
ef468aa07f Removed the NDS hack for ARGB1555 surfaces, since it's a general problem; added full color expansion for 16 bpp packed pixels. 2011-03-07 01:34:38 -08:00
Sam Lantinga
821c92eab1 Fixed bitmap order interpretation; SDL defaults to MSB ordering so a bitstream corresponds to a pixel stream.
The bitmap ordering is defined such that the numbering refers to the pixel index from left to right, and the number position refers to the bit position in the byte.

SDL_BITMAPORDER_4321 is the fourth pixel at the high bit and the first pixel at the low bit (LSBFirst)

SDL_BITMAPORDER_1234 is the first pixel at the high bit and the fourth pixel at the low bit (MSBFirst)
2011-03-07 00:30:05 -08:00