Commit Graph

2868 Commits

Author SHA1 Message Date
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
Sam Lantinga
1279ca64b1 We explicitly don't know how to handle 1 and 4 bpp pixel formats. 2011-03-07 00:08:23 -08:00
Sam Lantinga
581f9824ef Fixed memory corruption with invalid pixel values. 2011-03-06 23:56:23 -08:00
Sam Lantinga
3e0f876567 Fixed up structure to match header, added missing Aloss 2011-03-06 23:54:50 -08:00
Sam Lantinga
551dbb0ab2 Better error reporting in allocating a pixel format. 2011-03-06 21:49:52 -08:00
Sam Lantinga
57b2784f3b Fixed garbage trying to create a FourCC pixel format. 2011-03-06 21:47:48 -08:00
Sam Lantinga
b29c9da5c8 Fixed initializing pixel format for indexed formats 2011-03-06 21:34:45 -08:00
Sam Lantinga
8687086b1d Only compile the NDS renderer if specified in the config file. 2011-03-06 21:19:02 -08:00
Sam Lantinga
41ec33f3e3 A better way of setting the fullscreen flag for windows on Nintendo DS 2011-03-06 21:18:36 -08:00
Sam Lantinga
819b3f3559 Fixed compiler warning 2011-03-06 21:17:44 -08:00
Sam Lantinga
9ce85e3a61 Fixed compiler warnings 2011-03-06 21:17:09 -08:00
Sam Lantinga
3d078dceac Fixed compiler warning 2011-03-06 21:15:46 -08:00
Sam Lantinga
56666f8da6 Fixed compiler warning 2011-03-06 21:15:28 -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
572abba9b9 Added support for Windows cursors 2011-02-28 23:50:32 -08:00
Sam Lantinga
2d74fa0606 Fixed memory leak freeing cursors 2011-02-28 22:21:32 -08:00
Sam Lantinga
290017c996 You can use SDL_ConvertSurfaceFormat() now
Also, icon is guaranteed not to be NULL going into this function.
2011-02-28 21:58:37 -08:00
Sam Lantinga
219b2071c2 Oh yeah, we're using extern 2011-02-28 21:48:02 -08:00
Sam Lantinga
7a23a71fd1 Fullscreen doesn't automatically grab the cursor. 2011-02-28 20:19:28 -08:00
Sam Lantinga
6c05fff576 Removed duplicate assignment 2011-02-28 18:03:14 -08:00
Sam Lantinga
8708e59683 If you pass in texture format 0, it'll use the first supported texture format. 2011-02-28 14:47:39 -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
f0ee261c7b Implemented mouse relative mode on Mac OS X. 2011-02-27 22:06:46 -08:00
Sam Lantinga
0068b61c49 Added a cleaner way to set the default cursor.
Added a way to cycle through the default cursor in testcursor.c
2011-02-27 21:36:23 -08:00
Sam Lantinga
8b92536842 Fixed minimizing fullscreen windows.
Removed misleading hide/unhide Cocoa notifications.
We have no way of knowing when a Cocoa window is maximized and then restored (right?)
Disabled spamy mouse motion events by default.
2011-02-27 21:17:06 -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