-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added initial support for Quartz video (thanks Darrell!)
- Loading branch information
Sam Lantinga
committed
Jun 7, 2001
1 parent
0795576
commit 924ec82
Showing
23 changed files
with
2,131 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#import <Cocoa/Cocoa.h> | ||
|
||
@interface SDLMain : NSObject | ||
{ | ||
} | ||
- (IBAction)quit:(id)sender; | ||
- (IBAction)makeFullscreen:(id)sender; | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/* SDLMain.m - main entry point for our Cocoa-ized SDL app | ||
Darrell Walisser - dwaliss1@purdue.edu | ||
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> | ||
|
||
static int gArgc; | ||
static char **gArgv; | ||
|
||
/* The main class of the application, the application's delegate */ | ||
@implementation SDLMain | ||
|
||
/* Invoked from the Quit menu item */ | ||
- (void) quit:(id)sender | ||
{ | ||
SDL_Event event; | ||
event.type = SDL_QUIT; | ||
SDL_PushEvent(&event); | ||
} | ||
|
||
/* Invoked from the "Make fulllscreen" menu item */ | ||
- (void) makeFullscreen:(id)sender | ||
{ | ||
|
||
} | ||
|
||
/* Set the working directory to the .app's parent directory */ | ||
- (void) setupWorkingDirectory | ||
{ | ||
char parentdir[MAXPATHLEN]; | ||
char *c; | ||
|
||
strncpy ( parentdir, gArgv[0], MAXPATHLEN ); | ||
c = (char*) parentdir; | ||
|
||
while (*c != '\0') /* go to end */ | ||
c++; | ||
|
||
while (*c != '/') /* back up to parent */ | ||
c--; | ||
|
||
*c = '\0'; /* cut off last part (binary name) */ | ||
|
||
assert ( chdir (parentdir) == 0 ); /* chdir to the binary app's parent */ | ||
assert ( chdir ("../../../") == 0 ); /* chdir to the .app's parent */ | ||
} | ||
|
||
/* Called when the internal event loop has just started running */ | ||
- (void) applicationDidFinishLaunching: (NSNotification *) note | ||
{ | ||
/* Set the working directory to the .app's parent directory */ | ||
[ self setupWorkingDirectory ]; | ||
|
||
/* This is passed if we are launched by double-clicking */ | ||
if ( gArgc >= 2 && strncmp (gArgv[1], "-psn", 4) == 0 ) | ||
gArgc = 1; | ||
|
||
/* Hand off to main application code */ | ||
SDL_main (gArgc, gArgv); | ||
exit(0); | ||
} | ||
@end | ||
|
||
#ifdef main | ||
# undef main | ||
#endif | ||
|
||
/* Main entry point to executible - should *not* be SDL_main! */ | ||
int main (int argc, char **argv) { | ||
|
||
/* Copy the arguments into a global variable */ | ||
int i; | ||
|
||
gArgc = argc; | ||
gArgv = (char**) malloc (sizeof(*gArgv) * gArgc); | ||
assert (gArgv != NULL); | ||
for (i = 0; i < gArgc; i++) { | ||
gArgv[i] = strdup (argv[i]); | ||
} | ||
|
||
NSApplicationMain (argc, argv); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
EXPORTS = SDL.x | ||
HEADERS = \ | ||
../../../../include/SDL.h \ | ||
../../../../include/SDL_active.h \ | ||
../../../../include/SDL_audio.h \ | ||
../../../../include/SDL_byteorder.h \ | ||
../../../../include/SDL_cdrom.h \ | ||
../../../../include/SDL_copying.h \ | ||
../../../../include/SDL_endian.h \ | ||
../../../../include/SDL_error.h \ | ||
../../../../include/SDL_events.h \ | ||
../../../../include/SDL_getenv.h \ | ||
../../../../include/SDL_joystick.h \ | ||
../../../../include/SDL_keyboard.h \ | ||
../../../../include/SDL_keysym.h \ | ||
../../../../include/SDL_mouse.h \ | ||
../../../../include/SDL_mutex.h \ | ||
../../../../include/SDL_quit.h \ | ||
../../../../include/SDL_rwops.h \ | ||
../../../../include/SDL_syswm.h \ | ||
../../../../include/SDL_thread.h \ | ||
../../../../include/SDL_timer.h \ | ||
../../../../include/SDL_types.h \ | ||
../../../../include/SDL_version.h \ | ||
../../../../include/SDL_video.h | ||
|
||
|
||
all: $(EXPORTS) | ||
|
||
$(EXPORTS): $(HEADERS) | ||
perl gendef.pl $(HEADERS) >$@ || rm $@ | ||
|
||
clean: | ||
rm -f $(EXPORTS) |
Oops, something went wrong.