Commit Graph

481 Commits

Author SHA1 Message Date
Ryan C. Gordon
0a3afaa588 Merged r5194:5195 from branches/SDL-1.2: coldfire cpu arch support. 2010-01-10 08:21:19 +00:00
Sam Lantinga
53023c5ff5 The OS/2 support has been removed, so we don't need this now. 2010-01-07 04:38:58 +00:00
Ryan C. Gordon
1fad5ac7c1 Merged r4717:4718 from branches/SDL-1.2: minor OS/2 DECLSPEC/SDLCALL fixes.
I reworked this a little. The 1.2 branch isn't really very elegant about this.
2010-01-06 20:58:03 +00:00
Ryan C. Gordon
d3e020766d Merged r4412:4413 from branches/SDL-1.2: rwops documentation fix. 2010-01-06 07:39:35 +00:00
Sam Lantinga
25ddd3c390 Removed in the interest of actually finishing 1.3. :)
They can be done later, either by me or by someone else.
2009-12-30 19:10:41 +00:00
Sam Lantinga
c3629ff44a Added SDL_RenderClear() as a fast method of clearing the screen to the drawing color.
Renamed SDL_RenderPoint() and SDL_RenderLine() to SDL_RenderDrawPoint() and SDL_RenderDrawLine().
Added API for rectangle drawing (as opposed to filling)
Added placeholder API functions for circles and ellipses ... I'm not sure whether these will stay.
Optimized software line drawing quite a bit.
Added support for Wu's anti-aliased line drawing, currently disabled by default.
2009-12-23 01:55:00 +00:00
Sam Lantinga
786e01f737 In the process of adding rectangle drawing 2009-12-18 07:03:09 +00:00
Sam Lantinga
4a157f0629 Added support for querying the number of CPUs available on Linux. This also happens to work on Mac OS X. 2009-12-17 03:04:04 +00:00
Ryan C. Gordon
61382a9f93 Initial band-aids on SDL_GetMouseState() API breakage. More work to come.
Fixes Bugzilla #758.
2009-12-16 19:50:51 +00:00
Ryan C. Gordon
f644ae86a9 Implemented SDL_setenv(), moved SDL_putenv() to compat.
Fixes Bugzilla #779.
2009-12-16 10:59:51 +00:00
Sam Lantinga
dc1ed9e7ef Added SDL_GetCPUCount() to see how many cores are available. 2009-12-16 06:53:53 +00:00
Sam Lantinga
75e75ae0c3 Fixed bug #741
The thread ID is an unsigned long so it can hold pthread_t so people can do naughty things with it.

I'm going to be adding additional useful thread API functions, but this should prevent crashes in people's existing code on 64-bit architectures.
2009-12-16 04:48:11 +00:00
Sam Lantinga
6484431a44 Fixed bug #685
Added missing keysym shortcuts
2009-12-16 01:06:48 +00:00
Sam Lantinga
fbcae020cf Fixed bug #642
Gerry JJ      2008-11-09 02:11:49 PST

