Commit graph

3035 commits

Author SHA1 Message Date
Sunny Sachanandani
6f98c350da Xrender uses 16 bit color per channel. Fixed the color handling in X11_RenderFillRects to match this. Xrender just works now for filling rectangles :D . 2010-05-31 15:09:36 +05:30
Sunny Sachanandani
b4651b2a51 Modified configure.in to allow building with Xrender. Fixed all problems that prevented compilation.
Builds fine now :)
2010-05-31 13:27:27 +05:30
Jim Grandpre
f75117cf0f Auto-detects Wacom touch devices. 2010-05-31 00:24:37 -04:00
Sunny Sachanandani
9de49fce8f Add Xrender support to X11_FillRectangles. 2010-05-30 20:06:30 +05:30
Jim Grandpre
3dcae4341c Added pressure support for touch events. 2010-05-29 02:09:16 -04:00
Jim Grandpre
11b6823d3f Bug fixes. Basic touch events (finger up, finger down, finger move) supported. 2010-05-29 01:47:19 -04:00
Sunny Sachanandani
722be21623 Fix typo. 2010-05-28 20:48:58 +05:30
Sunny Sachanandani
66ba8d9f53 Fix initial value of the xrender_available boolean in X11_CreateTexture. 2010-05-28 20:47:24 +05:30
Sunny Sachanandani
7373f666db Completed work on X11_CreateTexture. Added lots of safety features.
These include support for drawing a texture using the core protocol
while other textures are drawn using Xrender if Xrender does not support
the color format of the said texture or any other fault with Xrender.
2010-05-28 20:40:09 +05:30
Jim Grandpre
72c5a40b07 Added reading of event* for touch events. 2010-05-28 01:26:52 -04:00
Eli Gottlieb
608b696abd Added the standard headers and footers that make SDL_shape.h and SDL_shape.c integrate properly into the build. 2010-05-27 16:44:35 -04:00
Jim Grandpre
f806d39746 Added touch event definitions. Heavily modified events/SDL_touch*. 2010-05-27 01:21:37 -04:00
Sunny Sachanandani
aef216819f Correctly handle the availability of Xrender in X11_CreateRenderer and X11_DisplayModeChanged.
Fixed the XRenderPictureAttributes value in X11_CreateRenderer with graphics_exposures = False.

Start work on Xrender specific additions to X11_TextureData and X11_CreateTexture.
2010-05-26 20:11:56 +05:30
Jim Grandpre
27ad25a09d Added SDL_touch.c/SDL_touch_c.h as slightly modifeind SDL_mouse*. Made reads in touchSimp non-blocking. 2010-05-25 23:23:23 -04:00
Sam Lantinga
52154ae7e4 SDL_KillThread() is no longer supported - it was always dangerous! :) 2010-05-24 22:56:36 -07:00
Sunny Sachanandani
dabea2387f Added a #define option for compile time Xrender support.
Added some more attributes (specific to Xrender) to the X11 structs.
Added some code for querying the Xrender extension.
2010-05-24 21:02:58 +05:30
Paul Hunkin
3634d8ffac Fix a compile error when SDL_JOYSTICK_DISABLED is set 2010-05-23 15:12:41 +12:00
Eli Gottlieb
1f57c052c4 Moved SDL_shape.h, and building out the API as needed by SDL_Eyes. 2010-05-21 17:28:12 -04:00
Eli Gottlieb
c40fb5a65d Added stub files, working on sample program SDLeyes. 2010-05-21 14:50:04 -04:00
Sunny Sachanandani
4ee62ed9e7 Adding a few #defines for Xrender support. 2010-05-19 18:58:28 +05:30
Sam Lantinga
338f95eb06 Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Plus, this lets me start implementing cursor support.
2010-05-09 20:47:22 -07:00
Sam Lantinga
76cf0cd0c0 Make the compiler even happier 2010-05-09 16:16:11 -07:00
Sam Lantinga
2a8171b8b7 Make sure events are current before flushing them. 2010-05-09 16:15:14 -07:00
Sam Lantinga
906341c826 Added missing header 2010-05-09 15:47:21 -07:00
Sam Lantinga
3bc34ef448 Removed unused variables 2010-05-09 15:46:19 -07:00
Sam Lantinga
06d5867775 Fixed compiler warnings 2010-05-09 15:33:10 -07:00
Sam Lantinga
74e352d011 Fixed variable use before initialize warnings 2010-05-09 15:24:31 -07:00
Sam Lantinga
0c3e29cd9c Removed unused variables 2010-05-09 15:24:05 -07:00
Sam Lantinga
dc6629fa52 Fixed Eric's changes to allow building from the command line. 2010-05-09 10:00:33 -07:00
Eric Wing
1a24b61487 Exempted writable modes from bundle check on OS X since bundle areas are typically read-only. 2010-05-08 04:52:17 -07:00
Eric Wing
95cc075a21 Added automated test to Xcode project plus needed changes to SDL_RWFromFile to be OS X bundle aware.
The Mac OS X project has a new target called testsdl which builds the automated test. I looked at using Xcode's native unit test support, but the impedance mismatch between the existing automated test structure and Apple's was more than I could handle.

