Browse Source

Merge branch 'master' of github.com:panda3d/panda3d

rdb 10 years ago
parent
commit
89b6ccf887

+ 25 - 1
direct/src/plugin/p3dInstanceManager.cxx

@@ -45,6 +45,10 @@
 #include <dirent.h>
 #include <dirent.h>
 #endif
 #endif
 
 
+#ifdef __APPLE__
+#include <sys/sysctl.h>
+#endif
+
 #include <stdio.h>
 #include <stdio.h>
 
 
 static ofstream logfile;
 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("win_i386");
       _supported_platforms.push_back("win32");
       _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
 #endif  // _WIN32
 
 
-    // TODO: OSX, Linux multiplatform support.  Just add the
+    // TODO: Linux multiplatform support.  Just add the
     // appropriate platform strings to _supported_platforms.
     // appropriate platform strings to _supported_platforms.
   }
   }
 
 

+ 12 - 8
panda/src/audiotraits/openalAudioManager.cxx

@@ -125,7 +125,7 @@ OpenALAudioManager() {
       alcGetError(_device); // clear errors
       alcGetError(_device); // clear errors
       _context = alcCreateContext(_device, NULL);
       _context = alcCreateContext(_device, NULL);
       alc_audio_errcheck("alcCreateContext(_device, NULL)",_device);
       alc_audio_errcheck("alcCreateContext(_device, NULL)",_device);
-      if (_context!=NULL) {
+      if (_context != NULL) {
         _openal_active = true;
         _openal_active = true;
       }
       }
     }
     }
@@ -142,20 +142,24 @@ OpenALAudioManager() {
   } else {
   } else {
     alcGetError(_device); // clear errors
     alcGetError(_device); // clear errors
     alcMakeContextCurrent(_context);
     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
     // set 3D sound characteristics as they are given in the configrc
     audio_3d_set_doppler_factor(audio_doppler_factor);
     audio_3d_set_doppler_factor(audio_doppler_factor);
     audio_3d_set_distance_factor(audio_distance_factor);
     audio_3d_set_distance_factor(audio_distance_factor);
     audio_3d_set_drop_off_factor(audio_drop_off_factor);
     audio_3d_set_drop_off_factor(audio_drop_off_factor);
-  }
 
 
-  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()
+        << "ALC_DEVICE_SPECIFIER:" << alcGetString(_device, ALC_DEVICE_SPECIFIER) << 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;
+  }
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 1 - 1
panda/src/cocoadisplay/cocoaGraphicsWindow.mm

@@ -159,7 +159,7 @@ begin_frame(FrameMode mode, Thread *current_thread) {
   // Set the drawable.
   // Set the drawable.
   if (_properties.get_fullscreen()) {
   if (_properties.get_fullscreen()) {
     // Fullscreen.
     // Fullscreen.
-    [cocoagsg->_context setFullScreen];
+    CGLSetFullScreenOnDisplay((CGLContextObj) [cocoagsg->_context CGLContextObj], CGDisplayIDToOpenGLDisplayMask(_display));
   } else {
   } else {
     // Although not recommended, it is technically possible to
     // Although not recommended, it is technically possible to
     // use the same context with multiple different-sized windows.
     // use the same context with multiple different-sized windows.