Commit Graph

860 Commits

Author SHA1 Message Date
Sam Lantinga
76714d4f99 Fixed a typo in the header. 2011-11-07 02:25:01 -05:00
Sam Lantinga
6371c44a9e Lots of fixes importing SDL source wholesale into a new iOS project 2011-10-31 05:56:58 -04:00
Sam Lantinga
a347411651 SDL_ConvertPixels() returns 0 on success 2011-10-31 02:44:21 -04:00
Sam Lantinga
c2a6df6073 The draw color affects RenderClear() as well. (thanks to the feedback form to whoever pointed this out) 2011-10-30 17:53:54 -04:00
Sam Lantinga
66d375d59e Fixed typo - thanks Sheena! 2011-10-30 17:31:59 -04:00
Andreas Schiffler
bc907fee45 Update SDL_HasClipboardText functions to return value based on clipboard content; Fix memory leak in fallback SetClipboard implementation 2011-10-29 23:43:59 -07:00
Sam Lantinga
6d456a4116 Added SDL_GetScancodeFromName() and SDL_GetKeyFromName() 2011-10-24 21:34:54 -04:00
Tim Angus
092332dd71 * Android's InputStream::skip is apparently buggy, so instead read into a dummy buffer 2011-10-14 17:29:49 +01:00
Ryan C. Gordon
15426080c6 Specify joystick (accelerometer) support for iOS in the config header.
Fixes Bugzilla #1292.

Thanks to Vittorio Giovara for the patch!
2011-10-14 00:20:44 -04:00
Ryan C. Gordon
2ef51927fe 1.3 API CHANGE: Add support for naming threads. 2011-10-02 00:29:16 -04:00
Ryan C. Gordon
a4ede00263 Fixed compiler warnings on Haiku. 2011-09-18 03:52:08 +00:00
Andreas Schiffler
0a29e84930 Fix SDL_RectEquals define 2011-09-17 22:35:10 -07:00
Andreas Schiffler
acb9d90a85 Add NULL handling in SDL_RectEmpty and SDL_RectEquals 2011-09-16 08:25:49 -07: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
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
Andreas Schiffler
576988acf2 Update SDL_REVISION 2011-09-04 20:45:38 -07:00
Ryan C. Gordon
e0fe768768 Fixed another Apple typedef in SDL_opengl.h 2011-09-02 13:54:45 -04:00
Ryan C. Gordon
fefd678dfd Backed out SDL_config.h overwrite that got committed by accident. 2011-08-30 17:11:51 -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
56e1918d11 Fixed missing audio on iOS. 2011-08-29 00:27:43 -04:00
Ryan C. Gordon
586e5b252b Fix another Apple conflict in SDL_opengl.h 2011-08-26 03:38:46 -04: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
8f50763692 Fixed -pedantic warning in SDL_assert.h.
Fixes Bugzilla #1282.
2011-08-21 12:36:55 -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
7de8cc401e Reworked Windows waveOut code.
Implemented multi-device support, changed name to "winmm".
2011-08-04 01:24:22 -04:00
Ryan C. Gordon
59168c5bf2 Apple uses a void* for GLhandleARB, not an unsigned int. 2011-08-04 00:46:27 -04: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
75d8b324e2 Work on systems without sa_sigaction. 2011-07-20 16:35:37 -07:00
Markus Kauppila
9932ea0a03 Testing out implementation for skipping unsupported test
automatically.
2011-07-18 22:26:26 +03:00
Nathan Heisey
65e5a15393 Implemented pthread spinlocks. 2011-06-22 10:33:48 +00: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
Sam Lantinga
2b4bb0d58b Make SDL_QuitRequested() return an SDL_bool 2011-06-12 12:23:39 -04:00
Ryan C. Gordon
a74c9aa88d Fixed gcc warnings for apps using SDL headers with -Wundef flag.
Fixes Bugzilla #1216.

