diff --git a/direct/src/wxwidgets/WxPandaWindow.py b/direct/src/wxwidgets/WxPandaWindow.py index 8b2aa818d2..a756ffa2c3 100644 --- a/direct/src/wxwidgets/WxPandaWindow.py +++ b/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: diff --git a/panda/src/glxdisplay/glxGraphicsPipe.cxx b/panda/src/glxdisplay/glxGraphicsPipe.cxx index a5a290113c..8ebb460df7 100644 --- a/panda/src/glxdisplay/glxGraphicsPipe.cxx +++ b/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); +} diff --git a/panda/src/glxdisplay/glxGraphicsPipe.h b/panda/src/glxdisplay/glxGraphicsPipe.h index 3157665078..f2657b40bc 100644 --- a/panda/src/glxdisplay/glxGraphicsPipe.h +++ b/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() {