The SDL_MouseMotionEvent struct has a field named "tilt" (currently marked "for
future use"), for tablet stylus tilt information.  However, one value is not
enough for this, as tilt is two-dimensional.  Reserving only one field for
future use is no good when you're going to need two, so there should be two
fields, tilt_x and tilt_y.
2009-12-16 00:44:53 +00:00
Sam Lantinga
a4cb5a9a72 Fixed bug #815
Daniele Forghieri      2009-10-12 02:57:03 PDT

Patch to use stdlib.h with Open Watcom

Open Watcom 1.8 has <stdlib.h> so instead of patch the single part when stdlib
features are used we use directly the include file as with GCC.
2009-12-15 20:14:50 +00:00
Ryan C. Gordon
59ea17f263 Added a warning comment to SDL_putenv().
"Fixes" Bugzilla #779.
2009-12-15 18:00:16 +00:00
Sam Lantinga
df50338fda Add a dummy function if SDL doesn't have STDIO support 2009-12-15 05:34:58 +00:00
Sam Lantinga
2ac49a53bd The SDL 1.3 tests have been cleaned up not to include any 1.2 compatibility code. 2009-12-14 23:29:37 +00:00
Sam Lantinga
9bf59c5687 The SDL_PaletteWatch structure is really internal-only. 2009-12-13 08:00:25 +00:00
Sam Lantinga
ed8e1e54ad Name the audio callback for documentation clarity. 2009-12-13 06:21:22 +00:00
Sam Lantinga
4f4f40f930 Minor documentation fix 2009-12-12 20:30:25 +00:00
Sam Lantinga
dd8238d718 Switch to mixed case for consistency with other enumerations 2009-12-10 08:28:26 +00:00
Sam Lantinga
70a40d51b2 Added interfaces for batch drawing of points, lines and rects:
SDL_DrawPoints()
    SDL_BlendPoints()
    SDL_BlendLines()
    SDL_DrawLines()
    SDL_FillRects()
    SDL_BlendRects()
    SDL_RenderPoints()
    SDL_RenderLines()
    SDL_RenderRects()
Renamed SDL_RenderFill() to SDL_RenderRect()
2009-12-09 15:56:56 +00:00
Sam Lantinga
586f3e0dda Added an API function to query geometry of multiple monitors:
SDL_GetDisplayBounds()

Implemented multi-monitor window positions on Windows
2009-12-06 08:03:38 +00:00
Sam Lantinga
a90e5b78ce Made the window flag comments more consistent 2009-12-05 05:13:17 +00:00
Sam Lantinga
428aa51c43 Added related functions 2009-12-05 04:39:59 +00:00
Sam Lantinga
8adb9fc3cc Work in progress on multi-display support:
* Added display parameter to many internal functions so video modes can be set on displays that aren't the public current one.
* The fullscreen mode is associated with fullscreen windows - not displays, so different windows more naturally have a mode associated with them based on their width and height.  It's no longer necessary to specify a fullscreen mode, a default one will be picked automatically for fullscreen windows.
2009-12-01 05:57:15 +00:00
Sam Lantinga
1636b263b6 Joe 2009-11-23 21:31:10 PST
If type is ::SDL_HAPTIC_CARTESIAN, direction is encoded by three positions
367     *  (X axis, Y axis and Z axis (with 3 axes)).  ::SDL_HAPTIC_CARTESIAN
uses
368     *  the first three \c dir parameters.  The cardinal directions would
be:
369     *   - North:  0,-1, 0
370     *   - East:  -1, 0, 0
371     *   - South:  0, 1, 0
372     *   - West:   1, 0, 0

typedef struct SDL_HapticDirection
{
    Uint8 type;         /**< The type of encoding. */
    Uint16 dir[3];      /**< The encoded direction. */
} SDL_HapticDirection;

An unsigned int can't store negative values and I don't see an alternate way to
encode them in the docs or source. The best I have been able to come up with is
using a negative magnitude for the effect but this will only get me 2 of the 4
quadrants in the plane for 2d effects. I looked at the win32 and linux
implementations and I believe is is safe to use signed ints in the direction
struct. I am unfamiliar with the darwin haptics API so I don't know if it is
safe.
2009-11-27 19:29:27 +00:00
Sam Lantinga
eb0a552878 SDL_CreateWindowFrom() is actually going to be supported. :) 2009-11-25 07:42:23 +00:00
Sam Lantinga
3d2358c109 Clarified the windowID parameter 2009-11-25 06:24:15 +00:00
Sam Lantinga
9943aa0b1b Eric Wing to Sam, hfutrell
This one is quite puzzling. I found a partial workaround, but I don't fully understand the reasons yet.

First, the console is complaining about not finding a nib for MainWindow.
I tried removing the entry for this in the info.plist, and the message went away, but it didn't really change anything.

Second, I stepped through this with the debugger and broke up some lines. It seems that the basic act of calling
       view = [SDL_uikitopenglview alloc];

or even
       view = [SDL_uikitview alloc]

will crash the program. The debugger messages plus the stack trace make me think it's not finding the SDL_uikitview classes for some reason. But I don't understand why this would be.

view = [UIView alloc] will not crash the program.

For kicks, I added a new definition of a class called SDL_object which subclasses NSObject in the same files as SDL_uikitopenglview and then call
       view = [SDL_object alloc];

