Commit graph

2909 commits

Author SHA1 Message Date
Ryan C. Gordon
f2b3dc5a5a Make assert dialog work on Cocoa target even if we haven't initialized video.
--HG--
extra : rebase_source : 04ec77f4a3a3f61fdb1255c4fc3b8c88efd68ffb
2011-04-20 15:14:18 -04:00
Ryan C. Gordon
b94f23a46d Removed assertion list terminator (just do it like a normal linked list). 2011-04-19 14:12:56 -04:00
Sam Lantinga
e740162fb0 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
605263ee5f Removed buggy and LGPL MMX mixing routines. 2011-04-08 13:16:33 -07:00
Sam Lantinga
b0660ba5ff SDL 1.3 is now under the zlib license. 2011-04-08 13:03:26 -07:00
Sam Lantinga
c336f6f154 Fixed build error 2011-04-06 17:10:14 -07:00
Sam Lantinga
5e1ffb1cc3 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
0e83d1d4f3 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
65b0f3090a 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
b786ea8b06 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.

--HG--
extra : rebase_source : d1b861f1174282eccb34f5efd183b03f6efcc2fa
2011-04-04 23:38:15 -04:00
Sam Lantinga
126bbbaa50 Added SDL_GetRenderer() 2011-04-04 09:29:13 -07:00
Ryan C. Gordon
b950cf4653 iOS: Correctly resize renderbuffers when rotating orientation.
Fixes strange rendering after rotating the device.

--HG--
extra : rebase_source : 6962fd0710f95a81773157507aca653f9a3e1115
2011-04-03 18:33:32 -05:00
Airlangga Cahya Utama
932c46e9ca Move variable declaration position to stick with C standart. 2011-04-03 18:24:27 +07:00
Sam Lantinga
e17ed1c762 Fixed compile error. 2011-03-29 03:05:26 -07:00
Sam Lantinga
b705071877 Filter out SDL_WINDOWEVENT_SIZE_CHANGED events too 2011-03-28 23:44:51 -07:00
Sam Lantinga
8e668b0606 Make sure the resize event gets through 2011-03-28 20:56:28 -07:00
Ryan C. Gordon
ab0fcbfbd2 Added orientation rotation for iOS. 2011-03-28 23:21:22 -04:00
Ryan C. Gordon
8a8592e34c iOS: Report both landscape and portrait orientation as display modes. 2011-03-27 01:35:19 -04:00
Sam Lantinga
3b72fdeffe 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
85ad17e7d6 Added high resolution timing API: SDL_GetPerformanceCounter(), SDL_GetPerformanceFrequency() 2011-03-25 14:45:04 -07:00
Sam Lantinga
98e5ddb37d Android defines linux, but doesn't have the gettid system call. 2011-03-25 13:48:48 -07:00
Sam Lantinga
5c01c4797c SDL 1.3 requires a 64-bit type for the platform. 2011-03-25 13:47:49 -07:00
Sam Lantinga
a38339ac08 Warn people not to run their applications as root! 2011-03-25 12:54:21 -07:00
Sam Lantinga
f0b1c9b859 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
bca33709c6 Implemented SDL_SetThreadPriority() 2011-03-25 10:47:49 -07:00
Sam Lantinga
0b1225e301 Fixed signed/unsigned warning. 2011-03-25 10:26:25 -07:00
Sam Lantinga
b547542f70 The scale mode is per texture, not per texture unit. 2011-03-21 17:15:49 -07:00
Sam Lantinga
75dcb27882 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
6373d8954b Fixed compiler warning 2011-03-21 13:33:53 -07:00
Ken Rogoway
791cca44b5 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
1e83a51bfd Removed obsolete window positioning code. 2011-03-15 21:44:56 -07:00
Sam Lantinga
4952e5686b Fixed accidental line deletion. 2011-03-15 21:40:57 -07:00
Sam Lantinga
45e584dd37 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
bbf8ed88c2 There's a function to do that... :) 2011-03-14 23:16:05 -07:00
Sam Lantinga
441f60edb6 SDL will treat the functionality as unsupported if the functions aren't filled in. 2011-03-14 23:14:51 -07:00
Sam Lantinga
a8591ca87b 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
dc564a22c8 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
5ddb72419d Fixed crash if the update rectangles are not pre-clipped. 2011-03-13 19:06:43 -07:00
Sam Lantinga
a19e258730 Added the SDL_HINT_RENDER_SCALE_QUALITY hint, which defaults to nearest pixel sampling. 2011-03-13 11:18:35 -07:00
Sam Lantinga
fbc49beee3 Removed unreferenced variable 2011-03-13 11:17:11 -07:00
Sam Lantinga
fc9ee0c10f Fixed so code will compile with SDL_config_minimal.h 2011-03-12 13:21:57 -08:00
Sam Lantinga
2bfebc895c Fixed operator precedence
Frank Zago to SDL

& takes precedence over |. (was a gcc warning)
2011-03-11 18:38:29 -08:00
Sam Lantinga
23b4b79a90 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
0eb0a30eca 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
06a33455ca 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
27db584f54 Added a function to create color cursors: SDL_CreateColorCursor() 2011-03-11 14:14:38 -08:00
Sam Lantinga
3b5aaf8974 We can assume ARGB surface format when creating cursors (enforced by higher level API) 2011-03-11 13:59:52 -08:00
Sam Lantinga
3b97514dce Added support for the Xcursor library for color cursors 2011-03-11 13:56:53 -08:00
Sam Lantinga
d8ce454e1e Implemented X11 cursor support. 2011-03-11 13:27:25 -08:00
Sam Lantinga
c9e8ff608c Fixed permissions for C header files 2011-03-11 11:53:09 -08:00