Unpacked project archives to get individual file history in subversion

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402564
This commit is contained in:
Sam Lantinga 2007-07-21 17:09:01 +00:00
parent 98ce0f8871
commit 316a61731f
199 changed files with 90702 additions and 16 deletions

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Description</key>
<string>This project builds an SDL-based application with Cocoa menus.</string>
<key>FilesToMacroExpand</key>
<array>
<string>English.lproj/InfoPlist.strings</string>
</array>
</dict>
</plist>

View file

@ -0,0 +1,370 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 38;
objects = {
080E96DDFE201D6D7F000001 = {
children = (
F5A47A9D01A0482F01D3D55B,
F5A47A9E01A0483001D3D55B,
);
isa = PBXGroup;
name = Classes;
refType = 4;
};
089C165CFE840E0CC02AAC07 = {
children = (
089C165DFE840E0CC02AAC07,
);
isa = PBXVariantGroup;
name = InfoPlist.strings;
refType = 4;
};
089C165DFE840E0CC02AAC07 = {
fileEncoding = 10;
isa = PBXFileReference;
name = English;
path = English.lproj/InfoPlist.strings;
refType = 4;
};
089C165EFE840E0CC02AAC07 = {
fileRef = 089C165CFE840E0CC02AAC07;
isa = PBXBuildFile;
settings = {
};
};
//080
//081
//082
//083
//084
//100
//101
//102
//103
//104
1058C7A0FEA54F0111CA2CBB = {
children = (
1058C7A1FEA54F0111CA2CBB,
);
isa = PBXGroup;
name = "Linked Frameworks";
refType = 4;
};
1058C7A1FEA54F0111CA2CBB = {
isa = PBXFrameworkReference;
name = Cocoa.framework;
path = /System/Library/Frameworks/Cocoa.framework;
refType = 0;
};
1058C7A2FEA54F0111CA2CBB = {
children = (
29B97325FDCFA39411CA2CEA,
29B97324FDCFA39411CA2CEA,
);
isa = PBXGroup;
name = "Other Frameworks";
refType = 4;
};
1058C7A3FEA54F0111CA2CBB = {
fileRef = 1058C7A1FEA54F0111CA2CBB;
isa = PBXBuildFile;
settings = {
};
};
//100
//101
//102
//103
//104
//170
//171
//172
//173
//174
17587328FF379C6511CA2CBB = {
isa = PBXApplicationReference;
path = "«PROJECTNAME».app";
refType = 3;
};
//170
//171
//172
//173
//174
//190
//191
//192
//193
//194
19C28FACFE9D520D11CA2CBB = {
children = (
17587328FF379C6511CA2CBB,
);
isa = PBXGroup;
name = Products;
refType = 4;
};
//190
//191
//192
//193
//194
//290
//291
//292
//293
//294
29B97313FDCFA39411CA2CEA = {
buildStyles = (
4A9504CCFFE6A4B311CA0CBA,
4A9504CDFFE6A4B311CA0CBA,
);
hasScannedForEncodings = 1;
isa = PBXProject;
mainGroup = 29B97314FDCFA39411CA2CEA;
projectDirPath = "";
targets = (
29B97326FDCFA39411CA2CEA,
);
};
29B97314FDCFA39411CA2CEA = {
children = (
080E96DDFE201D6D7F000001,
29B97315FDCFA39411CA2CEA,
29B97317FDCFA39411CA2CEA,
29B97323FDCFA39411CA2CEA,
19C28FACFE9D520D11CA2CBB,
);
isa = PBXGroup;
name = "«PROJECTNAMEASXML»";
path = "";
refType = 4;
};
29B97315FDCFA39411CA2CEA = {
children = (
F5A47A9F01A0483001D3D55B,
);
isa = PBXGroup;
name = "Other Sources";
path = "";
refType = 4;
};
29B97317FDCFA39411CA2CEA = {
children = (
089C165CFE840E0CC02AAC07,
B2F367C504C7ADC700A80002,
);
isa = PBXGroup;
name = Resources;
path = "";
refType = 4;
};
29B97323FDCFA39411CA2CEA = {
children = (
1058C7A0FEA54F0111CA2CBB,
1058C7A2FEA54F0111CA2CBB,
);
isa = PBXGroup;
name = Frameworks;
path = "";
refType = 4;
};
29B97324FDCFA39411CA2CEA = {
isa = PBXFrameworkReference;
name = AppKit.framework;
path = /System/Library/Frameworks/AppKit.framework;
refType = 0;
};
29B97325FDCFA39411CA2CEA = {
isa = PBXFrameworkReference;
name = Foundation.framework;
path = /System/Library/Frameworks/Foundation.framework;
refType = 0;
};
29B97326FDCFA39411CA2CEA = {
buildPhases = (
29B97327FDCFA39411CA2CEA,
29B97328FDCFA39411CA2CEA,
29B9732BFDCFA39411CA2CEA,
29B9732DFDCFA39411CA2CEA,
);
buildSettings = {
FRAMEWORK_SEARCH_PATHS = "\"/Library/Frameworks\"";
HEADER_SEARCH_PATHS = "\"/Library/Frameworks/SDL.framework/Headers\"";
INSTALL_PATH = "$(HOME)/Applications";
LIBRARY_SEARCH_PATHS = "";
OTHER_LDFLAGS = "-framework SDL";
PRODUCT_NAME = "«PROJECTNAME»";
SECTORDER_FLAGS = "";
WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
WRAPPER_EXTENSION = app;
};
dependencies = (
);
isa = PBXApplicationTarget;
name = "«PROJECTNAME»";
productInstallPath = "$(HOME)/Applications";
productName = "«PROJECTNAME»";
productReference = 17587328FF379C6511CA2CBB;
productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
<plist version=\"1.0\">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>«PROJECTNAMEASXML»</key>
<string>SDL Cocoa App</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0.1</string>
<key>NSMainNibFile</key>
<string>SDLMain.nib</string>
<key>NSPrincipalClass</key>
<string>SDLApplication</string>
</dict>
</plist>
";
};
29B97327FDCFA39411CA2CEA = {
buildActionMask = 2147483647;
files = (
F5A47AA101A0483001D3D55B,
);
isa = PBXHeadersBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
};
29B97328FDCFA39411CA2CEA = {
buildActionMask = 2147483647;
files = (
089C165EFE840E0CC02AAC07,
B2F367C604C7ADC700A80002,
);
isa = PBXResourcesBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
};
29B9732BFDCFA39411CA2CEA = {
buildActionMask = 2147483647;
files = (
F5A47AA301A0483001D3D55B,
F5A47AA401A0483001D3D55B,
);
isa = PBXSourcesBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
};
29B9732DFDCFA39411CA2CEA = {
buildActionMask = 2147483647;
files = (
1058C7A3FEA54F0111CA2CBB,
);
isa = PBXFrameworksBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
};
//290
//291
//292
//293
//294
//4A0
//4A1
//4A2
//4A3
//4A4
4A9504CCFFE6A4B311CA0CBA = {
buildRules = (
);
buildSettings = {
COPY_PHASE_STRIP = NO;
OPTIMIZATION_CFLAGS = "-O0";
};
isa = PBXBuildStyle;
name = Development;
};
4A9504CDFFE6A4B311CA0CBA = {
buildRules = (
);
buildSettings = {
COPY_PHASE_STRIP = YES;
};
isa = PBXBuildStyle;
name = Deployment;
};
//4A0
//4A1
//4A2
//4A3
//4A4
//B20
//B21
//B22
//B23
//B24
B2F367C504C7ADC700A80002 = {
isa = PBXFileReference;
path = SDLMain.nib;
refType = 4;
};
B2F367C604C7ADC700A80002 = {
fileRef = B2F367C504C7ADC700A80002;
isa = PBXBuildFile;
settings = {
};
};
//B20
//B21
//B22
//B23
//B24
//F50
//F51
//F52
//F53
//F54
F5A47A9D01A0482F01D3D55B = {
fileEncoding = 30;
isa = PBXFileReference;
path = SDLMain.h;
refType = 2;
};
F5A47A9E01A0483001D3D55B = {
fileEncoding = 30;
isa = PBXFileReference;
path = SDLMain.m;
refType = 2;
};
F5A47A9F01A0483001D3D55B = {
fileEncoding = 30;
isa = PBXFileReference;
path = main.c;
refType = 2;
};
F5A47AA101A0483001D3D55B = {
fileRef = F5A47A9D01A0482F01D3D55B;
isa = PBXBuildFile;
settings = {
};
};
F5A47AA301A0483001D3D55B = {
fileRef = F5A47A9E01A0483001D3D55B;
isa = PBXBuildFile;
settings = {
};
};
F5A47AA401A0483001D3D55B = {
fileRef = F5A47A9F01A0483001D3D55B;
isa = PBXBuildFile;
settings = {
};
};
};
rootObject = 29B97313FDCFA39411CA2CEA;
}