Thanks to Dimitris Zenios for the patch!
2011-06-06 12:20:04 -04:00
Andreas Schiffler
40bfbbdbf9 Fixed global suite declaration segfault via external linkage declaration 2011-05-26 20:13:49 -07:00
Sam Lantinga
fa1116223a Clarified SDL_GetWindowSurface() documentation
Matthew Orlando to Sam

Someone asked in IRC whether they should free the surface from SDL_GetWindowSurface. The doc comment is a bit vague so i checked the code and revised the comment.
2011-04-22 09:06:29 -07:00
Sam Lantinga
057ae6ca57 Fixed so SDL_quit.h doesn't require SDL_compat.h 2011-04-21 09:50:29 -07: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
37865236cc Minor missing parameter name 2011-04-18 12:20:30 -07:00
Sam Lantinga
6196aa221e SDL 1.3 is now under the zlib license. 2011-04-08 13:03:26 -07:00
Sam Lantinga
a46d9b6758 Added SDL_GetRenderer() 2011-04-04 09:29:13 -07:00
Sam Lantinga
56c4464487 Added high resolution timing API: SDL_GetPerformanceCounter(), SDL_GetPerformanceFrequency() 2011-03-25 14:45:04 -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
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
023e6fa996 Fixed related function documentation 2011-03-22 10:48:33 -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
a99d79de70 Fixed error because intrin.h contains C++ code and can't be included in an extern "C" block. 2011-03-15 19:37:38 -07:00
Sam Lantinga
3f21fa761c Fixed typo 2011-03-14 10:58:35 -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
b710eb9280 Fixed so code will compile with SDL_config_minimal.h 2011-03-12 13:21:57 -08:00
Sam Lantinga
2d4e47a5a7 Added a function to create color cursors: SDL_CreateColorCursor() 2011-03-11 14:14:38 -08:00
Sam Lantinga
d58ee21159 Added support for the Xcursor library for color cursors 2011-03-11 13:56:53 -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
634567b09a The MMX and 3DNow! instructions can't be compiled by 64-bit Visual Studio. 2011-03-07 22:04:10 -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
Sam Lantinga
f78f25504b Added padding for better aligned access to *shift/*loss members 2011-03-06 23:54:20 -08:00
Sam Lantinga
2a60f966cb a Nintendo ds update
Frank Zago to SDL

For those interested, here's a snapshot of the current port. I did away with
most of the previous attempt which was based of the sprite engine, because the
support is limited to 128 64x64 sprites. Instead I'm using the gl engine.
The drawback is that either the frame buffer or the gl engine can be used
because there's not that much video memory on a DS.

With minimal changes to their code, it can now run the following tests: ,
testspriteminimal, testscale and testsprite2. The last 2 only run under the
emulator for some reason. The tests are not included in this patch for size
reason.

In 16 bits mode, the 16th bit indicated transparency/opacity. If 0, the color
is not displayed. So I had to patch a few core file to set that bit to 1. See
patch for src/video/SDL_RLEaccel.c and src/video/SDL_blit.h. Is that ok, or is
there a better way ?

The nds also doesn't support windowed mode, so I force the fullscreen in
src/video/SDL_video.c.  Is that ok, or is there a better way ?

To get a smaller library, I also tried to not compile the software renderer
when the hardware renderer is compiled in, and define SDL_NO_COMPAT; however
the compilation eventually fails in SDL_surface.c because SDL_SRCCOLORKEY is
defined in SDL_compat.h. Is SDL_NO_COMPAT only for application and not SDL
itself ?
2011-03-06 21:12:19 -08:00
Sam Lantinga
d32d1ee244 OSF isn't supported anymore. 2011-02-28 09:09:13 -08:00
Sam Lantinga
9f410819dc IRIX is not supported anymore. :) 2011-02-28 09:06:29 -08:00
Sam Lantinga
f7600494ed Dynamically load the Xinerama and xf86vmode extensions
This fixes a few bugs with different distributions:
http://bugs.freedesktop.org/show_bug.cgi?id=17431
http://bugs.gentoo.org/show_bug.cgi?id=246177
2011-02-28 09:01:53 -08:00
Sam Lantinga
747dbeb744 Fixed compiling AltiVec blitters 2011-02-27 22:22:58 -08:00
Sam Lantinga
d5783ef521 Use boolean value for input grab mode, like we do for fullscreen mode. 2011-02-27 20:06:45 -08:00
Sam Lantinga
0ac98043e8 Fixed altivec.h include on Mac OS X 2011-02-22 22:17:44 -08:00
Sam Lantinga
7fa84f6a78 Re-added the 3DNow! and AltiVec instruction support. 2011-02-22 21:44:36 -08:00
Sam Lantinga
f3c377a8f2 Simplified and unified the window creation process a little. 2011-02-21 22:03:39 -08:00
Sam Lantinga
73b17999c1 Implemented Cocoa_SetWindowIcon(), added SDL_ConvertSurfaceFormat() 2011-02-21 16:45:23 -08:00
Sam Lantinga
2788694b17 Simple rumble API for haptic
Edgar Simo      2011-02-20 10:27:52 PST

Adding patch that adds a simplified API for the haptic subsystem built ontop of
the "real one" for those who want simple rumble without jumping through hoops.

Adds 4 functions:

- extern DECLSPEC int SDLCALL SDL_HapticRumbleSupported(SDL_Haptic * haptic);
- extern DECLSPEC int SDLCALL SDL_HapticRumbleInit(SDL_Haptic * haptic);
- extern DECLSPEC int SDLCALL SDL_HapticRumblePlay(SDL_Haptic * haptic, float
strength, Uint32 length );
- extern DECLSPEC int SDLCALL SDL_HapticRumbleStop(SDL_Haptic * haptic);

Also provided is test/testrumble.c which does test this.

This has all been tested on linux and has worked, but due to being built ontop
of the other haptic API it should work on all OS the same.
2011-02-20 10:54:44 -08:00
Sam Lantinga
a0a3c805a2 Added a revision number for easy compile-time tests. 2011-02-20 10:42:51 -08:00
Sam Lantinga
3296f115b7 Added missing log debug function 2011-02-19 11:23:56 -08:00
Sam Lantinga
664f75eeff Add assertions to the default API set. 2011-02-19 11:23:41 -08:00
Sam Lantinga
594e403a0f Whoops, the format parameter was off the page. 2011-02-18 09:30:09 -08:00
Sam Lantinga
6b2b174db0 The file is actually SDL_config.h now. 2011-02-17 19:00:29 -08:00
Sam Lantinga
b807895313 Allow the application to explicitly request a software renderer. 2011-02-17 12:03:48 -08:00
Sam Lantinga
dbb0a44739 Renamed SDL_keysym.h to SDL_keycode.h to avoid confusion. 2011-02-16 15:46:12 -08:00
Sam Lantinga
b5513f44c8 Fixed bug #1090 (SDL_BlitCopyOverlap() assumes memcpy() operates in order)
Even if we're blitting between two different surfaces their pixels might still overlap, because of SDL_CreateRGBSurfaceFrom(), so always use SDL_BlitCopy() and check for overlap in that function.

When handling overlapping surfaces, don't assume that memcpy() iterates forward, instead use memmove() correctly, and provide a fallback implementation of SDL_memmove() that handles the different cases.

Fixed a bug with SDL_memset() not completely filling lengths that aren't a multiple of 4.
Optimized SDL_memcpy() a bit using the same technique as SDL_memset().
2011-02-16 15:25:10 -08:00
Sam Lantinga
349a9bf3ce Allow you to override SDL's main override 2011-02-16 12:27:29 -08:00
Sam Lantinga
307a90d292 Made it possible to build SDL from a fresh checkout without any additional steps.
The trick is that if you're using configure and you don't want to have SDL_config.h and SDL_revision.h to show up as modified, you need to configure and build from a separate directory.

You also need to include SDL_revision.h directly if you want to use the SDL_REVISION constant, as a side effect of these changes.
2011-02-16 02:37:09 -08:00
Sam Lantinga
b7d670c8ca Fixed gcc -pedantic warning 2011-02-15 21:57:31 -08:00
Sam Lantinga
b59da3ffdc Changed the concept of a render clip rect to a render viewport.
The render viewport is automatically re-centered when the window changes size, so applications that don't care will not have to handle recalculating their rendering coordinates.

Fixed API for drawing and filling multiple rectangles - the parameter should be an array of rects, not an array of pointers to rects.

Fixed API for updating window rects for consistency with other APIs - the order is pointer to array followed by count in array.
2011-02-15 13:59:59 -08:00
Ken Rogoway
8c8191deef Software scaling support. Not very fast, but it seems to work. 2011-02-14 11:50:18 -06:00
Sam Lantinga
2ad2f08f4d The format_version isn't used anymore. 2011-02-13 22:30:06 -08:00
Sam Lantinga
c7b5cc946d A few fixes:
Fixed creating render texture framebuffer.
Removed the need for palette watch, added surface format caching.
Added an SDL_DONTFREE flag so you can't free the window and 1.2 shadow surfaces.
2011-02-13 13:46:10 -08:00
Sam Lantinga
e6ec7f6b28 Fixed bug #1117
There's a new event that's always sent when the window changes size, and that event is what the renderers listen for to determine if they need to rebind their context.
2011-02-12 19:02:14 -08:00
Sam Lantinga
c3265bbc90 changeset: 5272:cb08ef104ac4
tag: tip
user: Martin Decky <martin@decky.cz>
date: Sat Feb 12 20:53:06 2011 +0100
summary: improve header files compatibility with SDL 1.2 applications (namely QEMU)
2011-02-12 12:04:00 -08:00
Sam Lantinga
362639036a Frank Zago to sdl
The following patch fixes some of the bitrot for the Nintendo DS port.
The support is still basic at the moment, but it allows to run the "general"
test under the current head of tree (parent: 5269:11bd1585efb5 tip).
Most of the patch is mine, but I integrated a couple changes that John
Magnotti posted on Feb 1st.
2011-02-12 11:36:56 -08:00
Sam Lantinga
5e1535525c Initial pass at shader YV12 support - doesn't quite work yet. 2011-02-12 00:25:02 -08:00
Sam Lantinga
aef6fb230a Fixed SSE4 detection, and split it into SSE 4.1 and 4.2 2011-02-11 23:02:35 -08:00
Sam Lantinga
a2cdcf5486 Happy 2011! :) 2011-02-11 22:37:15 -08:00
Sam Lantinga
2af371cc2e Updated CPU detection code for SSE3 and SSE4 and removed obsolete 3DNow! and Altivec support. 2011-02-11 14:51:04 -08:00
Sam Lantinga
37993063c6 Window coordinates are in the global space and windows are not tied to a particular display.
Also added Ctrl-Enter keybinding to the test code to toggle fullscreen mode for testing.
2011-02-10 14:44:25 -08:00
Sam Lantinga
debc4678c8 Be explicit about what display you're querying. The default display is 0. 2011-02-10 12:14:37 -08:00
Sam Lantinga
f2729d2d2c Removed gamma support since it wasn't widely used and not well supported. 2011-02-10 11:39:08 -08:00
Sam Lantinga
f8db477234 Surfaces aren't in hardware memory anymore! 2011-02-10 05:10:05 -08:00
Sam Lantinga
5d0480d014 Added a way to replace the default logging mechanism 2011-02-08 23:13:58 -08:00
Sam Lantinga
ca8ed0c39d Added a hint to control whether the OpenGL driver uses shaders. 2011-02-08 22:40:19 -08:00
Sam Lantinga
5069986bff Made it possible to disable the rendering subsystem with configure --disable-render 2011-02-08 10:04:09 -08:00
Sam Lantinga
7d207a3141 It's now possible to disable the fast atomic operations, at a huge performance penalty. 2011-02-07 22:57:33 -08:00
Sam Lantinga
da46bc3be3 Added function SDL_RenderSetClipRect() 2011-02-07 20:06:26 -08:00
Sam Lantinga
47818cfba9 Added a simple log message API 2011-02-07 16:45:40 -08:00