Commit d942ec32 authored by Sam Lantinga's avatar Sam Lantinga

MacOS Classic is no longer supported.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402025
parent f63cb9f2
...@@ -38,7 +38,7 @@ SDLMAIN_TARGET = libSDLmain.a ...@@ -38,7 +38,7 @@ SDLMAIN_TARGET = libSDLmain.a
SDLMAIN_SOURCES = @SDLMAIN_SOURCES@ SDLMAIN_SOURCES = @SDLMAIN_SOURCES@
SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@ SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
DIST = acinclude.m4 autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.in COPYING CREDITS CWprojects.sea.bin docs docs.html EpocBuildFiles.zip include INSTALL Makefile.dc Makefile.minimal Makefile.in MPWmake.sea.bin README* sdl-config.in sdl.m4 sdl.pc.in SDL.qpg.in SDL.spec SDL.spec.in src test TODO VisualCE.zip VisualC.html VisualC.zip Watcom-OS2.zip Watcom-Win32.zip WhatsNew Xcode.tar.gz DIST = acinclude.m4 autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.in COPYING CREDITS docs docs.html EpocBuildFiles.zip include INSTALL Makefile.dc Makefile.minimal Makefile.in README* sdl-config.in sdl.m4 sdl.pc.in SDL.qpg.in SDL.spec SDL.spec.in src test TODO VisualCE.zip VisualC.html VisualC.zip Watcom-OS2.zip Watcom-Win32.zip WhatsNew Xcode.tar.gz
LT_AGE = @LT_AGE@ LT_AGE = @LT_AGE@
LT_CURRENT = @LT_CURRENT@ LT_CURRENT = @LT_CURRENT@
......
...@@ -30,8 +30,6 @@ ...@@ -30,8 +30,6 @@
#include "SDL_config_amiga.h" #include "SDL_config_amiga.h"
#elif defined(__DREAMCAST__) #elif defined(__DREAMCAST__)
#include "SDL_config_dreamcast.h" #include "SDL_config_dreamcast.h"
#elif defined(__MACOS__)
#include "SDL_config_macos.h"
#elif defined(__MACOSX__) #elif defined(__MACOSX__)
#include "SDL_config_macosx.h" #include "SDL_config_macosx.h"
#elif defined(__WIN32__) #elif defined(__WIN32__)
......
...@@ -184,7 +184,6 @@ ...@@ -184,7 +184,6 @@
#undef SDL_CDROM_DUMMY #undef SDL_CDROM_DUMMY
#undef SDL_CDROM_FREEBSD #undef SDL_CDROM_FREEBSD
#undef SDL_CDROM_LINUX #undef SDL_CDROM_LINUX
#undef SDL_CDROM_MACOS
#undef SDL_CDROM_MACOSX #undef SDL_CDROM_MACOSX
#undef SDL_CDROM_MINT #undef SDL_CDROM_MINT
#undef SDL_CDROM_OPENBSD #undef SDL_CDROM_OPENBSD
...@@ -203,7 +202,6 @@ ...@@ -203,7 +202,6 @@
#undef SDL_JOYSTICK_IOKIT #undef SDL_JOYSTICK_IOKIT
#undef SDL_JOYSTICK_LINUX #undef SDL_JOYSTICK_LINUX
#undef SDL_JOYSTICK_LINUXEV #undef SDL_JOYSTICK_LINUXEV
#undef SDL_JOYSTICK_MACOS
#undef SDL_JOYSTICK_MINT #undef SDL_JOYSTICK_MINT
#undef SDL_JOYSTICK_OS2 #undef SDL_JOYSTICK_OS2
#undef SDL_JOYSTICK_RISCOS #undef SDL_JOYSTICK_RISCOS
...@@ -217,7 +215,6 @@ ...@@ -217,7 +215,6 @@
#undef SDL_LOADSO_DLOPEN #undef SDL_LOADSO_DLOPEN
#undef SDL_LOADSO_DUMMY #undef SDL_LOADSO_DUMMY
#undef SDL_LOADSO_LDG #undef SDL_LOADSO_LDG
#undef SDL_LOADSO_MACOS
#undef SDL_LOADSO_OS2 #undef SDL_LOADSO_OS2
#undef SDL_LOADSO_WIN32 #undef SDL_LOADSO_WIN32
...@@ -240,7 +237,6 @@ ...@@ -240,7 +237,6 @@
#undef SDL_TIMER_DC #undef SDL_TIMER_DC
#undef SDL_TIMER_DUMMY #undef SDL_TIMER_DUMMY
#undef SDL_TIMER_EPOC #undef SDL_TIMER_EPOC
#undef SDL_TIMER_MACOS
#undef SDL_TIMER_MINT #undef SDL_TIMER_MINT
#undef SDL_TIMER_OS2 #undef SDL_TIMER_OS2
#undef SDL_TIMER_RISCOS #undef SDL_TIMER_RISCOS
...@@ -254,7 +250,6 @@ ...@@ -254,7 +250,6 @@
#undef SDL_VIDEO_DRIVER_CYBERGRAPHICS #undef SDL_VIDEO_DRIVER_CYBERGRAPHICS
#undef SDL_VIDEO_DRIVER_DC #undef SDL_VIDEO_DRIVER_DC
#undef SDL_VIDEO_DRIVER_DIRECTFB #undef SDL_VIDEO_DRIVER_DIRECTFB
#undef SDL_VIDEO_DRIVER_DRAWSPROCKET
#undef SDL_VIDEO_DRIVER_DUMMY #undef SDL_VIDEO_DRIVER_DUMMY
#undef SDL_VIDEO_DRIVER_EPOC #undef SDL_VIDEO_DRIVER_EPOC
#undef SDL_VIDEO_DRIVER_FBCON #undef SDL_VIDEO_DRIVER_FBCON
...@@ -268,7 +263,6 @@ ...@@ -268,7 +263,6 @@
#undef SDL_VIDEO_DRIVER_PS2GS #undef SDL_VIDEO_DRIVER_PS2GS
#undef SDL_VIDEO_DRIVER_RISCOS #undef SDL_VIDEO_DRIVER_RISCOS
#undef SDL_VIDEO_DRIVER_SVGALIB #undef SDL_VIDEO_DRIVER_SVGALIB
#undef SDL_VIDEO_DRIVER_TOOLBOX
#undef SDL_VIDEO_DRIVER_VGL #undef SDL_VIDEO_DRIVER_VGL
#undef SDL_VIDEO_DRIVER_WIN32 #undef SDL_VIDEO_DRIVER_WIN32
#undef SDL_VIDEO_DRIVER_WSCONS #undef SDL_VIDEO_DRIVER_WSCONS
......
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_config_macos_h
#define _SDL_config_macos_h
#include "SDL_platform.h"
/* This is a set of defines to configure the SDL features */
#include <MacTypes.h>
typedef SInt8 int8_t;
typedef UInt8 uint8_t;
typedef SInt16 int16_t;
typedef UInt16 uint16_t;
typedef SInt32 int32_t;
typedef UInt32 uint32_t;
typedef SInt64 int64_t;
typedef UInt64 uint64_t;
typedef unsigned long uintptr_t;
#define SDL_HAS_64BIT_TYPE 1
/* Useful headers */
#define HAVE_STDIO_H 1
#define STDC_HEADERS 1
#define HAVE_STRING_H 1
#define HAVE_CTYPE_H 1
#define HAVE_MATH_H 1
#define HAVE_SIGNAL_H 1
/* C library functions */
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#define HAVE_ABS 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1
#define HAVE_STRLEN 1
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_ITOA 1
#define HAVE_STRTOL 1
#define HAVE_STRTOD 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
#define HAVE_STRCMP 1
#define HAVE_STRNCMP 1
#define HAVE_SSCANF 1
/* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_SNDMGR 1
#define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various cdrom drivers */
#if TARGET_API_MAC_CARBON
#define SDL_CDROM_DUMMY 1
#else
#define SDL_CDROM_MACOS 1
#endif
/* Enable various input drivers */
#if TARGET_API_MAC_CARBON
#define SDL_JOYSTICK_DUMMY 1
#else
#define SDL_JOYSTICK_MACOS 1
#endif
/* Enable various shared object loading systems */
#define SDL_LOADSO_MACOS 1
/* Enable various threading systems */
#define SDL_THREADS_DISABLED 1
/* Enable various timer systems */
#define SDL_TIMER_MACOS 1
/* Enable various video drivers */
#define SDL_VIDEO_DRIVER_DUMMY 1
#define SDL_VIDEO_DRIVER_DRAWSPROCKET 1
#define SDL_VIDEO_DRIVER_TOOLBOX 1
/* Enable OpenGL support */
#define SDL_VIDEO_OPENGL 1
#endif /* _SDL_config_macos_h */
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#if defined(__WIN32__) || \ #if defined(__WIN32__) || \
(defined(__MWERKS__) && !defined(__BEOS__)) || \ (defined(__MWERKS__) && !defined(__BEOS__)) || \
defined(__MACOS__) || \
defined(__SYMBIAN32__) || defined(QWS) defined(__SYMBIAN32__) || defined(QWS)
#ifdef __cplusplus #ifdef __cplusplus
...@@ -76,30 +75,6 @@ extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); ...@@ -76,30 +75,6 @@ extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
#include "close_code.h" #include "close_code.h"
#endif #endif
/* From the SDL library code -- needed for registering QuickDraw on MacOS */
#if defined(__MACOS__)
#include "begin_code.h"
#ifdef __cplusplus
/* *INDENT-OFF* */
extern "C" {
/* *INDENT-ON* */
#endif
/* Forward declaration so we don't need to include QuickDraw.h */
struct QDGlobals;
/* This should be called from your main() function, if any */
extern DECLSPEC void SDLCALL SDL_InitQuickDraw(struct QDGlobals *the_qd);
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif
#endif /* Need to redefine main()? */ #endif /* Need to redefine main()? */
#endif /* _SDL_main_h */ #endif /* _SDL_main_h */
......
...@@ -37,9 +37,6 @@ ...@@ -37,9 +37,6 @@
#if defined(__MACOSX__) #if defined(__MACOSX__)
#include <OpenGL/gl.h> /* Header File For The OpenGL Library */ #include <OpenGL/gl.h> /* Header File For The OpenGL Library */
#include <OpenGL/glu.h> /* Header File For The GLU Library */ #include <OpenGL/glu.h> /* Header File For The GLU Library */
#elif defined(__MACOS__)
#include <gl.h> /* Header File For The OpenGL Library */
#include <glu.h> /* Header File For The GLU Library */
#else #else
#include <GL/gl.h> /* Header File For The OpenGL Library */ #include <GL/gl.h> /* Header File For The OpenGL Library */
#include <GL/glu.h> /* Header File For The GLU Library */ #include <GL/glu.h> /* Header File For The GLU Library */
......
...@@ -102,9 +102,6 @@ ...@@ -102,9 +102,6 @@
#pragma nopackwarning #pragma nopackwarning
#endif #endif
#pragma pack(push,4) #pragma pack(push,4)
#elif (defined(__MWERKS__) && defined(__MACOS__))
#pragma options align=mac68k4byte
#pragma enumsalwaysint on
#endif /* Compiler needs structure packing set */ #endif /* Compiler needs structure packing set */
/* Set up compiler-specific options for inlining functions */ /* Set up compiler-specific options for inlining functions */
......
...@@ -31,10 +31,5 @@ ...@@ -31,10 +31,5 @@
#ifdef __BORLANDC__ #ifdef __BORLANDC__
#pragma nopackwarning #pragma nopackwarning
#endif #endif
#if (defined(__MWERKS__) && defined(__MACOS__))
#pragma options align=reset
#pragma enumsalwaysint reset
#else
#pragma pack(pop) #pragma pack(pop)
#endif
#endif /* Compiler needs structure packing set */ #endif /* Compiler needs structure packing set */
...@@ -532,9 +532,6 @@ SDL_OpenAudio(SDL_AudioSpec * desired, SDL_AudioSpec * obtained) ...@@ -532,9 +532,6 @@ SDL_OpenAudio(SDL_AudioSpec * desired, SDL_AudioSpec * obtained)
SDL_SetError("SDL_OpenAudio() passed a NULL callback"); SDL_SetError("SDL_OpenAudio() passed a NULL callback");
return (-1); return (-1);
} }
#if defined(__MACOS__) || (defined(__RISCOS__) && SDL_THREADS_DISABLED)
/* FIXME: Need to implement PPC interrupt asm for SDL_LockAudio() */
#else
#if defined(__MINT__) && SDL_THREADS_DISABLED #if defined(__MINT__) && SDL_THREADS_DISABLED
/* Uses interrupt driven audio, without thread */ /* Uses interrupt driven audio, without thread */
#else #else
...@@ -546,7 +543,6 @@ SDL_OpenAudio(SDL_AudioSpec * desired, SDL_AudioSpec * obtained) ...@@ -546,7 +543,6 @@ SDL_OpenAudio(SDL_AudioSpec * desired, SDL_AudioSpec * obtained)
return (-1); return (-1);
} }
#endif /* __MINT__ */ #endif /* __MINT__ */
#endif /* __MACOS__ */
/* Calculate the silence and size of the audio specification */ /* Calculate the silence and size of the audio specification */
SDL_CalculateAudioSpec(desired); SDL_CalculateAudioSpec(desired);
......
...@@ -26,9 +26,7 @@ ...@@ -26,9 +26,7 @@
#include "SDL_cdrom.h" #include "SDL_cdrom.h"
#include "SDL_syscdrom.h" #include "SDL_syscdrom.h"
#if !defined(__MACOS__)
#define CLIP_FRAMES 10 /* Some CD-ROMs won't go all the way */ #define CLIP_FRAMES 10 /* Some CD-ROMs won't go all the way */
#endif
static int SDL_cdinitted = 0; static int SDL_cdinitted = 0;
static SDL_CD *default_cdrom; static SDL_CD *default_cdrom;
......
...@@ -74,4 +74,5 @@ extern int SDL_SYS_CDInit(void); ...@@ -74,4 +74,5 @@ extern int SDL_SYS_CDInit(void);
/* Function to perform any system-specific CD-ROM related cleanup */ /* Function to perform any system-specific CD-ROM related cleanup */
extern void SDL_SYS_CDQuit(void); extern void SDL_SYS_CDQuit(void);
/* vi: set ts=4 sw=4 expandtab: */ /* vi: set ts=4 sw=4 expandtab: */
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2004 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
/* This is the MacOS specific header for the SDL CD-ROM API
Contributed by Matt Slot
*/
/* AppleCD Control calls */
#define kVerifyTheDisc 5 /* Returns noErr if there is disc inserted */
#define kEjectTheDisc 7 /* Eject disc from drive */
#define kUserEject 80 /* Enable/disable the CD-ROM eject button */
#define kReadTOC 100 /* Extract various TOC information from the disc */
#define kReadQ 101 /* Extract Q subcode info for the current track */
#define kAudioTrackSearch 103 /* Start playback from the indicated position */
#define kAudioPlay 104 /* Start playback from the indicated position */
#define kAudioPause 105 /* Pause/continue the playback */
#define kAudioStop 106 /* Stop playback at the indicated position */
#define kAudioStatus 107 /* Return audio play status */
#define kAudioControl 109 /* Set the output volume for the audio channels */
#define kReadAudioVolume 112 /* Get the output volume for the audio channels */
#define kSetTrackList 122 /* Set the track program for the audio CD to play */
#define kGetTrackList 123 /* Get the track program the audio CD is playing */
#define kGetTrackIndex 124 /* Get the track index the audio CD is playing */
#define kSetPlayMode 125 /* Set the audio tracks play mode */
#define kGetPlayMode 126 /* Get the audio tracks play mode */
/* AppleCD Status calls */
#define kGetDriveType 96 /* Get the type of the physical CD-ROM drive */
#define kWhoIsThere 97 /* Get a bitmap of SCSI IDs the driver controls */
#define kGetBlockSize 98 /* Get current block size of the CD-ROM drive */
/* AppleCD other constants */
#define kBlockPosition 0 /* Position at the specified logical block number */
#define kAbsMSFPosition 1 /* Position at the specified Min/Sec/Frame (in BCD) */
#define kTrackPosition 2 /* Position at the specified track number (in BCD) */
#define kIndexPosition 3 /* Position at the nth track in program (in BCD) */
#define kMutedPlayMode 0 /* Play the audio track with no output */
#define kStereoPlayMode 9 /* Play the audio track in normal stereo */
#define kControlFieldMask 0x0D /* Bits 3,2,0 in the nibble */
#define kDataTrackMask 0x04 /* Indicates Data Track */
#define kGetTrackRange 1 /* Query TOC for track numbers */
#define kGetLeadOutArea 2 /* Query TOC for "Lead Out" end of audio data */
#define kGetTrackEntries 3 /* Query TOC for track starts and data types */
#define kStatusPlaying 0 /* Audio Play operation in progress */
#define kStatusPaused 1 /* CD-ROM device in Hold Track ("Pause") state */
#define kStatusMuted 2 /* MUTING-ON operation in progress */
#define kStatusDone 3 /* Audio Play completed */
#define kStatusError 4 /* Error occurred during audio play operation */
#define kStatusStopped 5 /* Audio play operation not requested */
#define kPlayModeSequential 0 /* Play tracks in order */
#define kPlayModeShuffled 1 /* Play tracks randomly */
#define kPlayModeProgrammed 2 /* Use custom playlist */
/* AppleCD Gestalt selectors */
#define kGestaltAudioCDSelector 'aucd'
#define kDriverVersion52 0x00000520
#define kDriverVersion51 0x00000510
#define kDriverVersion50 0x00000500
/* Drive type constants */
#define kDriveAppleCD_SC 1
#define kDriveAppleCD_SCPlus_or_150 2
#define kDriveAppleCD_300_or_300Plus 3
/* Misc constants */
#define kFirstSCSIDevice -33
#define kLastSCSIDevice -40
#if PRAGMA_STRUCT_ALIGN
#pragma options align=mac68k
#endif
/* AppleCD driver parameter block */
typedef struct CDCntrlParam
{
QElemPtr qLink;
short qType;
short ioTrap;
Ptr ioCmdAddr;
IOCompletionUPP ioCompletion;
OSErr ioResult;
StringPtr ioNamePtr;
short ioVRefNum;
short ioCRefNum;
short csCode;
union
{
long longs[6];
short words[11];
unsigned char bytes[22];
struct
{
unsigned char status;
unsigned char play;
unsigned char control;
unsigned char minute;
unsigned char second;
unsigned char frame;
} cd;
} csParam;
} CDCntrlParam, *CDCntrlParamPtr;
typedef union CDTrackData
{
long value; /* Treat as a longword value */
struct
{
unsigned char reserved:4; /* Unused by AppleCD driver */
unsigned char control:4; /* Track flags (data track?) */
unsigned char min; /* Start of track (BCD) */
unsigned char sec; /* Start of track (BCD) */
unsigned char frame; /* Start of track (BCD) */
} entry; /* Broken into fields */
} CDTrackData, *CDTrackPtr;
#if PRAGMA_STRUCT_ALIGN
#pragma options align=reset
#endif
/* vi: set ts=4 sw=4 expandtab: */
...@@ -157,11 +157,7 @@ SDL_StartEventThread(Uint32 flags) ...@@ -157,11 +157,7 @@ SDL_StartEventThread(Uint32 flags)
#if !SDL_THREADS_DISABLED #if !SDL_THREADS_DISABLED
SDL_EventQ.lock = SDL_CreateMutex(); SDL_EventQ.lock = SDL_CreateMutex();
if (SDL_EventQ.lock == NULL) { if (SDL_EventQ.lock == NULL) {
#ifdef __MACOS__ /* MacOS classic you can't multithread, so no lock needed */
;
#else
return (-1); return (-1);
#endif
} }
#endif /* !SDL_THREADS_DISABLED */ #endif /* !SDL_THREADS_DISABLED */
SDL_EventQ.active = 1; SDL_EventQ.active = 1;
......
...@@ -37,11 +37,8 @@ ...@@ -37,11 +37,8 @@
#define CANT_THREAD_EVENTS #define CANT_THREAD_EVENTS
#endif #endif
#ifdef __MACOS__ /* MacOS 7/8 don't support preemptive multi-tasking */
#define CANT_THREAD_EVENTS
#endif
#ifdef __OS2__ /* The OS/2 event loop runs in a separate thread */ #ifdef __OS2__ /* The OS/2 event loop runs in a separate thread */
#define MUST_THREAD_EVENTS #define MUST_THREAD_EVENTS
#endif #endif
/* vi: set ts=4 sw=4 expandtab: */ /* vi: set ts=4 sw=4 expandtab: */
...@@ -349,51 +349,6 @@ mem_close(SDL_RWops * context) ...@@ -349,51 +349,6 @@ mem_close(SDL_RWops * context)
/* Functions to create SDL_RWops structures from various data sources */ /* Functions to create SDL_RWops structures from various data sources */
#ifdef __MACOS__
/*
* translate unix-style slash-separated filename to mac-style colon-separated
* name; return malloced string
*/
static char *
unix_to_mac(const char *file)
{
int flen = SDL_strlen(file);
char *path = SDL_malloc(flen + 2);
const char *src = file;
char *dst = path;
if (*src == '/') {
/* really depends on filesystem layout, hope for the best */
src++;
} else {
/* Check if this is a MacOS path to begin with */
if (*src != ':')
*dst++ = ':'; /* relative paths begin with ':' */
}
while (src < file + flen) {
const char *end = SDL_strchr(src, '/');
int len;
if (!end)
end = file + flen; /* last component */
len = end - src;
if (len == 0 || (len == 1 && src[0] == '.')) {
/* remove repeated slashes and . */
} else {
if (len == 2 && src[0] == '.' && src[1] == '.') {
/* replace .. with the empty string */
} else {
SDL_memcpy(dst, src, len);
dst += len;
}
if (end < file + flen)
*dst++ = ':';
}
src = end + 1;
}
*dst++ = '\0';
return path;
}
#endif /* __MACOS__ */
SDL_RWops * SDL_RWops *
SDL_RWFromFile(const char *file, const char *mode) SDL_RWFromFile(const char *file, const char *mode)
{ {
...@@ -421,15 +376,7 @@ SDL_RWFromFile(const char *file, const char *mode) ...@@ -421,15 +376,7 @@ SDL_RWFromFile(const char *file, const char *mode)
#elif HAVE_STDIO_H #elif HAVE_STDIO_H
#ifdef __MACOS__
{
char *mpath = unix_to_mac(file);
fp = fopen(mpath, mode);
SDL_free(mpath);
}
#else
fp = fopen(file, mode); fp = fopen(file, mode);
#endif
if (fp == NULL) { if (fp == NULL) {
SDL_SetError("Couldn't open %s", file); SDL_SetError("Couldn't open %s", file);
} else { } else {
......
...@@ -81,4 +81,5 @@ extern void SDL_SYS_JoystickClose(SDL_Joystick * joystick); ...@@ -81,4 +81,5 @@ extern void SDL_SYS_JoystickClose(SDL_Joystick * joystick);
/* Function to perform any system-specific joystick related cleanup */ /* Function to perform any system-specific joystick related cleanup */
extern void SDL_SYS_JoystickQuit(void); extern void SDL_SYS_JoystickQuit(void);
/* vi: set ts=4 sw=4 expandtab: */ /* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#ifdef SDL_JOYSTICK_MACOS
/* SDL stuff -- "SDL_sysjoystick.c"
MacOS joystick functions by Frederick Reitberger
The code that follows is meant for SDL. Use at your own risk.
*/
#include <InputSprocket.h>
#include "SDL_joystick.h"
#include "../SDL_sysjoystick.h"
#include "../SDL_joystick_c.h"
/* The max number of joysticks we will detect */
#define MAX_JOYSTICKS 16
/* Limit ourselves to 32 elements per device */
#define kMaxReferences 32
#define ISpSymmetricAxisToFloat(axis) ((((float) axis) - kISpAxisMiddle) / (kISpAxisMaximum-kISpAxisMiddle))
#define ISpAsymmetricAxisToFloat(axis) (((float) axis) / (kISpAxisMaximum))
static ISpDeviceReference SYS_Joysticks[MAX_JOYSTICKS];
static ISpElementListReference SYS_Elements[MAX_JOYSTICKS];
static ISpDeviceDefinition SYS_DevDef[MAX_JOYSTICKS];
struct joystick_hwdata
{
char name[64];
/* Uint8 id;*/
ISpElementReference refs[kMaxReferences];
/* gonna need some sort of mapping info */
};
/* Function to scan the system for joysticks.
* Joystick 0 should be the system default joystick.
* This function should return the number of available joysticks, or -1
* on an unrecoverable fatal error.
*/
int
SDL_SYS_JoystickInit(void)
{
static ISpDeviceClass classes[4] = {
kISpDeviceClass_Joystick,
#if kISpDeviceClass_Gamepad
kISpDeviceClass_Gamepad,
#endif
kISpDeviceClass_Wheel,
0
};
OSErr err;
int i;
UInt32 count, numJoysticks;
if ((Ptr) 0 == (Ptr) ISpStartup) {
SDL_SetError("InputSprocket not installed");
return -1; // InputSprocket not installed
}
if ((Ptr) 0 == (Ptr) ISpGetVersion) {
SDL_SetError("InputSprocket not version 1.1 or newer");
return -1; // old version of ISp (not at least 1.1)
}
ISpStartup();
/* Get all the joysticks */
numJoysticks = 0;
for (i = 0; classes[i]; ++i) {
count = 0;
err = ISpDevices_ExtractByClass(classes[i],
MAX_JOYSTICKS - numJoysticks,
&count, &SYS_Joysticks[numJoysticks]);
numJoysticks += count;
}
for (i = 0; i < numJoysticks; i++) {
ISpDevice_GetDefinition(SYS_Joysticks[i],
sizeof(ISpDeviceDefinition), &SYS_DevDef[i]);
err = ISpElementList_New(0, NULL, &SYS_Elements[i], 0);
if (err) {
SDL_OutOfMemory();
return -1;
}
ISpDevice_GetElementList(SYS_Joysticks[i], &SYS_Elements[i]);
}
ISpDevices_Deactivate(numJoysticks, SYS_Joysticks);
return numJoysticks;
}
/* Function to get the device-dependent name of a joystick */
const char *
SDL_SYS_JoystickName(int index)
{
static char name[64];
int len;
/* convert pascal string to c-string */
len = SYS_DevDef[index].deviceName[0];
if (len >= sizeof(name)) {
len = (sizeof(name) - 1);
}
SDL_memcpy(name, &SYS_DevDef[index].deviceName[1], len);
name[len] = '\0';
return name;
}
/* Function to open a joystick for use.
The joystick to open is specified by the index field of the joystick.
This should fill the nbuttons and naxes fields of the joystick structure.
It returns 0, or -1 if there is an error.
*/
int
SDL_SYS_JoystickOpen(SDL_Joystick * joystick)
{
int index;
UInt32 count, gotCount, count2;
long numAxis, numButtons, numHats, numBalls;
count = kMaxReferences;
count2 = 0;
numAxis = numButtons = numHats = numBalls = 0;
index = joystick->index;
/* allocate memory for system specific hardware data */
joystick->hwdata =
(struct joystick_hwdata *) SDL_malloc(sizeof(*joystick->hwdata));
if (joystick->hwdata == NULL) {
SDL_OutOfMemory();
return (-1);
}
SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata));
SDL_strlcpy(joystick->hwdata->name, SDL_SYS_JoystickName(index),
SDL_arraysize(joystick->hwdata->name));
joystick->name = joystick->hwdata->name;
ISpElementList_ExtractByKind(SYS_Elements[index],
kISpElementKind_Axis,
count, &gotCount, joystick->hwdata->refs);
numAxis = gotCount;
count -= gotCount;
count2 += gotCount;
ISpElementList_ExtractByKind(SYS_Elements[index],
kISpElementKind_DPad,
count,
&gotCount,
&(joystick->hwdata->refs[count2]));
numHats = gotCount;
count -= gotCount;
count2 += gotCount;
ISpElementList_ExtractByKind(SYS_Elements[index],
kISpElementKind_Button,
count,
&gotCount,
&(joystick->hwdata->refs[count2]));
numButtons = gotCount;
count -= gotCount;
count2 += gotCount;
joystick->naxes = numAxis;
joystick->nhats = numHats;
joystick->nballs = numBalls;
joystick->nbuttons = numButtons;
ISpDevices_Activate(1, &SYS_Joysticks[index]);
return 0;
}
/* Function to update the state of a joystick - called as a device poll.
* This function shouldn't update the joystick structure directly,
* but instead should call SDL_PrivateJoystick*() to deliver events
* and update joystick device state.
*/
void
SDL_SYS_JoystickUpdate(SDL_Joystick * joystick)
{
int i, j;
ISpAxisData a;
ISpDPadData b;
//ISpDeltaData c;
ISpButtonData d;
for (i = 0, j = 0; i < joystick->naxes; i++, j++) {
Sint16 value;
ISpElement_GetSimpleState(joystick->hwdata->refs[j], &a);
value = (ISpSymmetricAxisToFloat(a) * 32767.0);
if (value != joystick->axes[i]) {
SDL_PrivateJoystickAxis(joystick, i, value);
}
}
for (i = 0; i < joystick->nhats; i++, j++) {
Uint8 pos;
ISpElement_GetSimpleState(joystick->hwdata->refs[j], &b);
switch (b) {
case kISpPadIdle:
pos = SDL_HAT_CENTERED;
break;
case kISpPadLeft:
pos = SDL_HAT_LEFT;
break;
case kISpPadUpLeft:
pos = SDL_HAT_LEFTUP;
break;
case kISpPadUp:
pos = SDL_HAT_UP;
break;
case kISpPadUpRight:
pos = SDL_HAT_RIGHTUP;
break;
case kISpPadRight:
pos = SDL_HAT_RIGHT;
break;
case kISpPadDownRight:
pos = SDL_HAT_RIGHTDOWN;
break;
case kISpPadDown:
pos = SDL_HAT_DOWN;
break;
case kISpPadDownLeft:
pos = SDL_HAT_LEFTDOWN;
break;
}
if (pos != joystick->hats[i]) {
SDL_PrivateJoystickHat(joystick, i, pos);
}
}
for (i = 0; i < joystick->nballs; i++, j++) {
/* ignore balls right now */
}
for (i = 0; i < joystick->nbuttons; i++, j++) {
ISpElement_GetSimpleState(joystick->hwdata->refs[j], &d);
if (d != joystick->buttons[i]) {
SDL_PrivateJoystickButton(joystick, i, d);
}
}
}
/* Function to close a joystick after use */
void
SDL_SYS_JoystickClose(SDL_Joystick * joystick)
{
int index;
index = joystick->index;
ISpDevices_Deactivate(1, &SYS_Joysticks[index]);
}
/* Function to perform any system-specific joystick related cleanup */
void
SDL_SYS_JoystickQuit(void)
{
ISpShutdown();
}
#endif /* SDL_JOYSTICK_MACOS */
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#ifdef SDL_LOADSO_MACOS
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* System dependent library loading routines */
#include <stdio.h>
#include <string.h>
#define OLDP2C 1
#include <Strings.h>
#include <CodeFragments.h>
#include <Errors.h>
#include "SDL_loadso.h"
void *
SDL_LoadObject(const char *sofile)
{
void *handle = NULL;
const char *loaderror = NULL;
CFragConnectionID library_id;
Ptr mainAddr;
Str255 errName;
OSErr error;
char psofile[512];
SDL_strlcpy(psofile, sofile, SDL_arraysize(psofile));
error = GetSharedLibrary(C2PStr(psofile), kCompiledCFragArch,
kLoadCFrag, &library_id, &mainAddr, errName);
switch (error) {
case noErr:
loaderror = NULL;
break;
case cfragNoLibraryErr:
loaderror = "Library not found";
break;
case cfragUnresolvedErr:
loaderror = "Unabled to resolve symbols";
break;
case cfragNoPrivateMemErr:
case cfragNoClientMemErr:
loaderror = "Out of memory";
break;
default:
loaderror = "Unknown Code Fragment Manager error";
break;
}
if (loaderror == NULL) {
handle = (void *) (library_id);
} else {
SDL_SetError("Failed loading %s: %s", sofile, loaderror);
}
return (handle);
}
void *
SDL_LoadFunction(void *handle, const char *name)
{
void *symbol = NULL;
const char *loaderror = NULL;
CFragSymbolClass class;
CFragConnectionID library_id = (CFragConnectionID) handle;
char pname[512];
SDL_strlcpy(pname, name, SDL_arraysize(pname));
if (FindSymbol(library_id, C2PStr(pname),
(char **) &symbol, &class) != noErr) {
loaderror = "Symbol not found";
}
if (symbol == NULL) {
SDL_SetError("Failed loading %s: %s", name, loaderror);
}
return (symbol);
}
void
SDL_UnloadObject(void *handle)
{
CFragConnectionID library_id;
if (handle != NULL) {
library_id = (CFragConnectionID) handle;
CloseConnection(&library_id);
}
}
#endif /* SDL_LOADSO_MACOS */
/* vi: set ts=4 sw=4 expandtab: */
data 'DLOG' (1000) {
$"0072 0040 00EA 01B3 0001 0100 0000 0000 0000 03E8 0C43 6F6D 6D61 6E64 204C 696E" /* .r.@..............Command Lin */
$"6500 280A" /* e.( */
};
data 'DLOG' (1001) {
$"0072 0040 00DB 01AC 0001 0100 0000 0000 0000 03E9 0C45 7272 6F72 2057 696E 646F" /* .r.@..............Error Windo */
$"7700 280A" /* w.( */
};
data 'DLOG' (1002) {
$"00B8 00BE 0147 01D8 0005 0100 0000 0000 0000 03EA 1643 6F6E 6669 726D 2044 6973" /* ...G.............Confirm Dis */
$"706C 6179 2043 6861 6E67 6510 280A" /* play Change.( */
};
data 'DITL' (1000) {
$"0005 0000 0000 0052 0113 0066 0158 0402 4F4B 0000 0000 0052 00C2 0066 0107 0406" /* .......R...f.X..OK.....R..f.... */
$"4361 6E63 656C 0000 0000 000F 0084 001F 0155 1000 0000 0000 0054 0019 0066 007D" /* Cancel..........U.......T...f.} */
$"050E 4F75 7470 7574 2074 6F20 6669 6C65 0000 0000 000F 0018 001F 007F 080D 436F" /* ..Output to file..............Co */
$"6D6D 616E 6420 4C69 6E65 3A00 0000 0000 0030 0018 0040 0158 0702 0080" /* mmand Line:......0...@.X... */
};
data 'DITL' (1001) {
$"0001 0000 0000 0046 0120 005A 015A 0402 4F4B 0000 0000 0010 000A 0038 0160 0800" /* .......F. .Z.Z..OK........8.`.. */
};
data 'DITL' (1002) {
$"0002 0000 0000 006F 001E 0083 0058 0406 4361 6E63 656C 0000 0000 006E 00C0 0082" /* .......o....X..Cancel.....n.. */
$"00FA 0402 4F4B 0000 0000 000E 000F 005F 010C 88B3 5468 6520 7365 7474 696E 6720" /* ...OK........._..The setting */
$"666F 7220 796F 7572 206D 6F6E 6974 6F72 2068 6173 2062 6565 6E20 6368 616E 6765" /* for your monitor has been change */
$"642C 2061 6E64 2069 7420 6D61 7920 6E6F 7420 6265 2064 6973 706C 6179 6564 2063" /* d, and it may not be displayed c */
$"6F72 7265 6374 6C79 2E20 546F 2063 6F6E 6669 726D 2074 6865 2064 6973 706C 6179" /* orrectly. To confirm the display */
$"2069 7320 636F 7272 6563 742C 2063 6C69 636B 204F 4B2E 2054 6F20 7265 7475 726E" /* is correct, click OK. To return */
$"2074 6F20 7468 6520 6F72 6967 696E 616C 2073 6574 7469 6E67 2C20 636C 6963 6B20" /* to the original setting, click */
$"4361 6E63 656C 2E00" /* Cancel.. */
};
data 'MENU' (128, preload) {
$"0080 0000 0000 0000 0000 FFFF FFFB 0114 0C41 626F 7574 2053 444C 2E2E 2E00 0000" /* ............About SDL...... */
$"0001 2D00 0000 0000" /* ..-..... */
};
data 'MENU' (129) {
$"0081 0000 0000 0000 0000 FFFF FFFF 0C56 6964 656F 2044 7269 7665 7219 4472 6177" /* ..........Video Driver.Draw */
$"5370 726F 636B 6574 2028 4675 6C6C 7363 7265 656E 2900 0000 001E 546F 6F6C 426F" /* Sprocket (Fullscreen).....ToolBo */
$"7820 2028 4675 6C6C 7363 7265 656E 2F57 696E 646F 7765 6429 0000 0000 00" /* x (Fullscreen/Windowed)..... */
};
data 'CNTL' (128) {
$"0000 0000 0010 0140 0000 0100 0064 0081 03F0 0000 0000 0D56 6964 656F 2044 7269" /* .......@.....d.......Video Dri */
$"7665 723A" /* ver: */
};
data 'TMPL' (128, "CLne") {
$"0C43 6F6D 6D61 6E64 204C 696E 6550 5354 520C 5669 6465 6F20 4472 6976 6572 5053" /* .Command LinePSTR.Video DriverPS */
$"5452 0C53 6176 6520 546F 2046 696C 6542 4F4F 4C" /* TR.Save To FileBOOL */
};
This diff is collapsed.
#include "Processes.r"
resource 'SIZE' (-1) {
reserved,
acceptSuspendResumeEvents,
reserved,
canBackground,
doesActivateOnFGSwitch,
backgroundAndForeground,
getFrontClicks,
ignoreAppDiedEvents,
is32BitCompatible,
isHighLevelEventAware,
onlyLocalHLEvents,
notStationeryAware,
useTextEditServices,
reserved,
reserved,
reserved,
5242880, // 5 megs minimum
5242880 // 5 megs maximum
};
EXPORTS = SDL.x
HEADERS = \
../../../../include/SDL.h \
../../../../include/SDL_active.h \
../../../../include/SDL_audio.h \
../../../../include/SDL_cdrom.h \
../../../../include/SDL_copying.h \
../../../../include/SDL_cpuinfo.h \
../../../../include/SDL_endian.h \
../../../../include/SDL_error.h \
../../../../include/SDL_events.h \
../../../../include/SDL_joystick.h \
../../../../include/SDL_keyboard.h \
../../../../include/SDL_keysym.h \
../../../../include/SDL_loadso.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_version.h \
../../../../include/SDL_video.h
all: $(EXPORTS)
$(EXPORTS): Makefile gendef.pl $(HEADERS)
perl gendef.pl $(HEADERS) >$@ || rm $@
clean:
rm -f $(EXPORTS)
SDL_Init
SDL_InitSubSystem
SDL_QuitSubSystem
SDL_WasInit
SDL_Quit
SDL_GetAppState
SDL_AudioInit
SDL_AudioQuit
SDL_AudioDriverName
SDL_OpenAudio
SDL_GetAudioStatus
SDL_PauseAudio
SDL_LoadWAV_RW
SDL_FreeWAV
SDL_BuildAudioCVT
SDL_ConvertAudio
SDL_MixAudio
SDL_LockAudio
SDL_UnlockAudio
SDL_CloseAudio
SDL_CDNumDrives
SDL_CDName
SDL_CDOpen
SDL_CDStatus
SDL_CDPlayTracks
SDL_CDPlay
SDL_CDPause
SDL_CDResume
SDL_CDStop
SDL_CDEject
SDL_CDClose
SDL_HasRDTSC
SDL_HasMMX
SDL_HasMMXExt
SDL_Has3DNow
SDL_Has3DNowExt
SDL_HasSSE
SDL_HasSSE2
SDL_HasAltiVec
SDL_SetError
SDL_GetError
SDL_ClearError
SDL_Error
SDL_PumpEvents
SDL_PeepEvents
SDL_PollEvent
SDL_WaitEvent
SDL_PushEvent
SDL_SetEventFilter
SDL_GetEventFilter
SDL_EventState
SDL_NumJoysticks
SDL_JoystickName
SDL_JoystickOpen
SDL_JoystickOpened
SDL_JoystickIndex
SDL_JoystickNumAxes
SDL_JoystickNumBalls
SDL_JoystickNumHats
SDL_JoystickNumButtons
SDL_JoystickUpdate
SDL_JoystickEventState
SDL_JoystickGetAxis
SDL_JoystickGetHat
SDL_JoystickGetBall
SDL_JoystickGetButton
SDL_JoystickClose
SDL_EnableUNICODE
SDL_EnableKeyRepeat
SDL_GetKeyRepeat
SDL_GetKeyState
SDL_GetModState
SDL_SetModState
SDL_GetKeyName
SDL_LoadObject
SDL_LoadFunction
SDL_UnloadObject
SDL_GetMouseState
SDL_GetRelativeMouseState
SDL_WarpMouse
SDL_CreateCursor
SDL_SetCursor
SDL_GetCursor
SDL_FreeCursor
SDL_ShowCursor
SDL_CreateMutex
SDL_mutexP
SDL_mutexV
SDL_DestroyMutex
SDL_CreateSemaphore
SDL_DestroySemaphore
SDL_SemWait
SDL_SemTryWait
SDL_SemWaitTimeout
SDL_SemPost
SDL_SemValue
SDL_CreateCond
SDL_DestroyCond
SDL_CondSignal
SDL_CondBroadcast
SDL_CondWait
SDL_CondWaitTimeout
SDL_RWFromFile
SDL_RWFromFP
SDL_RWFromMem
SDL_RWFromConstMem
SDL_AllocRW
SDL_FreeRW
SDL_ReadLE16
SDL_ReadBE16
SDL_ReadLE32
SDL_ReadBE32
SDL_ReadLE64
SDL_ReadBE64
SDL_WriteLE16
SDL_WriteBE16
SDL_WriteLE32
SDL_WriteBE32
SDL_WriteLE64
SDL_WriteBE64
SDL_GetWMInfo
SDL_CreateThread
SDL_CreateThread
SDL_ThreadID
SDL_GetThreadID
SDL_WaitThread
SDL_KillThread
SDL_GetTicks
SDL_Delay
SDL_SetTimer
SDL_AddTimer
SDL_RemoveTimer
SDL_Linked_Version
SDL_VideoInit
SDL_VideoQuit
SDL_VideoDriverName
SDL_GetVideoSurface
SDL_GetVideoInfo
SDL_VideoModeOK
SDL_ListModes
SDL_SetVideoMode
SDL_UpdateRects
SDL_UpdateRect
SDL_Flip
SDL_SetGamma
SDL_SetGammaRamp
SDL_GetGammaRamp
SDL_SetColors
SDL_SetPalette
SDL_MapRGB
SDL_MapRGBA
SDL_GetRGB
SDL_GetRGBA
SDL_CreateRGBSurface
SDL_CreateRGBSurfaceFrom
SDL_FreeSurface
SDL_LockSurface
SDL_UnlockSurface
SDL_LoadBMP_RW
SDL_SaveBMP_RW
SDL_SetColorKey
SDL_SetAlpha
SDL_SetClipRect
SDL_GetClipRect
SDL_ConvertSurface
SDL_UpperBlit
SDL_LowerBlit
SDL_FillRect
SDL_DisplayFormat
SDL_DisplayFormatAlpha
SDL_CreateYUVOverlay
SDL_LockYUVOverlay
SDL_UnlockYUVOverlay
SDL_DisplayYUVOverlay
SDL_FreeYUVOverlay
SDL_GL_LoadLibrary
SDL_GL_GetProcAddress
SDL_GL_SetAttribute
SDL_GL_GetAttribute
SDL_GL_SwapBuffers
SDL_WM_SetCaption
SDL_WM_GetCaption
SDL_WM_SetIcon
SDL_WM_IconifyWindow
SDL_WM_ToggleFullScreen
SDL_WM_GrabInput
SDL_SoftStretch
SDL_putenv
SDL_getenv
SDL_qsort
SDL_revcpy
SDL_strlcpy
SDL_strlcat
SDL_strdup
SDL_strrev
SDL_strupr
SDL_strlwr
SDL_ltoa
SDL_ultoa
SDL_strcasecmp
SDL_strncasecmp
SDL_snprintf
SDL_vsnprintf
SDL_iconv
SDL_iconv_string
SDL_InitQuickDraw
#!/usr/bin/perl
#
# Program to take a set of header files and generate DLL export definitions
# Special exports to ignore for this platform
while ( ($file = shift(@ARGV)) ) {
if ( ! defined(open(FILE, $file)) ) {
warn "Couldn't open $file: $!\n";
next;
}
$printed_header = 0;
$file =~ s,.*/,,;
while (<FILE>) {
if ( / DECLSPEC.* SDLCALL ([^\s\(]+)/ ) {
if ( not $exclude{$1} ) {
print "\t$1\n";
}
}
}
close(FILE);
}
# Special exports to include for this platform
print "\tSDL_putenv\n";
print "\tSDL_getenv\n";
print "\tSDL_qsort\n";
print "\tSDL_revcpy\n";
print "\tSDL_strlcpy\n";
print "\tSDL_strlcat\n";
print "\tSDL_strdup\n";
print "\tSDL_strrev\n";
print "\tSDL_strupr\n";
print "\tSDL_strlwr\n";
print "\tSDL_ltoa\n";
print "\tSDL_ultoa\n";
print "\tSDL_strcasecmp\n";
print "\tSDL_strncasecmp\n";
print "\tSDL_snprintf\n";
print "\tSDL_vsnprintf\n";
print "\tSDL_iconv\n";
print "\tSDL_iconv_string\n";
print "\tSDL_InitQuickDraw\n";
This diff is collapsed.
/* File "FastTimes.h" - Original code by Matt Slot <fprefect@ambrosiasw.com> */
#include "SDL_config.h"
/* Created 4/24/99 - This file is hereby placed in the public domain */
/* Updated 5/21/99 - Calibrate to VIA, add TBR support, renamed functions */
/* Updated 10/4/99 - Use AbsoluteToNanoseconds() in case Absolute = double */
/* Updated 2/15/00 - Check for native Time Manager, no need to calibrate */
/* Updated 3/21/00 - Fixed ns conversion, create 2 different scale factors */
/* Updated 5/03/00 - Added copyright and placed into PD. No code changes */
/* This file is Copyright (C) Matt Slot, 1999-2000. It is hereby placed into
the public domain. The author makes no warranty as to fitness or stability */
#ifndef __FAST_TIMES_HEADER__
#define __FAST_TIMES_HEADER__
/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
extern void FastInitialize(void);
extern UInt64 FastMicroseconds(void);
extern UInt64 FastMilliseconds(void);
extern StringPtr FastMethod(void);
/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
#endif /* __FAST_TIMES_HEADER__ */
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#ifdef SDL_TIMER_MACOS
#include <Types.h>
#include <Timer.h>
#include <OSUtils.h>
#include <Gestalt.h>
#include <Processes.h>
#include <LowMem.h>
#include "SDL_timer.h"
#include "../SDL_timer_c.h"
#define MS_PER_TICK (1000/60) /* MacOS tick = 1/60 second */
/* Note: This is only a step above the original 1/60s implementation.
* For a good implementation, see FastTimes.[ch], by Matt Slot.
*/
#define USE_MICROSECONDS
#define WideTo64bit(w) (*(UInt64 *) &(w))
UInt64 start;
void
SDL_StartTicks(void)
{
#ifdef USE_MICROSECONDS
UnsignedWide now;
Microseconds(&now);
start = WideTo64bit(now);
#else
/* FIXME: Should we implement a wrapping algorithm, like Win32? */
#endif
}
Uint32
SDL_GetTicks(void)
{
#ifdef USE_MICROSECONDS
UnsignedWide now;
Microseconds(&now);
return (Uint32) ((WideTo64bit(now) - start) / 1000);
#else
return (LMGetTicks() * MS_PER_TICK);
#endif
}
void
SDL_Delay(Uint32 ms)
{
#ifdef USE_MICROSECONDS
Uint32 end_ms;
end_ms = SDL_GetTicks() + ms;
do {
/* FIXME: Yield CPU? */ ;
}
while (SDL_GetTicks() < end_ms);
#else
UInt32 unused; /* MJS */
Delay(ms / MS_PER_TICK, &unused);
#endif
}
/* Data to handle a single periodic alarm */
typedef struct _ExtendedTimerRec
{
TMTask tmTask;
ProcessSerialNumber taskPSN;
} ExtendedTimerRec, *ExtendedTimerPtr;
static ExtendedTimerRec gExtendedTimerRec;
int
SDL_SYS_TimerInit(void)
{
/* We don't need a setup? */
return (0);
}
void
SDL_SYS_TimerQuit(void)
{
/* We don't need a cleanup? */
return;
}
/* Our Stub routine to set up and then call the real routine. */
pascal void
TimerCallbackProc(TMTaskPtr tmTaskPtr)
{
Uint32 ms;
WakeUpProcess(&((ExtendedTimerPtr) tmTaskPtr)->taskPSN);
ms = SDL_alarm_callback(SDL_alarm_interval);
if (ms) {
SDL_alarm_interval = ROUND_RESOLUTION(ms);
PrimeTime((QElemPtr) & gExtendedTimerRec.tmTask, SDL_alarm_interval);
} else {
SDL_alarm_interval = 0;
}
}
int
SDL_SYS_StartTimer(void)
{
/*
* Configure the global structure that stores the timing information.
*/
gExtendedTimerRec.tmTask.qLink = NULL;
gExtendedTimerRec.tmTask.qType = 0;
gExtendedTimerRec.tmTask.tmAddr = NewTimerUPP(TimerCallbackProc);
gExtendedTimerRec.tmTask.tmCount = 0;
gExtendedTimerRec.tmTask.tmWakeUp = 0;
gExtendedTimerRec.tmTask.tmReserved = 0;
GetCurrentProcess(&gExtendedTimerRec.taskPSN);
/* Install the task record */
InsXTime((QElemPtr) & gExtendedTimerRec.tmTask);
/* Go! */
PrimeTime((QElemPtr) & gExtendedTimerRec.tmTask, SDL_alarm_interval);
return (0);
}
void
SDL_SYS_StopTimer(void)
{
RmvTime((QElemPtr) & gExtendedTimerRec.tmTask);
}
#endif /* SDL_TIMER_MACOS */
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#ifdef SDL_TIMER_MACOS
#include <Types.h>
#include <Timer.h>
#include <OSUtils.h>
#include <Gestalt.h>
#include <Processes.h>
#include <LowMem.h>
#include "SDL_timer.h"
#include "../SDL_timer_c.h"
#include "FastTimes.h"
#if TARGET_API_MAC_CARBON
#define NewTimerProc NewTimerUPP
#endif
#define MS_PER_TICK (1000.0/60.0) /* MacOS tick = 1/60 second */
#define kTwoPower32 (4294967296.0) /* 2^32 */
static double start_tick;
static int is_fast_inited = 0;
void
SDL_StartTicks(void)
{
if (!is_fast_inited) // important to check or FastTime may hang machine!
SDL_SYS_TimerInit();
start_tick = FastMicroseconds();
}
Uint32
SDL_GetTicks(void)
{
if (!is_fast_inited)
SDL_SYS_TimerInit();
return FastMilliseconds();
}
void
SDL_Delay(Uint32 ms)
{
Uint32 stop, now;
stop = SDL_GetTicks() + ms;
do {
#if TARGET_API_MAC_CARBON
MPYield();
#else
SystemTask();
#endif
now = SDL_GetTicks();
}
while (stop > now);
}
/*
void SDL_StartTicks(void)
{
// FIXME: Should we implement a wrapping algorithm, like Win32?
}
Uint32 SDL_GetTicks(void)
{
UnsignedWide ms;
Microseconds (&ms);
return ( ms.lo / 1000 );
}
void SDL_Delay(Uint32 ms)
{
UnsignedWide microsecs;
UInt32 stop;
Microseconds (&microsecs);
stop = microsecs.lo + (ms * 1000);
while ( stop > microsecs.lo ) {
SystemTask ();
Microseconds (&microsecs);
}
}*/
/* Data to handle a single periodic alarm */
typedef struct _ExtendedTimerRec
{
TMTask tmTask;
ProcessSerialNumber taskPSN;
} ExtendedTimerRec, *ExtendedTimerPtr;
static ExtendedTimerRec gExtendedTimerRec;
int
SDL_SYS_TimerInit(void)
{
FastInitialize();
is_fast_inited = 1;
return (0);
}
void
SDL_SYS_TimerQuit(void)
{
/* We don't need a cleanup? */
return;
}
/* Our Stub routine to set up and then call the real routine. */
pascal void
TimerCallbackProc(TMTaskPtr tmTaskPtr)
{
Uint32 ms;
WakeUpProcess(&((ExtendedTimerPtr) tmTaskPtr)->taskPSN);
ms = SDL_alarm_callback(SDL_alarm_interval);
if (ms) {
SDL_alarm_interval = ROUND_RESOLUTION(ms);
PrimeTime((QElemPtr) & gExtendedTimerRec.tmTask, SDL_alarm_interval);
} else {
SDL_alarm_interval = 0;
}
}
int
SDL_SYS_StartTimer(void)
{
/*
* Configure the global structure that stores the timing information.
*/
gExtendedTimerRec.tmTask.qLink = NULL;
gExtendedTimerRec.tmTask.qType = 0;
gExtendedTimerRec.tmTask.tmAddr = NewTimerProc(TimerCallbackProc);
gExtendedTimerRec.tmTask.tmCount = 0;
gExtendedTimerRec.tmTask.tmWakeUp = 0;
gExtendedTimerRec.tmTask.tmReserved = 0;
GetCurrentProcess(&gExtendedTimerRec.taskPSN);
/* Install the task record */
InsXTime((QElemPtr) & gExtendedTimerRec.tmTask);
/* Go! */
PrimeTime((QElemPtr) & gExtendedTimerRec.tmTask, SDL_alarm_interval);
return (0);
}
void
SDL_SYS_StopTimer(void)
{
RmvTime((QElemPtr) & gExtendedTimerRec.tmTask);
}
#endif /* SDL_TIMER_MACOS */
/* vi: set ts=4 sw=4 expandtab: */
...@@ -336,12 +336,6 @@ extern VideoBootStrap WIN32_bootstrap; ...@@ -336,12 +336,6 @@ extern VideoBootStrap WIN32_bootstrap;
#if SDL_VIDEO_DRIVER_BWINDOW #if SDL_VIDEO_DRIVER_BWINDOW
extern VideoBootStrap BWINDOW_bootstrap; extern VideoBootStrap BWINDOW_bootstrap;
#endif #endif
#if SDL_VIDEO_DRIVER_TOOLBOX
extern VideoBootStrap TOOLBOX_bootstrap;
#endif
#if SDL_VIDEO_DRIVER_DRAWSPROCKET
extern VideoBootStrap DSp_bootstrap;
#endif
#if SDL_VIDEO_DRIVER_CYBERGRAPHICS #if SDL_VIDEO_DRIVER_CYBERGRAPHICS
extern VideoBootStrap CGX_bootstrap; extern VideoBootStrap CGX_bootstrap;
#endif #endif
......
...@@ -85,12 +85,6 @@ static VideoBootStrap *bootstrap[] = { ...@@ -85,12 +85,6 @@ static VideoBootStrap *bootstrap[] = {
#if SDL_VIDEO_DRIVER_BWINDOW #if SDL_VIDEO_DRIVER_BWINDOW
&BWINDOW_bootstrap, &BWINDOW_bootstrap,
#endif #endif
#if SDL_VIDEO_DRIVER_TOOLBOX
&TOOLBOX_bootstrap,
#endif
#if SDL_VIDEO_DRIVER_DRAWSPROCKET
&DSp_bootstrap,
#endif
#if SDL_VIDEO_DRIVER_CYBERGRAPHICS #if SDL_VIDEO_DRIVER_CYBERGRAPHICS
&CGX_bootstrap, &CGX_bootstrap,
#endif #endif
......
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#ifndef _SDL_lowvideo_h
#define _SDL_lowvideo_h
#if defined(__APPLE__) && defined(__MACH__)
#include <Carbon/Carbon.h>
#elif TARGET_API_MAC_CARBON && (UNIVERSAL_INTERFACES_VERSION > 0x0335)
#include <Carbon.h>
#else
#include <Quickdraw.h>
#include <Palettes.h>
#include <Menus.h>
#include <DrawSprocket.h>
#endif
#if SDL_VIDEO_OPENGL
typedef struct __AGLContextRec *AGLContext;
#endif
#include "SDL_video.h"
#include "../SDL_sysvideo.h"
/* Hidden "this" pointer for the video functions */
#define _THIS SDL_VideoDevice *this
#if !TARGET_API_MAC_CARBON /* not available in OS X (or more accurately, Carbon) */
/* Global QuickDraw data */
extern QDGlobals *theQD;
#endif
/* Private display data */
struct SDL_PrivateVideoData
{
GDevice **SDL_Display;
WindowRef SDL_Window;
SDL_Rect **SDL_modelist;
CTabHandle SDL_CTab;
PaletteHandle SDL_CPal;
#if TARGET_API_MAC_CARBON
/* For entering and leaving fullscreen mode */
Ptr fullscreen_ctx;
#endif
/* The current window document style */
int current_style;
/* Information about the last cursor position */
Point last_where;
/* Information about the last keys down */
EventModifiers last_mods;
KeyMap last_keys;
/* A handle to the Apple Menu */
MenuRef apple_menu;
/* Information used by DrawSprocket driver */
struct DSpInfo *dspinfo;
#if SDL_VIDEO_OPENGL
AGLContext appleGLContext;
void *libraryHandle;
#endif
};
/* Old variable names */
#define SDL_Display (this->hidden->SDL_Display)
#define SDL_Window (this->hidden->SDL_Window)
#define SDL_modelist (this->hidden->SDL_modelist)
#define SDL_CTab (this->hidden->SDL_CTab)
#define SDL_CPal (this->hidden->SDL_CPal)
#define fullscreen_ctx (this->hidden->fullscreen_ctx)
#define current_style (this->hidden->current_style)
#define last_where (this->hidden->last_where)
#define last_mods (this->hidden->last_mods)
#define last_keys (this->hidden->last_keys)
#define apple_menu (this->hidden->apple_menu)
#define glContext (this->hidden->appleGLContext)
#endif /* _SDL_lowvideo_h */
/* vi: set ts=4 sw=4 expandtab: */
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#include "../macrom/SDL_romvideo.h"
/* Functions exported by SDL_macevents.c for the video subsystem
*/
extern void Mac_InitEvents(_THIS);
extern void Mac_QuitEvents(_THIS);
extern void Mac_InitOSKeymap(_THIS);
extern void Mac_PumpEvents(_THIS);
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
/* AGL implementation of SDL OpenGL support */
#include "SDL_lowvideo.h"
#include "SDL_macgl_c.h"
#include "SDL_loadso.h"
/* krat: adding OpenGL support */
int
Mac_GL_Init(_THIS)
{
#if SDL_VIDEO_OPENGL
AGLPixelFormat format;
int i = 0;
GLint attributes[26]; /* 26 is max possible in this setup */
GLboolean noerr;
/* load the gl driver from a default path */
if (!this->gl_config.driver_loaded) {
/* no driver has been loaded, use default (ourselves) */
if (Mac_GL_LoadLibrary(this, NULL) < 0) {
return (-1);
}
}
attributes[i++] = AGL_RGBA;
if (this->gl_config.red_size != 0 &&
this->gl_config.blue_size != 0 && this->gl_config.green_size != 0) {
attributes[i++] = AGL_RED_SIZE;
attributes[i++] = this->gl_config.red_size;
attributes[i++] = AGL_GREEN_SIZE;
attributes[i++] = this->gl_config.green_size;
attributes[i++] = AGL_BLUE_SIZE;
attributes[i++] = this->gl_config.blue_size;
attributes[i++] = AGL_ALPHA_SIZE;
attributes[i++] = this->gl_config.alpha_size;
}
if (this->gl_config.double_buffer) {
attributes[i++] = AGL_DOUBLEBUFFER;
}
if (this->gl_config.depth_size != 0) {
attributes[i++] = AGL_DEPTH_SIZE;
attributes[i++] = this->gl_config.depth_size;
}
if (this->gl_config.stencil_size != 0) {
attributes[i++] = AGL_STENCIL_SIZE;
attributes[i++] = this->gl_config.stencil_size;
}
if (this->gl_config.accum_red_size != 0 &&
this->gl_config.accum_blue_size != 0 &&
this->gl_config.accum_green_size != 0) {
attributes[i++] = AGL_ACCUM_RED_SIZE;
attributes[i++] = this->gl_config.accum_red_size;
attributes[i++] = AGL_ACCUM_GREEN_SIZE;
attributes[i++] = this->gl_config.accum_green_size;
attributes[i++] = AGL_ACCUM_BLUE_SIZE;
attributes[i++] = this->gl_config.accum_blue_size;
attributes[i++] = AGL_ACCUM_ALPHA_SIZE;
attributes[i++] = this->gl_config.accum_alpha_size;
}
if (this->gl_config.stereo) {
attributes[i++] = AGL_STEREO;
}
#if defined(AGL_SAMPLE_BUFFERS_ARB) && defined(AGL_SAMPLES_ARB)
if (this->gl_config.multisamplebuffers != 0) {
attributes[i++] = AGL_SAMPLE_BUFFERS_ARB;
attributes[i++] = this->gl_config.multisamplebuffers;
}
if (this->gl_config.multisamplesamples != 0) {
attributes[i++] = AGL_SAMPLES_ARB;
attributes[i++] = this->gl_config.multisamplesamples;
}
#endif
if (this->gl_config.accelerated > 0) {
attributes[i++] = AGL_ACCELERATED;
attributes[i++] = AGL_NO_RECOVERY;
}
attributes[i++] = AGL_ALL_RENDERERS;
attributes[i] = AGL_NONE;
format = aglChoosePixelFormat(NULL, 0, attributes);
if (format == NULL) {
SDL_SetError("Couldn't match OpenGL desired format");
return (-1);
}
glContext = aglCreateContext(format, NULL);
if (glContext == NULL) {
SDL_SetError("Couldn't create OpenGL context");
return (-1);
}
aglDestroyPixelFormat(format);
#if TARGET_API_MAC_CARBON
noerr = aglSetDrawable(glContext, GetWindowPort(SDL_Window));
#else
noerr = aglSetDrawable(glContext, (AGLDrawable) SDL_Window);
#endif
if (!noerr) {
SDL_SetError("Unable to bind GL context to window");
return (-1);
}
return (0);
#else
SDL_SetError("OpenGL support not configured");
return (-1);
#endif
}
void
Mac_GL_Quit(_THIS)
{
#if SDL_VIDEO_OPENGL
if (glContext != NULL) {
aglSetCurrentContext(NULL);
aglSetDrawable(glContext, NULL);
aglDestroyContext(glContext);
glContext = NULL;
}
#endif
}
#if SDL_VIDEO_OPENGL
/* Make the current context active */
int
Mac_GL_MakeCurrent(_THIS)
{
int retval;
retval = 0;
if (!aglSetCurrentContext(glContext)) {
SDL_SetError("Unable to make GL context current");
retval = -1;
}
return (retval);
}
void
Mac_GL_SwapBuffers(_THIS)
{
aglSwapBuffers(glContext);
}
int
Mac_GL_LoadLibrary(_THIS, const char *location)
{
if (location == NULL)
#if __MACH__
location = "/System/Library/Frameworks/OpenGL.framework/OpenGL";
#else
location = "OpenGLLibrary";
#endif
this->hidden->libraryHandle = SDL_LoadObject(location);
this->gl_config.driver_loaded = 1;
return (this->hidden->libraryHandle != NULL) ? 0 : -1;
}
void
Mac_GL_UnloadLibrary(_THIS)
{
SDL_UnloadObject(this->hidden->libraryHandle);
this->hidden->libraryHandle = NULL;
this->gl_config.driver_loaded = 0;
}
void *
Mac_GL_GetProcAddress(_THIS, const char *proc)
{
return SDL_LoadFunction(this->hidden->libraryHandle, proc);
}
#endif /* SDL_VIDEO_OPENGL */
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/* AGL implementation of SDL OpenGL support */
#include "SDL_config.h"
#if SDL_VIDEO_OPENGL
#include "SDL_opengl.h"
#if __MACOSX__
#include <AGL/agl.h> /* AGL.framework */
#else
#include <agl.h>
#endif
#endif /* SDL_VIDEO_OPENGL */
/* OpenGL functions */
extern int Mac_GL_Init(_THIS);
extern void Mac_GL_Quit(_THIS);
#if SDL_VIDEO_OPENGL
extern int Mac_GL_MakeCurrent(_THIS);
extern int Mac_GL_GetAttribute(_THIS, SDL_GLattr attrib, int *value);
extern void Mac_GL_SwapBuffers(_THIS);
extern int Mac_GL_LoadLibrary(_THIS, const char *location);
extern void Mac_GL_UnloadLibrary(_THIS);
extern void *Mac_GL_GetProcAddress(_THIS, const char *proc);
#endif
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/* These are the Macintosh key scancode constants -- from Inside Macintosh */
#define MK_ESCAPE 0x35
#define MK_F1 0x7A
#define MK_F2 0x78
#define MK_F3 0x63
#define MK_F4 0x76
#define MK_F5 0x60
#define MK_F6 0x61
#define MK_F7 0x62
#define MK_F8 0x64
#define MK_F9 0x65
#define MK_F10 0x6D
#define MK_F11 0x67
#define MK_F12 0x6F
#define MK_PRINT 0x69
#define MK_SCROLLOCK 0x6B
#define MK_PAUSE 0x71
#define MK_POWER 0x7F
#define MK_BACKQUOTE 0x32
#define MK_1 0x12
#define MK_2 0x13
#define MK_3 0x14
#define MK_4 0x15
#define MK_5 0x17
#define MK_6 0x16
#define MK_7 0x1A
#define MK_8 0x1C
#define MK_9 0x19
#define MK_0 0x1D
#define MK_MINUS 0x1B
#define MK_EQUALS 0x18
#define MK_BACKSPACE 0x33
#define MK_INSERT 0x72
#define MK_HOME 0x73
#define MK_PAGEUP 0x74
#define MK_NUMLOCK 0x47
#define MK_KP_EQUALS 0x51
#define MK_KP_DIVIDE 0x4B
#define MK_KP_MULTIPLY 0x43
#define MK_TAB 0x30
#define MK_q 0x0C
#define MK_w 0x0D
#define MK_e 0x0E
#define MK_r 0x0F
#define MK_t 0x11
#define MK_y 0x10
#define MK_u 0x20
#define MK_i 0x22
#define MK_o 0x1F
#define MK_p 0x23
#define MK_LEFTBRACKET 0x21
#define MK_RIGHTBRACKET 0x1E
#define MK_BACKSLASH 0x2A
#define MK_DELETE 0x75
#define MK_END 0x77
#define MK_PAGEDOWN 0x79
#define MK_KP7 0x59
#define MK_KP8 0x5B
#define MK_KP9 0x5C
#define MK_KP_MINUS 0x4E
#define MK_CAPSLOCK 0x39
#define MK_a 0x00
#define MK_s 0x01
#define MK_d 0x02
#define MK_f 0x03
#define MK_g 0x05
#define MK_h 0x04
#define MK_j 0x26
#define MK_k 0x28
#define MK_l 0x25
#define MK_SEMICOLON 0x29
#define MK_QUOTE 0x27
#define MK_RETURN 0x24
#define MK_KP4 0x56
#define MK_KP5 0x57
#define MK_KP6 0x58
#define MK_KP_PLUS 0x45
#define MK_LSHIFT 0x38
#define MK_z 0x06
#define MK_x 0x07
#define MK_c 0x08
#define MK_v 0x09
#define MK_b 0x0B
#define MK_n 0x2D
#define MK_m 0x2E
#define MK_COMMA 0x2B
#define MK_PERIOD 0x2F
#define MK_SLASH 0x2C
#if 0 /* These are the same as the left versions - use left by default */
#define MK_RSHIFT 0x38
#endif
#define MK_UP 0x7E
#define MK_KP1 0x53
#define MK_KP2 0x54
#define MK_KP3 0x55
#define MK_KP_ENTER 0x4C
#define MK_LCTRL 0x3B
#define MK_LALT 0x3A
#define MK_LMETA 0x37
#define MK_SPACE 0x31
#if 0 /* These are the same as the left versions - use left by default */
#define MK_RMETA 0x37
#define MK_RALT 0x3A
#define MK_RCTRL 0x3B
#endif
#define MK_LEFT 0x7B
#define MK_DOWN 0x7D
#define MK_RIGHT 0x7C
#define MK_KP0 0x52
#define MK_KP_PERIOD 0x41
/* Wierd, these keys are on my iBook under Mac OS X */
#define MK_IBOOK_ENTER 0x34
#define MK_IBOOK_LEFT 0x3B
#define MK_IBOOK_RIGHT 0x3C
#define MK_IBOOK_DOWN 0x3D
#define MK_IBOOK_UP 0x3E
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#if defined(__APPLE__) && defined(__MACH__)
#include <Carbon/Carbon.h>
#elif TARGET_API_MAC_CARBON && (UNIVERSAL_INTERFACES_VERSION > 0x0335)
#include <Carbon.h>
#else
#include <Quickdraw.h>
#endif
/* Routines that are not supported by the Carbon API... */
#if !TARGET_API_MAC_CARBON
#include <CursorDevices.h>
#endif
#include "SDL_mouse.h"
#include "SDL_macmouse_c.h"
/* The implementation dependent data for the window manager cursor */
struct WMcursor
{
Cursor curs;
};
void
Mac_FreeWMCursor(_THIS, WMcursor * cursor)
{
SDL_free(cursor);
}
WMcursor *
Mac_CreateWMCursor(_THIS,
Uint8 * data, Uint8 * mask, int w, int h, int hot_x,
int hot_y)
{
WMcursor *cursor;
int row, bytes;
/* Allocate the cursor memory */
cursor = (WMcursor *) SDL_malloc(sizeof(WMcursor));
if (cursor == NULL) {
SDL_OutOfMemory();
return (NULL);
}
SDL_memset(cursor, 0, sizeof(*cursor));
if (w > 16)
w = 16;
if (h > 16)
h = 16;
bytes = (w + 7) / 8;
for (row = 0; row < h; ++row) {
SDL_memcpy(&cursor->curs.data[row], data, bytes);
data += bytes;
}
for (row = 0; row < h; ++row) {
SDL_memcpy(&cursor->curs.mask[row], mask, bytes);
mask += bytes;
}
cursor->curs.hotSpot.h = hot_x;
cursor->curs.hotSpot.v = hot_y;
/* That was easy. :) */
return (cursor);
}
int Mac_cursor_showing = 1;
int
Mac_ShowWMCursor(_THIS, WMcursor * cursor)
{
if (cursor == NULL) {
if (Mac_cursor_showing) {
HideCursor();
Mac_cursor_showing = 0;
}
} else {
SetCursor(&cursor->curs);
if (!Mac_cursor_showing) {
ShowCursor();
Mac_cursor_showing = 1;
}
}
return (1);
}
void
Mac_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
{
#if !TARGET_API_MAC_CARBON
CursorDevice *cursordevice;
cursordevice = nil;
CursorDeviceNextDevice(&cursordevice);
if (cursordevice != nil) {
WindowPtr saveport;
Point where;
GetPort(&saveport);
SetPort(SDL_Window);
where.h = x;
where.v = y;
LocalToGlobal(&where);
SetPort(saveport);
CursorDeviceMoveTo(cursordevice, where.h, where.v);
}
#endif /* !TARGET_API_MAC_CARBON */
}
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#include "../macrom/SDL_romvideo.h"
/* Functions to be exported */
extern void Mac_FreeWMCursor(_THIS, WMcursor * cursor);
extern WMcursor *Mac_CreateWMCursor(_THIS,
Uint8 * data, Uint8 * mask, int w, int h,
int hot_x, int hot_y);
extern int Mac_ShowWMCursor(_THIS, WMcursor * cursor);
extern void Mac_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
/* Data to be exported */
extern int Mac_cursor_showing;
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#if defined(__APPLE__) && defined(__MACH__)
#include <Carbon/Carbon.h>
#elif TARGET_API_MAC_CARBON && (UNIVERSAL_INTERFACES_VERSION > 0x0335)
#include <Carbon.h>
#else
#include <Windows.h>
#include <Strings.h>
#endif
#include "SDL_stdinc.h"
#include "SDL_macwm_c.h"
void
Mac_SetCaption(_THIS, const char *title, const char *icon)
{
/* Don't convert C to P string in place, because it may be read-only */
Str255 ptitle; /* MJS */
ptitle[0] = strlen(title);
SDL_memcpy(ptitle + 1, title, ptitle[0]); /* MJS */
if (SDL_Window)
SetWTitle(SDL_Window, ptitle); /* MJS */
}
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#include "../macrom/SDL_romvideo.h"
/* Functions to be exported */
extern void Mac_SetCaption(_THIS, const char *title, const char *icon);
/* vi: set ts=4 sw=4 expandtab: */
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#ifndef _SDL_dspvideo_h
#define _SDL_dspvideo_h
#if TARGET_API_MAC_OSX
# include <DrawSprocket/DrawSprocket.h> /* Drawsprocket.framework */
#else
#include <DrawSprocket.h>
#endif
#include "../maccommon/SDL_lowvideo.h"
/* DrawSprocket specific information */
struct DSpInfo
{
DSpContextReference dsp_context;
CGrafPtr dsp_back_buffer;
int dsp_old_depth;
/* Flags for hw acceleration */
int dsp_vram_available;
int dsp_agp_available;
};
/* Old variable names */
#define dsp_context (this->hidden->dspinfo->dsp_context)
#define dsp_back_buffer (this->hidden->dspinfo->dsp_back_buffer)
#define dsp_old_depth (this->hidden->dspinfo->dsp_old_depth)
#define dsp_vram_available (this->hidden->dspinfo->dsp_vram_available)
#define dsp_agp_available (this->hidden->dspinfo->dsp_agp_available)
#endif /* _SDL_dspvideo_h */
/* vi: set ts=4 sw=4 expandtab: */
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#ifndef _SDL_romvideo_h
#define _SDL_romvideo_h
#include "../maccommon/SDL_lowvideo.h"
#endif /* _SDL_romvideo_h */
/* vi: set ts=4 sw=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment