Commit graph

432 commits

Author SHA1 Message Date
Sam Lantinga
0e59ffc802 Added support for keyboard repeat (only tested on Windows so far) 2010-07-20 23:25:24 -07:00
Eli Gottlieb
2d0aeb3f2e Put the render loop back in its right place, but with delaying functionality to keep it down to roughly 60fps, not eating up all the X11 time. 2010-07-19 00:24:02 -04:00
Eli Gottlieb
e2dcaac803 Boxed up the rendering loop and turned it into a redraw/update function. This makes things way more responsive, usable again. 2010-07-18 23:51:47 -04:00
Eli Gottlieb
60b401aef8 Added code to make testshape switch shapes on keystrokes and exit on an ESC keystroke. 2010-07-18 23:36:39 -04:00
Eli Gottlieb
70ad6fd4e9 Minor bugfixes. testshape now draws a shaped window with bizarre, pixellated gashes of transparency across it, and in doing so seems to hog a system resource and slow the rest of the video system down. 2010-07-18 23:05:40 -04:00
Eli Gottlieb
68fccc096b Same place as before, but optimizing a bit to try to isolate the spot in the program that locks things up. 2010-07-18 22:17:52 -04:00
Eli Gottlieb
86f3a25266 Rewrote test program for shaped windows. It definitely displays recognizable pictures now, but the resizing and shaping functionality isn't behaving correctly, possibly due to a miscalculation of alpha values. 2010-07-18 21:31:22 -04:00
Eli Gottlieb
7e104c5469 Updated testeyes.c. It now shows some kind of gibberish Missingno-type picture somewhere on the screen and, possibly, hangs the window system. On the upside, the Missingno is definitely a non-rectangular window. 2010-07-18 15:15:05 -04:00
Sam Lantinga
c1eb1e8f25 Added support for testing window manager icons 2010-07-14 21:25:15 -07:00
Sam Lantinga
51b5767091 Added test case for maximize code 2010-07-13 23:05:14 -07:00
Eli Gottlieb
20c4883dee Numerous bug fixes that keep testeyes from crashing and dying. 2010-07-14 00:49:28 -04:00
Ryan C. Gordon
e9eaf8d58d Removed compiled testeyes from revision control. Added it to ignore list. 2010-07-13 02:27:59 -04:00
Sam Lantinga
ff0ba0afa5 Added an event when the clipboard is updated, triggered after the window gains the keyboard focus. 2010-07-08 22:54:03 -07:00
Sam Lantinga
b75fc9b1a1 Added simple clipboard test 2010-07-08 00:00:07 -07:00
Eli Gottlieb
9f24e9f619 Updated test code, updated win32 code a bit (still not complete, but hopefully tonight), and removed the last vestiges of ellipse and polygon drawing support. 2010-07-06 22:05:22 -04:00
Sam Lantinga
8145b50223 Merged changes from default 2010-07-05 22:48:35 -07:00
Sam Lantinga
8cafde92ae Removed obsolete test program. Ryan may resurrect it when the new multi-mouse code is implemented. 2010-07-05 22:45:45 -07:00
Sam Lantinga
baf073e263 Fixed usage message - it shouldn't have a printf format specifier 2010-07-05 22:45:15 -07:00
Sam Lantinga
e03c43c49b Fixed revision type for SDL 1.3 2010-07-05 13:10:47 -07:00
Eli Gottlieb
caf743a102 Moved the SDL_Eyes test program for shaped windows into the Hg repository and got it building and linking as a test. 2010-05-31 21:23:06 -04:00
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
Eric Wing
6c9da257a1 Refactored automated rwops tests so read and write directories can be more easily customized.
The refactored tests were written in recognition that Mac and iPhone current working directories are usually not going to work. Resource directories are in bundles and write directories are restricted to certain areas. In theory, other platforms may have this problem too, hence the refactoring.

Also updated the Xcode iPhone project to use 3.2 as the Base SDK, but 3.1 as the Deployment SDK (for iPhone/iPad compatibility.)