As such, the testsdl application is a full blown proper OS X application, which means it is a self-contained .app bundle. This immediately revealed some problems from the automated test. The largest problem was the assumption about the current working directory and where to find resources. (I suspect Windows may have a similar problem depending on circumstance.) To open resources, the test was looking in directories relative to the SDL source directory, but this will not work well with self-contained .app bundles and Xcode which can place its built applications almost anywhere. And for real-world situations, this is pretty useless anyway.

So I modified SDL_RWFromFile to do special things on OS X. First, it will look for a file in the .app bundle. If not found, it will fallback and just call fopen as it used to do.

I also had to modify the automated test itself because it had a contrieved test which called fopen directly to do read from an existing FILE pointer. In addition, there was a write test. Since a .app bundle is likely going to be read-only, I added a special case for OS X to write to NSTemporaryDirectory.

I expect these changes should work for both Mac and iPhone OS (which includes iPad).

I will update the iPhone Xcode project next.

Finally, FYI, the X11 automated test seems to be failing. Below is my output.


Pending breakpoint 4 - "-[NSException raise]" resolved
Platform : All tests successful (2)
SDL_RWops : All tests successful (5)
Rect : All tests successful (1)
SDL_Surface : All tests successful (6)
Rendering with cocoa driver : All tests successful (3)
Assert Failed!
   Blit output not the same.
   Test Case 'Renderer x11'
   Test Suite 'Rendering with x11 driver'
   Last SDL error ''
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetSurfaceBounds
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetWindowBounds
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetSurfaceBounds
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetWindowBounds
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetSurfaceBounds
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetWindowBounds
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetSurfaceBounds
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetWindowBounds
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetSurfaceBounds
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetWindowBounds
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetSurfaceBounds
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetWindowBounds
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetSurfaceBounds
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May  8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Rendering with x11 driver : Failed 1 out of 4 testcases!
Rendering with dummy driver : All tests successful (3)
SDL_Audio : All tests successful (1)
Tests run with SDL 1.3.0 revision 1095906
System is running Mac OS X and is little endian
2010-05-08 00:54:22 -07:00
Ryan C. Gordon
b6ef5b01d8 Much improved multi-display support for iPad.
Fixes most issues and limitations, I think.
2010-05-02 05:08:12 -04:00
Ryan C. Gordon
953d5e65ea Test for system version in the Apple Recommended way.
(a similar test is output by Xcode for the iPhone View Application template).
2010-05-01 13:50:56 -04:00
Ryan C. Gordon
c236844aac Implemented SDL power APIs for iPhoneOS. 2010-04-30 00:39:31 -04:00
Ryan C. Gordon
4f49f9e01e Implemented display mode functionality for UIKit.
The iPad (and iPhoneOS 3.2) introduce both a larger screen and the ability to
 enumerate and configure external displays. This hooks up SDL's multi-display
 API to this new functionality, and removes the hardcoded iPhone resolution.
2010-04-29 22:53:18 -04:00
Jjgod Jiang
4a9fad4714 Fix a crash caused by empty keyboard focus
---
 src/events/SDL_keyboard.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
2010-04-20 07:16:42 -07:00
Sam Lantinga
5740f12d7b changeset: 4434:4e5dd7dc58cd
tag: tip
user: Jjgod Jiang <gzjjgod@gmail.com>
date: Fri Apr 16 13:20:33 2010 +0800
summary: Fix window height calculation for text input rect
2010-04-15 22:27:50 -07:00
Sam Lantinga
fc440f959f Minor cleanup on Jiang's patch 2010-04-15 22:27:01 -07:00
Sam Lantinga
f9a8341561 changeset: 4433:25667ea797fa
tag: tip
user: Jiang Jiang <gzjjgod@gmail.com>
date: Thu Apr 15 12:01:46 2010 +0800
summary: Add windowID to text editing event
2010-04-15 22:14:26 -07:00
Sam Lantinga
6f34ceab02 Fixed bug 984
SDL_CreateTexture allows the creation of textures of size 0, which can lead to div by 0 errors
2010-04-15 21:27:32 -07:00
Sam Lantinga
1fb2a69487 General improvements for user custom event registration
* Switched event type to enum (int32)
* Switched polling by mask to polling by type range
* Added SDL_RegisterEvents() to allow dynamic user event registration
* Spread events out to allow inserting new related events without breaking binary compatibility
* Added padding to event structures so they're the same size regardless of 32-bit compiler structure packing settings
* Split SDL_HasEvent() to SDL_HasEvent() for a single event and SDL_HasEvents() for a range of events
* Added SDL_GetEventState() as a shortcut for SDL_EventState(X, SDL_QUERY)
* Added SDL_FlushEvent() and SDL_FlushEvents() to clear events from the event queue
2010-03-25 01:08:26 -07:00
Sam Lantinga
d2ca31944f Fixed bug #943
Ozkan Sezer      2010-02-06 12:31:06 PST

