浏览代码

pass GraphicsEngine to constructors

David Rose 17 年之前
父节点
当前提交
62096c99a4

+ 3 - 3
panda/src/osxdisplay/osxGraphicsBuffer.cxx

@@ -26,14 +26,14 @@ TypeHandle osxGraphicsBuffer::_type_handle;
 //  Description:
 //  Description:
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 osxGraphicsBuffer::
 osxGraphicsBuffer::
-osxGraphicsBuffer(GraphicsPipe *pipe,
+osxGraphicsBuffer(GraphicsEngine *engine, GraphicsPipe *pipe,
                   const string &name,
                   const string &name,
                   const FrameBufferProperties &fb_prop,
                   const FrameBufferProperties &fb_prop,
                   const WindowProperties &win_prop,
                   const WindowProperties &win_prop,
                   int flags,
                   int flags,
                   GraphicsStateGuardian *gsg,
                   GraphicsStateGuardian *gsg,
                   GraphicsOutput *host) :
                   GraphicsOutput *host) :
-  GraphicsBuffer(pipe, name, fb_prop, win_prop, flags, gsg, host)
+  GraphicsBuffer(engine, pipe, name, fb_prop, win_prop, flags, gsg, host)
 {
 {
   osxGraphicsPipe *osx_pipe;
   osxGraphicsPipe *osx_pipe;
   DCAST_INTO_V(osx_pipe, _pipe);
   DCAST_INTO_V(osx_pipe, _pipe);
@@ -142,7 +142,7 @@ bool osxGraphicsBuffer::
 open_buffer() {
 open_buffer() {
 
 
   if (_gsg == 0) {
   if (_gsg == 0) {
-    _gsg = new osxGraphicsStateGuardian(_pipe, NULL);
+    _gsg = new osxGraphicsStateGuardian(_engine, _pipe, NULL);
   }
   }
   
   
   return false;
   return false;

+ 1 - 1
panda/src/osxdisplay/osxGraphicsBuffer.h

@@ -30,7 +30,7 @@
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 class EXPCL_PANDAGL osxGraphicsBuffer : public GraphicsBuffer {
 class EXPCL_PANDAGL osxGraphicsBuffer : public GraphicsBuffer {
 public:
 public:
-  osxGraphicsBuffer(GraphicsPipe *pipe, 
+  osxGraphicsBuffer(GraphicsEngine *engine, GraphicsPipe *pipe, 
                     const string &name,
                     const string &name,
                     const FrameBufferProperties &fb_prop,
                     const FrameBufferProperties &fb_prop,
                     const WindowProperties &win_prop,
                     const WindowProperties &win_prop,

+ 2 - 1
panda/src/osxdisplay/osxGraphicsPipe.cxx

@@ -207,6 +207,7 @@ make_output(const string &name,
             const FrameBufferProperties &fb_prop,
             const FrameBufferProperties &fb_prop,
             const WindowProperties &win_prop,
             const WindowProperties &win_prop,
             int flags,
             int flags,
+            GraphicsEngine *engine,
             GraphicsStateGuardian *gsg,
             GraphicsStateGuardian *gsg,
             GraphicsOutput *host,
             GraphicsOutput *host,
             int retry,
             int retry,
@@ -232,7 +233,7 @@ make_output(const string &name,
         ((flags&BF_can_bind_every)!=0)) {
         ((flags&BF_can_bind_every)!=0)) {
       return NULL;
       return NULL;
     }
     }
-    return new osxGraphicsWindow(this, name, fb_prop, win_prop,
+    return new osxGraphicsWindow(engine, this, name, fb_prop, win_prop,
                                  flags, gsg, host);
                                  flags, gsg, host);
   }
   }
   
   

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

@@ -45,6 +45,7 @@ protected:
                                          const FrameBufferProperties &fb_prop,
                                          const FrameBufferProperties &fb_prop,
                                          const WindowProperties &win_prop,
                                          const WindowProperties &win_prop,
                                          int flags,
                                          int flags,
+                                         GraphicsEngine *engine,
                                          GraphicsStateGuardian *gsg,
                                          GraphicsStateGuardian *gsg,
                                          GraphicsOutput *host,
                                          GraphicsOutput *host,
                                          int retry,
                                          int retry,

+ 2 - 2
panda/src/osxdisplay/osxGraphicsStateGuardian.cxx

@@ -61,9 +61,9 @@ void *osxGraphicsStateGuardian::get_extension_func(const char *prefix, const cha
 //  Description:
 //  Description:
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 osxGraphicsStateGuardian::
 osxGraphicsStateGuardian::
-osxGraphicsStateGuardian(GraphicsPipe *pipe,
+osxGraphicsStateGuardian(GraphicsEngine *engine, GraphicsPipe *pipe,
                          osxGraphicsStateGuardian *share_with) :
                          osxGraphicsStateGuardian *share_with) :
-  GLGraphicsStateGuardian(pipe),
+  GLGraphicsStateGuardian(engine, pipe),
   _share_with(share_with),
   _share_with(share_with),
   _aglPixFmt(NULL),
   _aglPixFmt(NULL),
   _aglcontext(NULL)
   _aglcontext(NULL)

+ 1 - 1
panda/src/osxdisplay/osxGraphicsStateGuardian.h

@@ -33,7 +33,7 @@ class osxGraphicsWindow;
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 class osxGraphicsStateGuardian : public GLGraphicsStateGuardian {
 class osxGraphicsStateGuardian : public GLGraphicsStateGuardian {
 public:
 public:
-  osxGraphicsStateGuardian(GraphicsPipe *pipe,
+  osxGraphicsStateGuardian(GraphicsEngine *engine, GraphicsPipe *pipe,
                            osxGraphicsStateGuardian *share_with);
                            osxGraphicsStateGuardian *share_with);
   virtual ~osxGraphicsStateGuardian();
   virtual ~osxGraphicsStateGuardian();
   virtual void reset();
   virtual void reset();

+ 1 - 1
panda/src/osxdisplay/osxGraphicsWindow.h

@@ -33,7 +33,7 @@ OSStatus aglReportError (const std::string &);
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 class osxGraphicsWindow : public GraphicsWindow {
 class osxGraphicsWindow : public GraphicsWindow {
 public:
 public:
-  osxGraphicsWindow(GraphicsPipe *pipe, 
+  osxGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe, 
                     const string &name,
                     const string &name,
                     const FrameBufferProperties &fb_prop,
                     const FrameBufferProperties &fb_prop,
                     const WindowProperties &win_prop,
                     const WindowProperties &win_prop,

+ 9 - 9
panda/src/osxdisplay/osxGraphicsWindow.mm

@@ -600,14 +600,14 @@ static int id_seed = 100;
 //       Access: Public
 //       Access: Public
 //  Description:
 //  Description:
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-osxGraphicsWindow::osxGraphicsWindow(GraphicsPipe *pipe, 
-                  						const string &name,
-                  						const FrameBufferProperties &fb_prop,
-                  						const WindowProperties &win_prop,
-                  						int flags,
-                  						GraphicsStateGuardian *gsg,
-                  						GraphicsOutput *host) :
-  GraphicsWindow(pipe, name, fb_prop, win_prop, flags, gsg, host),
+osxGraphicsWindow::osxGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe, 
+                                     const string &name,
+                                     const FrameBufferProperties &fb_prop,
+                                     const WindowProperties &win_prop,
+                                     int flags,
+                                     GraphicsStateGuardian *gsg,
+                                     GraphicsOutput *host) :
+  GraphicsWindow(engine, pipe, name, fb_prop, win_prop, flags, gsg, host),
   _osx_window(NULL),
   _osx_window(NULL),
   _is_fullscreen(false),
   _is_fullscreen(false),
   _pending_icon(NULL),
   _pending_icon(NULL),
@@ -1020,7 +1020,7 @@ bool osxGraphicsWindow::open_window()
   
   
   if (_gsg == 0)
   if (_gsg == 0)
   {
   {
-    _gsg = new osxGraphicsStateGuardian(_pipe, NULL);
+    _gsg = new osxGraphicsStateGuardian(_engine, _pipe, NULL);
   }
   }
   
   
   //OSXGloablMutex().lock();
   //OSXGloablMutex().lock();

+ 3 - 2
panda/src/tinydisplay/tinyOsxGraphicsPipe.cxx

@@ -200,6 +200,7 @@ make_output(const string &name,
             const FrameBufferProperties &fb_prop,
             const FrameBufferProperties &fb_prop,
             const WindowProperties &win_prop,
             const WindowProperties &win_prop,
             int flags,
             int flags,
+            GraphicsEngine *engine,
             GraphicsStateGuardian *gsg,
             GraphicsStateGuardian *gsg,
             GraphicsOutput *host,
             GraphicsOutput *host,
             int retry,
             int retry,
@@ -233,7 +234,7 @@ make_output(const string &name,
         return NULL;
         return NULL;
       }
       }
     }
     }
-    return new TinyOsxGraphicsWindow(this, name, fb_prop, win_prop,
+    return new TinyOsxGraphicsWindow(engine, this, name, fb_prop, win_prop,
                                      flags, gsg, host);
                                      flags, gsg, host);
   }
   }
   
   
@@ -243,7 +244,7 @@ make_output(const string &name,
         ((flags&BF_require_window)!=0)) {
         ((flags&BF_require_window)!=0)) {
       return NULL;
       return NULL;
     }
     }
-    return new TinyGraphicsBuffer(this, name, fb_prop, win_prop, flags, gsg, host);
+    return new TinyGraphicsBuffer(engine, this, name, fb_prop, win_prop, flags, gsg, host);
   }
   }
   
   
   // Nothing else left to try.
   // Nothing else left to try.

+ 1 - 0
panda/src/tinydisplay/tinyOsxGraphicsPipe.h

@@ -50,6 +50,7 @@ protected:
                                          const FrameBufferProperties &fb_prop,
                                          const FrameBufferProperties &fb_prop,
                                          const WindowProperties &win_prop,
                                          const WindowProperties &win_prop,
                                          int flags,
                                          int flags,
+                                         GraphicsEngine *engine,
                                          GraphicsStateGuardian *gsg,
                                          GraphicsStateGuardian *gsg,
                                          GraphicsOutput *host,
                                          GraphicsOutput *host,
                                          int retry,
                                          int retry,

+ 1 - 1
panda/src/tinydisplay/tinyOsxGraphicsWindow.h

@@ -32,7 +32,7 @@
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 class TinyOsxGraphicsWindow : public GraphicsWindow {
 class TinyOsxGraphicsWindow : public GraphicsWindow {
 public:
 public:
-  TinyOsxGraphicsWindow(GraphicsPipe *pipe, 
+  TinyOsxGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe, 
                         const string &name,
                         const string &name,
                         const FrameBufferProperties &fb_prop,
                         const FrameBufferProperties &fb_prop,
                         const WindowProperties &win_prop,
                         const WindowProperties &win_prop,

+ 9 - 9
panda/src/tinydisplay/tinyOsxGraphicsWindow.mm

@@ -480,14 +480,14 @@ static int id_seed = 100;
 //       Access: Public
 //       Access: Public
 //  Description:
 //  Description:
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-TinyOsxGraphicsWindow::TinyOsxGraphicsWindow(GraphicsPipe *pipe, 
-                  						const string &name,
-                  						const FrameBufferProperties &fb_prop,
-                  						const WindowProperties &win_prop,
-                  						int flags,
-                  						GraphicsStateGuardian *gsg,
-                  						GraphicsOutput *host) :
-  GraphicsWindow(pipe, name, fb_prop, win_prop, flags, gsg, host),
+TinyOsxGraphicsWindow::TinyOsxGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe, 
+                                             const string &name,
+                                             const FrameBufferProperties &fb_prop,
+                                             const WindowProperties &win_prop,
+                                             int flags,
+                                             GraphicsStateGuardian *gsg,
+                                             GraphicsOutput *host) :
+  GraphicsWindow(engine, pipe, name, fb_prop, win_prop, flags, gsg, host),
   _osx_window(NULL),
   _osx_window(NULL),
   _is_fullscreen(false),
   _is_fullscreen(false),
   _pending_icon(NULL),
   _pending_icon(NULL),
@@ -801,7 +801,7 @@ bool TinyOsxGraphicsWindow::open_window()
   TinyGraphicsStateGuardian *tinygsg;
   TinyGraphicsStateGuardian *tinygsg;
   if (_gsg == 0) {
   if (_gsg == 0) {
     // There is no old gsg.  Create a new one.
     // There is no old gsg.  Create a new one.
-    tinygsg = new TinyGraphicsStateGuardian(_pipe, NULL);
+    tinygsg = new TinyGraphicsStateGuardian(_engine, _pipe, NULL);
     _gsg = tinygsg;
     _gsg = tinygsg;
   } else {
   } else {
     DCAST_INTO_R(tinygsg, _gsg, false);
     DCAST_INTO_R(tinygsg, _gsg, false);