Browse Source

CallbackGraphicsWindow on Linux, but there are issues

David Rose 14 years ago
parent
commit
ce8af6bc29

+ 11 - 2
direct/src/wxwidgets/WxPandaWindow.py

@@ -119,10 +119,19 @@ else:
             if 'gsg' in kw:
                 gsg = kw['gsg']
                 del kw['gsg']
+
+            attribList = kw.get('attribList', None)
+            if attribList is None:
+                attribList = [
+                    wxgl.WX_GL_RGBA, True,
+                    wxgl.WX_GL_LEVEL, 0,
+                    wxgl.WX_GL_DOUBLEBUFFER, True,
+                    ]
+                kw['attribList'] = attribList
                 
             base.startWx()
             wxgl.GLCanvas.__init__(self, *args, **kw)
-
+                
             # Can't share the GSG when a new wxgl.GLContext is created
             # automatically.
             gsg = None
@@ -259,7 +268,7 @@ else:
 
 # Choose the best implementation of WxPandaWindow for the platform.
 WxPandaWindow = None
-if platform.system() == 'Darwin':
+if platform.system() == 'Darwin':  # or platform.system() == 'Linux':
     WxPandaWindow = OpenGLPandaWindow
 
 if not WxPandaWindow:

+ 14 - 0
panda/src/glxdisplay/glxGraphicsPipe.cxx

@@ -205,3 +205,17 @@ make_output(const string &name,
   // Nothing else left to try.
   return NULL;
 }
+
+////////////////////////////////////////////////////////////////////
+//     Function: glxGraphicsPipe::make_callback_gsg
+//       Access: Protected, Virtual
+//  Description: This is called when make_output() is used to create a
+//               CallbackGraphicsWindow.  If the GraphicsPipe can
+//               construct a GSG that's not associated with any
+//               particular window object, do so now, assuming the
+//               correct graphics context has been set up externally.
+////////////////////////////////////////////////////////////////////
+PT(GraphicsStateGuardian) glxGraphicsPipe::
+make_callback_gsg(GraphicsEngine *engine) {
+  return new glxGraphicsStateGuardian(engine, this, NULL);
+}

+ 1 - 0
panda/src/glxdisplay/glxGraphicsPipe.h

@@ -95,6 +95,7 @@ protected:
                                          GraphicsOutput *host,
                                          int retry,
                                          bool &precertify);
+  virtual PT(GraphicsStateGuardian) make_callback_gsg(GraphicsEngine *engine);
 
 public:
   static TypeHandle get_class_type() {