Hi:

Here are some small fixes for compiling SDL against mingw-w64.
(see http://mingw-w64.sourceforge.net/ .  Despite the name, it
supports both win32 and win64.)

src/audio/windx5/directx.h and src/video/windx5/directx.h (both
SDL-1.2 and SDL-1.3.)  I get compilation errors about some union
not having a member named u1 and alike, because of other system
headers being included before this one and them already defining
DUMMYUNIONNAME and stuff. This header probably assumes that those
stuff are defined in windef.h, but mingw-w64 headers define them
in _mingw.h. Easily fixed by moving NONAMELESSUNION definition to
the top of the file.

src/thread/win32/SDL_systhread.c (both SDL-1.2 and SDL-1.3.) :
The __GNUC__ case for pfnSDL_CurrentBeginThread is 32-bit centric
because _beginthreadex returns uintptr_t, not unsigned long which
is 32 bits in win64. Changing the return type to uintptr_t fixes
it.

video/SDL_blit.h (and configure.in) (SDL-1.3-only) :  MinGW-w64
uses msvcrt version of _aligned_malloc and _aligned_free and
they are defined in intrin.h (similar to VC).  Adding proper
ifdefs fixes it. (Notes about macros to check: __MINGW32__ is
defined for both mingw.org and for mingw-w64 for both win32 and
win64, __MINGW64__ is only defined for _WIN64, so __MINGW64__
can't be used to detect mingw-w64: including _mingw.h and then
checking for __MINGW64_VERSION_MAJOR does the trick.)

SDL_win32video.h (SDL-1.3-only) :  Tweaked the VINWER definition
and location in order to avoid multiple redefinition warnings.

Hope these are useful. Thanks.
2010-03-10 15:02:58 +00:00
Edgar Simo
9aeb408fa2 Disable error checks for reset actuators and set autocenter.
Reset actuators and set autocenter might not actually be supported on all
 implementations. We'll just disable error checking since they aren't
 critical to neither opening the joystick nor the haptic subsystem.
2010-02-28 09:23:23 +00:00
Ryan C. Gordon
07cc73d801 Changed revision details to be a string (an hg changeset) instead of an int. 2010-02-28 02:07:40 -05:00
Sam Lantinga
6989ef71d5 Adam Strzelecki to SDL
When graphic card has no GL_ARB_texture_rectangle YUV textures mapped with SDL_RenderCopy are stretched 2x horizontally, so only left half of texture is visible. This is due:
       data->texw = (GLfloat) (texture->w) / texture_w;
       data->texh = (GLfloat) texture->h / texture_h;
But afterwards texture_w /= 2 for YUV texture, but data->texw stays as it was before, while it should be multiplied 2x.

This bug can be seen in any program setting env variables: GL_APPLE_ycbcr_422=0 GL_EXT_texture_rectangle=0 GL_ARB_texture_rectangle=0

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404468
2010-02-17 04:42:52 +00:00
Sam Lantinga
999d46db4a Make sure STRICT is defined so the window proc has the correct prototype
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404466
2010-02-14 15:55:10 +00:00
Sam Lantinga
3db86820f6 Fixed compile error using Borland C++
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404465
2010-02-14 15:16:13 +00:00
Ryan C. Gordon
2aa8294c06 Merged r5549:5550 from branches/SDL-1.2: ALSA 6-channel swizzle fix.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404464
2010-02-12 17:14:41 +00:00
Ryan C. Gordon
2570f36a05 Merged r5547:5548 from branches/SDL-1.2: FreeBSD joystick uninit'd var fix.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404462
2010-02-05 19:23:59 +00:00
Sam Lantinga
db2e29b2d0 Fixed showing and hiding fullscreen windows
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404457
2010-02-01 01:19:37 +00:00