--HG--
rename : test/automated/rwops/Test_rwopsbundlesupport.h => test/automated/rwops/TestSupportRWops.h
rename : test/automated/rwops/Test_rwopsbundlesupport.m => test/automated/rwops/TestSupportRWops_Cocoa.m
2010-05-09 06:58:30 -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
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
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
5392fa233c Fixed compile warning on 64-bit Mac OS X
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404440
2010-01-21 07:22:11 +00:00
Sam Lantinga
a0e019f786 Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404438
2010-01-21 06:21:52 +00:00
Sam Lantinga
d7496843fc Fixed compiler warnings on 32-bit Linux
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404437
2010-01-21 05:49:41 +00:00
Sam Lantinga
c47e208c6b Moved the assertion tests to testplatform
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404414
2010-01-13 09:48:42 +00:00
Sam Lantinga
d663865d8c Quiet tests shouldn't prompt during assertions
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404409
2010-01-13 08:52:47 +00:00
Ryan C. Gordon
b9cd3d04fb Removed incorrect SDL_GetAudioDeviceName() call from loopwave.c.
SDL_GetAudioDeviceName(1, 0) does not mean "name of the default output device."

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404389
2010-01-11 07:58:55 +00:00
Ryan C. Gordon
896072b2b1 Call SDL_Init() before SDL_GetNumAudioDrivers().
Not sure why that was reversed.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404386
2010-01-10 19:09:57 +00:00
Ryan C. Gordon
9d95b50471 Merged r4874:4875 from branches/SDL-1.2: testwm keyboard debug output.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404385
2010-01-10 18:25:04 +00:00
Ryan C. Gordon
f30bac45d2 Reverted r5460 ... this was merged from 1.2, but was later reverted there.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404374
2010-01-10 05:06:03 +00:00
Ryan C. Gordon
065e14eb5d Merged r4784:4785 from branches/SDL-1.2: Mac OS X linker command line fixes.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404373
2010-01-10 04:42:45 +00:00
Sam Lantinga
1411a41ebd Added missing include for stdio
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404351
2009-12-24 21:00:42 +00:00
Sam Lantinga
6da163ab81 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.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404346
2009-12-23 01:55:00 +00:00
Sam Lantinga
b634dea37a Fixed bug #841
The redefinition of M_PI is no longer necessary...

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404338
2009-12-17 06:08:20 +00:00
Ryan C. Gordon
8b304825b5 Initial band-aids on SDL_GetMouseState() API breakage. More work to come.
Fixes Bugzilla #758.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404334
2009-12-16 19:50:51 +00:00
Ryan C. Gordon
791f5dbce4 Implemented SDL_setenv(), moved SDL_putenv() to compat.
Fixes Bugzilla #779.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404330
2009-12-16 10:59:51 +00:00
Sam Lantinga
29601c280b Added SDL_GetCPUCount() to see how many cores are available.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404328
2009-12-16 06:53:53 +00:00
Sam Lantinga
3f0f9188ed 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.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404327
2009-12-16 04:48:11 +00:00
Sam Lantinga
777b877a72 Added testfill to test raw fill performance
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404325
2009-12-16 02:08:59 +00:00
Sam Lantinga
240b5fcaab Default to allow either accelerated or not
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404320
2009-12-15 20:53:09 +00:00
Sam Lantinga
fe2b42f86c OpenGL hardware acceleration defaults on
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404319
2009-12-15 20:36:31 +00:00
Sam Lantinga
0158b925d3 The SDL 1.3 tests have been cleaned up not to include any 1.2 compatibility code.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404309
2009-12-14 23:29:37 +00:00
Sam Lantinga
c2767e72dd Added a test to check the read/write pixels API
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404306
2009-12-14 06:35:59 +00:00
Sam Lantinga
9888012562 Allow points to be outside the window bounds, stress testing the clipping code.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404294
2009-12-12 00:08:45 +00:00
Sam Lantinga
0e0b96d72f Added mouse position for button handling
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404293
2009-12-12 00:08:02 +00:00