This does not crash the program.

So, then I modified SDL_object to subclass UIView. No crash.

Next, I made SDL_object subclass UIView<UITextFieldDelegate> . This crashes.

So it is the act of conforming to the UITextFieldDelegate protocol that is crashing things.

I don't understand why it would crash on alloc though. I'm guessing either a delegate needs to be set somewhere or one of the required methods needs to be implemented. But in the former case, I would not expect a crash, but a silent message to nil and something else doesn't work. And in the latter case, I would expect a compiler warning and an exception thrown instead of a crash.

Anyway, my temporary workaround is to change the interface declaration for SDL_uikitview to look like:

#if SDL_IPHONE_KEYBOARD
@interface SDL_uikitview : UIView<UITextFieldDelegate> {
#else
@interface SDL_uikitview : UIView {
#endif

And then disable the keyboard support in the SDL_config_iphoneos.h file.
/* enable iPhone keyboard support */
#define SDL_IPHONE_KEYBOARD 0


-Eric

On Nov 23, 2009, at 1:43 AM, Sam Lantinga wrote:

> I ran into a blocking startup crash with the Happy demo on iPhone OS 3.1.2 on my new iPhone:
>
> #0    0x323fea14 in _class_isInitialized
> #1    0x323fea68 in _class_initialize
> #2    0x32403e92 in prepareForMethodLookup
> #3    0x32401244 in lookUpMethod
> #4    0x323fea10 in _class_lookupMethodAndLoadCache
> #5    0x323fe746 in objc_msgSend_uncached
> #6    0x323feb26 in _class_initialize
> #7    0x323fea58 in _class_initialize
> #8    0x32403e92 in prepareForMethodLookup
> #9    0x32401244 in lookUpMethod
> #10   0x323fea10 in _class_lookupMethodAndLoadCache
> #11   0x323fe746 in objc_msgSend_uncached
> #12   0x000554dc in UIKit_GL_CreateContext at SDL_uikitopengles.m:103
> #13   0x0004f89e in SDL_GL_CreateContext at SDL_video.c:3155
> #14   0x000579e8 in GLES_CreateRenderer at SDL_renderer_gles.c:282
> #15   0x0004d7b8 in SDL_CreateRenderer at SDL_video.c:1509
> #16   0x00002bc2 in SDL_main at happy.c:156
> #17   0x000571b2 in -[SDLUIKitDelegate postFinishLaunch] at
> SDL_uikitappdelegate.m:77
> #18   0x313f9ef2 in __NSFireDelayedPerform
> #19   0x32567bb2 in CFRunLoopRunSpecific
> #20   0x3256735c in CFRunLoopRunInMode
> #21   0x32912cbe in GSEventRunModal
> #22   0x32912d6a in GSEventRun
> #23   0x32b6276e in -[UIApplication _run]
> #24   0x32b61472 in UIApplicationMain
> #25   0x00057088 in main at SDL_uikitappdelegate.m:50
>
> Any ideas?
>
> See ya!
> --
>       -Sam Lantinga, Founder and President, Galaxy Gameworks LLC
2009-11-24 08:12:32 +00:00
Sam Lantinga
2634a34422 Made the comment actually mean something. :) 2009-11-22 20:00:00 +00:00
Sam Lantinga
cd1a4a74e5 Scott to slouken
Heres the wiz patch and additional files. (I think I got everything)
2009-11-17 04:53:15 +00:00
Sam Lantinga
7a40c23469 You can specify the format for pixel data in SDL_RenderReadPixels() and SDL_RenderWritePixels()
This code still doesn't quite work yet. :)
2009-11-16 07:13:07 +00:00
Sam Lantinga
c12a32c64b Added a utility function to convert blocks of pixels 2009-11-15 09:21:46 +00:00
Sam Lantinga
b66aacd5f4 Fixed gcc warning 2009-11-09 15:12:31 +00:00
Sam Lantinga
3ab0a5fe79 Fixed bug #878
Jack Jansen      2009-11-05 14:20:22 PST

I'm building "fat" SDL 1.3 libraries for MacOSX, but now I am running into the
issue that audio does not work on PowerPC macintoshes if you build the library
on an Intel.

The problem is that configure hard-codes the byteorder, which is then stored in
SDL_config.h
2009-11-09 04:13:51 +00:00
Sam Lantinga
27294b7a4e Partial fix for bug #859
Header file update from Ken for improved doxygen output
2009-10-19 13:31:58 +00:00
Sam Lantinga
890a3b9f25 Merged improvements to SDL_SoftStretch() from SDL 1.2 2009-10-18 17:49:40 +00:00
Sam Lantinga
0874c3ae84 iPhone interruption patch / SDL 1.3
Eric Wing to Sam

I've been sitting on this too long. I need to push.
It's untested because of the unrelated crashing bug I've been experiencing.
Also have a fix for SIZEOF_VOIDP in the config for both iPhone and Mac.
2009-10-17 07:36:45 +00:00
Sam Lantinga
473fff5cb6 We don't need dlvsym() for ALSA anymore, yay! 2009-10-13 07:02:19 +00:00
Sam Lantinga
73b823bca8 Adapted from Debian patch: 215_kfreebsd_gnu.diff 2009-10-10 09:36:12 +00:00
Sam Lantinga
d772434d29 Made typedef for SDL_bool the same as the other typedefs.
If this causes problems on any compiler, please report a bug to
http://bugzilla.libsdl.org/
and include the platform and version of compiler you're using.
2009-10-10 09:22:20 +00:00
Sam Lantinga
4148ddc4be Eric Wing to Sam
Also noticed the SDL.h header in 1.3 didn't have the /** for the methods while testing. Attached is a quick fix patch.
2009-10-06 03:34:10 +00:00
Sam Lantinga
9313a4ad5f Fixed bug #826
Ken Bull      2009-10-04 09:51:30 PDT

2009/10/4 E. Wing <ewmailing@gmail.com>:
> Hi Kenneth,
> I noticed that SDL_SetColorKey and SDL_GetColorKey start with
> /*
> instead of
> /**
> in SDL_Surface.h in SDL 1.3.
>
> I haven't scrutinized the headers and I don't know if you had an
> automated process to add these, but I thought I would let you know in
> case there might be others that have the same problem.
>
> Thanks,
> Eric
>

The attached patch corrects this and other documentation errors in
SDL_surface.h
2009-10-04 19:14:30 +00:00
Sam Lantinga
bd908a682f Fixed bug #777
Implemented SDL_GetPlatform()
2009-09-26 10:32:14 +00:00
Sam Lantinga
c3a7520d8d Whoops, need both the header and the library! 2009-09-21 11:31:28 +00:00
Sam Lantinga
9d68c389ed Fixed bug #714
fuzzyTew@gmail.com      2009-03-14 15:18:45 PDT

patch to change HAVE_ICONV to HAVE_ICONV_H

There are two separate iconv checks in configure -- one for the header file and
one for the library.  include/SDL_stdinc.h uses the library define to see
whether or not it should reference the types defined in the header, which
naturally breaks if the library exists and the header does not.
2009-09-21 11:04:01 +00:00
Sam Lantinga
a1ee906546 Fixed bug #615
Scott McCreary      2008-08-21 10:48:14 PDT

This patch adds support for Haiku.
http://ports.haiku-files.org/browser/haikuports/trunk/media-libs/libsdl/SDL-1.2.13-haiku.diff
Haiku is an open-source recreation of BeOS.  It has better POSIX compliance
than beOS did, and other improved features, which in some cases causes us to
have to "undo" previous BeOS workarounds.
Here's our port log entry for it, showing the steps to force the changes into
configure and Makefile:
http://ports.haiku-files.org/wiki/media-libs/libsdl/1.2.13/1
Note that this was only tried on 1.2.13 stable so far.
Haiku is using a newer config.guess / config.sub that doesn't yet seem to be in
the released libtool, so we are having to copy it in for now.
http://haiku-files.org/files/optional-packages/
2009-09-21 09:21:00 +00:00
Sam Lantinga
4f9b38f7c8 Oh yeah, we have GLX support too. 2009-09-21 09:02:05 +00:00