View file

@ -0,0 +1,17 @@
/* SDLMain.m - main entry point for our Cocoa-ized SDL app
Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
Non-NIB-Code & other changes: Max Horn <max@quendi.de>
Feel free to customize this file to suit your needs
*/
#import <Cocoa/Cocoa.h>
@interface SDLMain : NSObject
- (IBAction)prefsMenu:(id)sender;
- (IBAction)newGame:(id)sender;
- (IBAction)openGame:(id)sender;
- (IBAction)saveGame:(id)sender;
- (IBAction)saveGameAs:(id)sender;
- (IBAction)help:(id)sender;
@end

View file

@ -0,0 +1,436 @@
/* SDLMain.m - main entry point for our Cocoa-ized SDL app
Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
Non-NIB-Code & other changes: Max Horn <max@quendi.de>
Feel free to customize this file to suit your needs
*/
#import "SDL.h"
#import "SDLMain.h"
#import <sys/param.h> /* for MAXPATHLEN */
#import <unistd.h>
/* For some reaon, Apple removed setAppleMenu from the headers in 10.4,
but the method still is there and works. To avoid warnings, we declare
it ourselves here. */
@interface NSApplication(SDL_Missing_Methods)
- (void)setAppleMenu:(NSMenu *)menu;
@end
/* Use this flag to determine whether we use SDLMain.nib or not */
#define SDL_USE_NIB_FILE 1
/* Use this flag to determine whether we use CPS (docking) or not */
#define SDL_USE_CPS 1
#ifdef SDL_USE_CPS
/* Portions of CPS.h */
typedef struct CPSProcessSerNum
{
UInt32 lo;
UInt32 hi;
} CPSProcessSerNum;
extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn);
extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn);
#endif /* SDL_USE_CPS */
static int gArgc;
static char **gArgv;
static BOOL gFinderLaunch;
static BOOL gCalledAppMainline = FALSE;
static NSString *getApplicationName(void)
{
NSDictionary *dict;
NSString *appName = 0;
/* Determine the application name */
dict = (NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle());
if (dict)
appName = [dict objectForKey: @"CFBundleName"];
if (![appName length])
appName = [[NSProcessInfo processInfo] processName];
return appName;
}
#if SDL_USE_NIB_FILE
/* A helper category for NSString */
@interface NSString (ReplaceSubString)
- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString;
@end
#endif
@interface SDLApplication : NSApplication
@end
@implementation SDLApplication
/* Invoked from the Quit menu item */
- (void)terminate:(id)sender
{
/* Post a SDL_QUIT event */
SDL_Event event;
event.type = SDL_QUIT;
SDL_PushEvent(&event);
}
@end
/* The main class of the application, the application's delegate */
@implementation SDLMain
- (IBAction)prefsMenu:(id)sender
{
printf ("prefs menu\n");
}
- (IBAction)newGame:(id)sender
{
printf ("new game\n");
NSRunAlertPanel (@"Get ready to blow up some... stuff!",
@"Click OK to begin total carnage. Click Cancel to prevent total carnage.", @"OK", @"Cancel", nil);
}
- (IBAction)openGame:(id)sender
{
NSString *path = nil;
NSOpenPanel *openPanel = [ NSOpenPanel openPanel ];
if ( [ openPanel runModalForDirectory:nil
file:@"SavedGame" types:nil ] ) {
path = [ [ openPanel filenames ] objectAtIndex:0 ];
}
printf ("open game: %s\n", [ path cString ]);
}
- (IBAction)saveGame:(id)sender
{
NSString *path = nil;
NSSavePanel *savePanel = [ NSSavePanel savePanel ];
if ( [ savePanel runModalForDirectory:nil
file:@"SaveGameFile" ] ) {
path = [ savePanel filename ];
}
printf ("save game: %s\n", [ path cString ]);
}
- (IBAction)saveGameAs:(id)sender
{
printf ("save game as\n");
}
- (IBAction)help:(id)sender
{
NSRunAlertPanel (@"Oh help, where have ye gone?",
@"Sorry, there is no help available.\n\nThis message brought to you by We Don't Document, Inc.\n\n", @"Rats", @"Good, I never read it anyway", nil);
}
/* Set the working directory to the .app's parent directory */
- (void) setupWorkingDirectory:(BOOL)shouldChdir
{
if (shouldChdir)
{
char parentdir[MAXPATHLEN];
CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url);
if (CFURLGetFileSystemRepresentation(url2, true, (UInt8 *)parentdir, MAXPATHLEN)) {
assert ( chdir (parentdir) == 0 ); /* chdir to the binary app's parent */
}
CFRelease(url);
CFRelease(url2);
}
}
#if SDL_USE_NIB_FILE
/* Fix menu to contain the real app name instead of "SDL App" */
- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName
{
NSRange aRange;
NSEnumerator *enumerator;
NSMenuItem *menuItem;
aRange = [[aMenu title] rangeOfString:@"SDL App"];
if (aRange.length != 0)
[aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]];
enumerator = [[aMenu itemArray] objectEnumerator];
while ((menuItem = [enumerator nextObject]))
{
aRange = [[menuItem title] rangeOfString:@"SDL App"];
if (aRange.length != 0)
[menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]];
if ([menuItem hasSubmenu])
[self fixMenu:[menuItem submenu] withAppName:appName];
}
[ aMenu sizeToFit ];
}
#else
static void setApplicationMenu(void)
{
/* warning: this code is very odd */
NSMenu *appleMenu;
NSMenuItem *menuItem;
NSString *title;
NSString *appName;
appName = getApplicationName();
appleMenu = [[NSMenu alloc] initWithTitle:@""];
/* Add menu items */
title = [@"About " stringByAppendingString:appName];
[appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
[appleMenu addItem:[NSMenuItem separatorItem]];
title = [@"Hide " stringByAppendingString:appName];
[appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"];
menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
[menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
[appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""];
[appleMenu addItem:[NSMenuItem separatorItem]];
title = [@"Quit " stringByAppendingString:appName];
[appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"];
/* Put menu into the menubar */
menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
[menuItem setSubmenu:appleMenu];
[[NSApp mainMenu] addItem:menuItem];
/* Tell the application object that this is now the application menu */
[NSApp setAppleMenu:appleMenu];
/* Finally give up our references to the objects */
[appleMenu release];
[menuItem release];
}
/* Create a window menu */
static void setupWindowMenu(void)
{
NSMenu *windowMenu;
NSMenuItem *windowMenuItem;
NSMenuItem *menuItem;
windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
/* "Minimize" item */
menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"];
[windowMenu addItem:menuItem];
[menuItem release];
/* Put menu into the menubar */
windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""];
[windowMenuItem setSubmenu:windowMenu];
[[NSApp mainMenu] addItem:windowMenuItem];
/* Tell the application object that this is now the window menu */
[NSApp setWindowsMenu:windowMenu];
/* Finally give up our references to the objects */
[windowMenu release];
[windowMenuItem release];
}
/* Replacement for NSApplicationMain */
static void CustomApplicationMain (int argc, char **argv)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
SDLMain *sdlMain;
/* Ensure the application object is initialised */
[SDLApplication sharedApplication];
#ifdef SDL_USE_CPS
{
CPSProcessSerNum PSN;
/* Tell the dock about us */
if (!CPSGetCurrentProcess(&PSN))
if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
if (!CPSSetFrontProcess(&PSN))
[SDLApplication sharedApplication];
}
#endif /* SDL_USE_CPS */
/* Set up the menubar */
[NSApp setMainMenu:[[NSMenu alloc] init]];
setApplicationMenu();
setupWindowMenu();
/* Create SDLMain and make it the app delegate */
sdlMain = [[SDLMain alloc] init];
[NSApp setDelegate:sdlMain];
/* Start the main event loop */
[NSApp run];
[sdlMain release];
[pool release];
}
#endif
/*
* Catch document open requests...this lets us notice files when the app
* was launched by double-clicking a document, or when a document was
* dragged/dropped on the app's icon. You need to have a
* CFBundleDocumentsType section in your Info.plist to get this message,
* apparently.
*
* Files are added to gArgv, so to the app, they'll look like command line
* arguments. Previously, apps launched from the finder had nothing but
* an argv[0].
*
* This message may be received multiple times to open several docs on launch.
*
* This message is ignored once the app's mainline has been called.
*/
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
{
const char *temparg;
size_t arglen;
char *arg;
char **newargv;
if (!gFinderLaunch) /* MacOS is passing command line args. */
return FALSE;
if (gCalledAppMainline) /* app has started, ignore this document. */
return FALSE;
temparg = [filename UTF8String];
arglen = SDL_strlen(temparg) + 1;
arg = (char *) SDL_malloc(arglen);
if (arg == NULL)
return FALSE;
newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2));
if (newargv == NULL)
{
SDL_free(arg);
return FALSE;
}
gArgv = newargv;
SDL_strlcpy(arg, temparg, arglen);
gArgv[gArgc++] = arg;
gArgv[gArgc] = NULL;
return TRUE;
}
/* Called when the internal event loop has just started running */
- (void) applicationDidFinishLaunching: (NSNotification *) note
{
int status;
/* Set the working directory to the .app's parent directory */
[self setupWorkingDirectory:gFinderLaunch];
#if SDL_USE_NIB_FILE
/* Set the main menu to contain the real app name instead of "SDL App" */
[self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()];
#endif
/* Hand off to main application code */
gCalledAppMainline = TRUE;
status = SDL_main (gArgc, gArgv);
/* We're done, thank you for playing */
exit(status);
}
@end
@implementation NSString (ReplaceSubString)
- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
{
unsigned int bufferSize;
unsigned int selfLen = [self length];
unsigned int aStringLen = [aString length];
unichar *buffer;
NSRange localRange;
NSString *result;
bufferSize = selfLen + aStringLen - aRange.length;
buffer = NSAllocateMemoryPages(bufferSize*sizeof(unichar));
/* Get first part into buffer */
localRange.location = 0;
localRange.length = aRange.location;
[self getCharacters:buffer range:localRange];
/* Get middle part into buffer */
localRange.location = 0;
localRange.length = aStringLen;
[aString getCharacters:(buffer+aRange.location) range:localRange];
/* Get last part into buffer */
localRange.location = aRange.location + aRange.length;
localRange.length = selfLen - localRange.location;
[self getCharacters:(buffer+aRange.location+aStringLen) range:localRange];
/* Build output string */
result = [NSString stringWithCharacters:buffer length:bufferSize];
NSDeallocateMemoryPages(buffer, bufferSize);
return result;
}
@end
#ifdef main
# undef main
#endif
/* Main entry point to executable - should *not* be SDL_main! */
int main (int argc, char **argv)
{
/* Copy the arguments into a global variable */
/* This is passed if we are launched by double-clicking */
if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) {
gArgv = (char **) SDL_malloc(sizeof (char *) * 2);
gArgv[0] = argv[0];
gArgv[1] = NULL;
gArgc = 1;
gFinderLaunch = YES;
} else {
int i;
gArgc = argc;
gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1));
for (i = 0; i <= argc; i++)
gArgv[i] = argv[i];
gFinderLaunch = NO;
}
#if SDL_USE_NIB_FILE
[SDLApplication poseAsClass:[NSApplication class]];
NSApplicationMain (argc, argv);
#else
CustomApplicationMain (argc, argv);
#endif
return 0;
}

