Commit graph

122 commits

Author SHA1 Message Date
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
a448d86eb8 Updated Mac OS X projects with new assertion code
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404432
2010-01-18 14:50:57 +00:00
Sam Lantinga
819f28ff22 Fixed Mac OS X Xcode build
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404393
2010-01-13 05:08:41 +00:00
Sam Lantinga
3fcfb40e22 Eric Wing to Sam
Included is the fix for the missing SDL_revision.h in the framework.

Also, I include the project template fixes for the prefix header files. But since this is in SVN directly, you must rename the files named
SDLApp_Prefix.pch
to
___PROJECTNAMEASIDENTIFIER____Prefix.pch

in the TemplatesForXcodeSnowLeopard and TemplatesForXcodeLeopard directories. (Do not rename the Tiger ones.)

--HG--
rename : Xcode/TemplatesForXcodeLeopard/SDL Application/SDLApp_Prefix.pch => Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch
rename : Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/SDLApp_Prefix.pch => Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch
rename : Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/SDLApp_Prefix.pch => Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch
rename : Xcode/TemplatesForXcodeSnowLeopard/SDL Application/SDLApp_Prefix.pch => Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch
rename : Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/SDLApp_Prefix.pch => Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch
rename : Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/SDLApp_Prefix.pch => Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403963
2009-10-04 16:26:34 +00:00
Sam Lantinga
7210963bc0 Eric Wing to Sam
Lots of fixes.
Fixed missing power management building.
Added template icons to the project templates.
DocSet stuff
Documentation fixes..

Fixed all the SDLtests. (Lots of tedious work.) It now depends on the static library target for convenience so I am not going to remove it from the SDL xcode project.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403952
2009-10-01 15:30:26 +00:00
Sam Lantinga
64da4d2ac8 Getting ready for a new drop from Eric, hopefully the last time I have to wipe this.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403951
2009-10-01 15:26:39 +00:00
Sam Lantinga
910fc5ed91 Eric Wing to Sam
I refactored how the shell script code-gen phases were setup in the Xcode project.
I also removed the SDLmain files from the project templates.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403899
2009-09-26 03:58:35 +00:00
Sam Lantinga
353fa3e13e Eric Wing to Sam
Removed the SDLMain lines from the packaging scripts.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403894
2009-09-24 14:43:03 +00:00
Sam Lantinga
e5ae941a74 Updated Xcode project from Eric Wing
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403893
2009-09-24 07:13:02 +00:00
Sam Lantinga
4fc2b759c2 Getting ready for a new Xcode project from Eric Wing
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403892
2009-09-24 07:12:05 +00:00
Sam Lantinga
ade846f1f1 Updated Xcode project for latest file changes
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403780
2009-09-05 19:34:51 +00:00
Sam Lantinga
554dcb60df Added SDL_revision.h
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403729
2009-08-02 18:40:18 +00:00
Sam Lantinga
72f55d5d83 Added missing SDL_revision.h
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403721
2009-08-02 13:49:13 +00:00
Sam Lantinga
d942501bf9 Added SDL_atomic.h and SDL_power.h to public API headers
Added atomic source files (which don't compile currently)

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403719
2009-08-02 13:08:19 +00:00
Ryan C. Gordon
127f4698a7 Added power subsystem to Xcode project.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403629
2009-06-07 06:42:15 +00:00
Sam Lantinga
30af8c9442 Updated project with new source files
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403379
2008-12-25 04:56:44 +00:00
Ryan C. Gordon
338ff54f1e Add XInput support to Xcode project (untested!).
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403221
2008-09-17 08:24:51 +00:00
Sam Lantinga
a9ba7ee031 indent
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403208
2008-09-15 04:32:36 +00:00
Edgar Simo
ff035aa8e4 Update to xcode to include haptic subsystem stuff by Alam.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403181
2008-08-26 11:18:34 +00:00
Sam Lantinga
e8f122166c Date: Wed, 7 May 2008 21:48:10 +0200
From: Christian Walther
Subject: SDL 1.3 Xcode projects

Here are my promised updates to the Xcode projects. They work as far
as I'm using them, but I have not tested them thoroughly, and there
may still be some cruft left. In particular, I haven't checked whether
the frameworks still work on older versions of Mac OS X (are we still
targeting 10.2?), and whether Altivec/SSE optimizations are properly
done. Of note: I incremented the framework version to B to enable SDL
1.2 and 1.3 to coexist in a single framework.

Let me know if you see any problems.

Greetings

   Christian

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402757
2008-05-08 05:06:24 +00:00
Sam Lantinga
8ba098b0e2 Updated Xcode project from Eric Wing
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402756
2008-05-02 14:55:08 +00:00
Sam Lantinga
316a61731f Unpacked project archives to get individual file history in subversion
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402564
2007-07-21 17:09:01 +00:00