diff --git a/direct/src/plugin/p3dInstanceManager.cxx b/direct/src/plugin/p3dInstanceManager.cxx index 27886267f0..b5536b8836 100644 --- a/direct/src/plugin/p3dInstanceManager.cxx +++ b/direct/src/plugin/p3dInstanceManager.cxx @@ -45,6 +45,10 @@ #include #endif +#ifdef __APPLE__ +#include +#endif + #include static ofstream logfile; @@ -230,9 +234,29 @@ initialize(int api_version, const string &contents_filename, _supported_platforms.push_back("win_i386"); _supported_platforms.push_back("win32"); } +#elif defined(__APPLE__) + if (_platform == "osx_amd64") { + _supported_platforms.push_back("osx_amd64"); + _supported_platforms.push_back("osx_i386"); + + } else if (_platform == "osx_i386") { + // This is a 32-bit process, but determine if the underlying OS + // supports 64-bit. + + int mib[2] = { CTL_HW, HW_MACHINE }; + char machine[512]; + size_t len = 511; + if (sysctl(mib, 2, (void *)machine, &len, NULL, 0) == 0) { + if (strcmp(machine, "x86_64") == 0) { + _supported_platforms.push_back("osx_amd64"); + } + } + + _supported_platforms.push_back("osx_i386"); + } #endif // _WIN32 - // TODO: OSX, Linux multiplatform support. Just add the + // TODO: Linux multiplatform support. Just add the // appropriate platform strings to _supported_platforms. } diff --git a/panda/src/audiotraits/openalAudioManager.cxx b/panda/src/audiotraits/openalAudioManager.cxx index e87ebee5f0..0a8faa896d 100644 --- a/panda/src/audiotraits/openalAudioManager.cxx +++ b/panda/src/audiotraits/openalAudioManager.cxx @@ -125,7 +125,7 @@ OpenALAudioManager() { alcGetError(_device); // clear errors _context = alcCreateContext(_device, NULL); alc_audio_errcheck("alcCreateContext(_device, NULL)",_device); - if (_context!=NULL) { + if (_context != NULL) { _openal_active = true; } } @@ -142,20 +142,24 @@ OpenALAudioManager() { } else { alcGetError(_device); // clear errors alcMakeContextCurrent(_context); - alc_audio_errcheck("alcMakeContextCurrent(_context)",_device); - + alc_audio_errcheck("alcMakeContextCurrent(_context)", _device); // set 3D sound characteristics as they are given in the configrc audio_3d_set_doppler_factor(audio_doppler_factor); audio_3d_set_distance_factor(audio_distance_factor); audio_3d_set_drop_off_factor(audio_drop_off_factor); + + if (audio_cat.is_debug()) { + audio_cat->debug() + << "ALC_DEVICE_SPECIFIER:" << alcGetString(_device, ALC_DEVICE_SPECIFIER) << endl; + } } - audio_cat->debug() << "ALC_DEVICE_SPECIFIER:" << alcGetString(_device, ALC_DEVICE_SPECIFIER) << endl; - audio_cat->debug() << "AL_RENDERER:" << alGetString(AL_RENDERER) << endl; - audio_cat->debug() << "AL_VENDOR:" << alGetString(AL_VENDOR) << endl; - audio_cat->debug() << "AL_VERSION:" << alGetString(AL_VERSION) << endl; - + if (audio_cat.is_debug()) { + audio_cat->debug() << "AL_RENDERER:" << alGetString(AL_RENDERER) << endl; + audio_cat->debug() << "AL_VENDOR:" << alGetString(AL_VENDOR) << endl; + audio_cat->debug() << "AL_VERSION:" << alGetString(AL_VERSION) << endl; + } } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/cocoadisplay/cocoaGraphicsWindow.mm b/panda/src/cocoadisplay/cocoaGraphicsWindow.mm index bcc859f1a8..efe9849ff5 100644 --- a/panda/src/cocoadisplay/cocoaGraphicsWindow.mm +++ b/panda/src/cocoadisplay/cocoaGraphicsWindow.mm @@ -159,7 +159,7 @@ begin_frame(FrameMode mode, Thread *current_thread) { // Set the drawable. if (_properties.get_fullscreen()) { // Fullscreen. - [cocoagsg->_context setFullScreen]; + CGLSetFullScreenOnDisplay((CGLContextObj) [cocoagsg->_context CGLContextObj], CGDisplayIDToOpenGLDisplayMask(_display)); } else { // Although not recommended, it is technically possible to // use the same context with multiple different-sized windows.