Browse Source

prefer main thread as window thread

David Rose 18 years ago
parent
commit
852006bfee
2 changed files with 19 additions and 0 deletions
  1. 18 0
      panda/src/osxdisplay/osxGraphicsPipe.cxx
  2. 1 0
      panda/src/osxdisplay/osxGraphicsPipe.h

+ 18 - 0
panda/src/osxdisplay/osxGraphicsPipe.cxx

@@ -68,6 +68,19 @@ pipe_constructor() {
   return new osxGraphicsPipe;
   return new osxGraphicsPipe;
 }
 }
 
 
+////////////////////////////////////////////////////////////////////
+//     Function: osxGraphicsPipe::get_preferred_window_thread
+//       Access: Public, Virtual
+//  Description: Returns an indication of the thread in which this
+//               GraphicsPipe requires its window processing to be
+//               performed: typically either the app thread (e.g. X)
+//               or the draw thread (Windows).
+////////////////////////////////////////////////////////////////////
+GraphicsPipe::PreferredWindowThread 
+osxGraphicsPipe::get_preferred_window_thread() const {
+  return PWT_app;
+}
+
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: osxGraphicsPipe::create_cg_image
 //     Function: osxGraphicsPipe::create_cg_image
 //       Access: Public, Static
 //       Access: Public, Static
@@ -120,6 +133,11 @@ create_cg_image(const PNMImage &pnm_image) {
     has_alpha = true;
     has_alpha = true;
     is_grayscale = false;
     is_grayscale = false;
     break;
     break;
+
+  case PNMImage::CT_invalid:
+    // Shouldn't get here.
+    nassertr(false, NULL);
+    break;
   }
   }
   nassertr(color_space_name != NULL, NULL);
   nassertr(color_space_name != NULL, NULL);
 
 

+ 1 - 0
panda/src/osxdisplay/osxGraphicsPipe.h

@@ -37,6 +37,7 @@ public:
 
 
   virtual string get_interface_name() const;
   virtual string get_interface_name() const;
   static PT(GraphicsPipe) pipe_constructor();
   static PT(GraphicsPipe) pipe_constructor();
+  virtual PreferredWindowThread get_preferred_window_thread() const;
 
 
   static CGImageRef create_cg_image(const PNMImage &pnm_image);
   static CGImageRef create_cg_image(const PNMImage &pnm_image);