View file

@ -0,0 +1,19 @@
{
IBClasses = (
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {
help = id;
newGame = id;
openGame = id;
prefsMenu = id;
saveGame = id;
saveGameAs = id;
};
CLASS = SDLMain;
LANGUAGE = ObjC;
SUPERCLASS = NSObject;
}
);
IBVersion = 1;
}

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>62 117 356 240 0 0 1152 848 </string>
<key>IBEditorPositions</key>
<dict>
<key>29</key>
<string>62 362 195 44 0 0 1152 848 </string>
</dict>
<key>IBFramework Version</key>
<string>291.0</string>
<key>IBOpenObjects</key>
<array>
<integer>29</integer>
</array>
<key>IBSystem Version</key>
<string>6L60</string>
</dict>
</plist>

View file

@ -0,0 +1,65 @@
/* Simple program: Create a blank window, wait for keypress, quit.
Please see the SDL documentation for details on using the SDL API:
/Developer/Documentation/SDL/docs.html
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "SDL.h"
int main(int argc, char *argv[])
{
Uint32 initflags = SDL_INIT_VIDEO; /* See documentation for details */
SDL_Surface *screen;
Uint8 video_bpp = 0;
Uint32 videoflags = SDL_SWSURFACE;
int done;
SDL_Event event;
/* Initialize the SDL library */
if ( SDL_Init(initflags) < 0 ) {
fprintf(stderr, "Couldn't initialize SDL: %s\n",
SDL_GetError());
exit(1);
}
/* Set 640x480 video mode */
screen=SDL_SetVideoMode(640,480, video_bpp, videoflags);
if (screen == NULL) {
fprintf(stderr, "Couldn't set 640x480x%d video mode: %s\n",
video_bpp, SDL_GetError());
SDL_Quit();
exit(2);
}
done = 0;
while ( !done ) {
/* Check for events */
while ( SDL_PollEvent(&event) ) {
switch (event.type) {
case SDL_MOUSEMOTION:
break;
case SDL_MOUSEBUTTONDOWN:
break;
case SDL_KEYDOWN:
/* Any keypress quits the app... */
case SDL_QUIT:
done = 1;
break;
default:
break;
}
}
}
/* Clean up the SDL library */
SDL_Quit();
return(0);
}